[Ada] Consistent tree decoration to import C++ classes

Arnaud Charlet charlet@adacore.com
Tue Jul 17 09:57:00 GMT 2012


For consistency, entity Ada.Tags.Prim_Ptr must be decorated with
attribute Is_Dispatch_Table_Entity to help the backend generating
code for dispatching calls. This decoration was missing in CPP_Types
thus causing problems in some architectures (for example, IA-64/Linux).

Tested on x86_64-pc-linux-gnu, committed on trunk

2012-07-17  Javier Miranda  <miranda@adacore.com>

	* exp_disp.adb (Make_DT): Remove decoration of Ada.Tags entities.
	(Make_Tags): Add decoration of Ada.Tags entities.

-------------- next part --------------
Index: exp_disp.adb
===================================================================
--- exp_disp.adb	(revision 189565)
+++ exp_disp.adb	(working copy)
@@ -6255,12 +6255,6 @@
             Elmt : Elmt_Id;
 
          begin
-            --  Ensure that entities Prim_Ptr and Predef_Prims_Table_Ptr have
-            --  the decoration required by the backend
-
-            Set_Is_Dispatch_Table_Entity (RTE (RE_Prim_Ptr));
-            Set_Is_Dispatch_Table_Entity (RTE (RE_Predef_Prims_Table_Ptr));
-
             --  Object declarations
 
             Elmt := First_Elmt (DT_Decl);
@@ -7137,6 +7131,12 @@
       Set_Ekind        (DT_Ptr, E_Variable);
       Set_Related_Type (DT_Ptr, Typ);
 
+      --  Ensure that entities Prim_Ptr and Predef_Prims_Table_Ptr have
+      --  the decoration required by the backend
+
+      Set_Is_Dispatch_Table_Entity (RTE (RE_Prim_Ptr));
+      Set_Is_Dispatch_Table_Entity (RTE (RE_Predef_Prims_Table_Ptr));
+
       --  For CPP types there is no need to build the dispatch tables since
       --  they are imported from the C++ side. If the CPP type has an IP then
       --  we declare now the variable that will store the copy of the C++ tag.


More information about the Gcc-patches mailing list