Commit 3f02ce5d by Matthew Gingell Committed by Arnaud Charlet

i-cpp.ads, i-cpp.adb: Change layout of VTable for new C++ ABI.

2004-10-26  Matthew Gingell  <gingell@gnat.com>

	* i-cpp.ads, i-cpp.adb: Change layout of VTable for new C++ ABI.

From-SVN: r89655
parent 9cc29fc6
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Tags; use Ada.Tags; with Ada.Tags; use Ada.Tags;
with Interfaces.C; use Interfaces.C;
with System; use System; with System; use System;
with System.Storage_Elements; use System.Storage_Elements; with System.Storage_Elements; use System.Storage_Elements;
with Unchecked_Conversion; with Unchecked_Conversion;
...@@ -60,10 +59,8 @@ package body Interfaces.CPP is ...@@ -60,10 +59,8 @@ package body Interfaces.CPP is
type Vtable_Entry_Array is array (Positive range <>) of Vtable_Entry; type Vtable_Entry_Array is array (Positive range <>) of Vtable_Entry;
type VTable is record type VTable is record
Unused1 : C.short;
Unused2 : C.short;
TSD : Type_Specific_Data_Ptr;
Prims_Ptr : Vtable_Entry_Array (Positive); Prims_Ptr : Vtable_Entry_Array (Positive);
TSD : Type_Specific_Data_Ptr;
end record; end record;
-------------------------------------------------------- --------------------------------------------------------
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2000, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -41,15 +41,16 @@ package Interfaces.CPP is ...@@ -41,15 +41,16 @@ package Interfaces.CPP is
package S renames System; package S renames System;
package SSE renames System.Storage_Elements; package SSE renames System.Storage_Elements;
-- This package corresponds to Ada.Tags but applied to tagged types -- This package corresponds to Ada.Tags but applied to tagged
-- which are 'imported' from C++ and correspond to exactly to a C++ -- types which are 'imported' from C++ and correspond exactly to a
-- Class. GNAT doesn't know about the structure od the C++ dispatch -- C++ Class. GNAT doesn't know about the structure of the C++
-- table (Vtable) but always access it through the procedural interface -- dispatch table (Vtable) but always accesses it through the
-- defined below, thus the implementation of this package (the body) can -- procedural interface defined below, thus the implementation of
-- be customized to another C++ compiler without any change in the -- this package (the body) can be customized to another C++
-- compiler code itself as long as this procedural interface is -- compiler without any change in the compiler code itself as long
-- respected. Note that Ada.Tags defines a very similar procedural -- as this procedural interface is respected. Note that Ada.Tags
-- interface to the regular Ada Dispatch Table. -- defines a very similar procedural interface to the regular Ada
-- Dispatch Table.
type Vtable_Ptr is private; type Vtable_Ptr is private;
...@@ -95,7 +96,7 @@ private ...@@ -95,7 +96,7 @@ private
CPP_DT_Prologue_Size : constant SSE.Storage_Count := CPP_DT_Prologue_Size : constant SSE.Storage_Count :=
SSE.Storage_Count SSE.Storage_Count
(2 * (Standard'Address_Size / S.Storage_Unit)); (1 * (Standard'Address_Size / S.Storage_Unit));
-- Size of the first part of the dispatch table -- Size of the first part of the dispatch table
CPP_DT_Entry_Size : constant SSE.Storage_Count := CPP_DT_Entry_Size : constant SSE.Storage_Count :=
...@@ -110,7 +111,7 @@ private ...@@ -110,7 +111,7 @@ private
CPP_TSD_Entry_Size : constant SSE.Storage_Count := CPP_TSD_Entry_Size : constant SSE.Storage_Count :=
SSE.Storage_Count SSE.Storage_Count
(Standard'Address_Size / S.Storage_Unit); (1 * (Standard'Address_Size / S.Storage_Unit));
-- Size of each ancestor tag entry in the TSD -- Size of each ancestor tag entry in the TSD
procedure CPP_Inherit_DT procedure CPP_Inherit_DT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment