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

login
register
mail settings
Submitter Arnaud Charlet
Date July 17, 2012, 9:57 a.m.
Message ID <20120717095725.GA13027@adacore.com>
Download mbox | patch
Permalink /patch/171369/
State New
Headers show

Comments

Arnaud Charlet - July 17, 2012, 9:57 a.m.
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.

Patch

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.