]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 28 Jul 2009 09:11:53 +0000 (11:11 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 28 Jul 2009 09:11:53 +0000 (11:11 +0200)
2009-07-28  Arnaud Charlet  <charlet@adacore.com>

* frontend.adb: Minor reformatting.
(Frontend): Only call Check_SCIL_Nodes if assertions are enabled,
for efficiency.

2009-07-28  Bob Duff  <duff@adacore.com>

* exp_attr.adb (Expand_Access_To_Protected_Op): Use 'Access instead of
'Address to get a pointer to the protected body wrapper.

From-SVN: r150150

gcc/ada/ChangeLog
gcc/ada/exp_attr.adb
gcc/ada/frontend.adb

index 0fe4ef446242fe6386ce31cca0a32221f6b1ab3d..e5a9d728c073922bc9d7db526bd9d6039bd50f16 100644 (file)
@@ -1,3 +1,14 @@
+2009-07-28  Arnaud Charlet  <charlet@adacore.com>
+
+       * frontend.adb: Minor reformatting.
+       (Frontend): Only call Check_SCIL_Nodes if assertions are enabled,
+       for efficiency.
+
+2009-07-28  Bob Duff  <duff@adacore.com>
+
+       * exp_attr.adb (Expand_Access_To_Protected_Op): Use 'Access instead of
+       'Address to get a pointer to the protected body wrapper.
+
 2009-07-28  Javier Miranda  <miranda@adacore.com>
 
        * gnat1drv.adb (Adjust_Global_Switches): Disable generation of SCIL
index 599d0ca53238912169c0921741723a998d63c7e9..56fa4c46a03d9a88a033d47416f08bab1b3673a4 100644 (file)
@@ -235,6 +235,7 @@ package body Exp_Attr is
       Agg     : Node_Id;
       Btyp    : constant Entity_Id := Base_Type (Typ);
       Sub     : Entity_Id;
+      Sub_Ref : Node_Id;
       E_T     : constant Entity_Id := Equivalent_Type (Btyp);
       Acc     : constant Entity_Id :=
                   Etype (Next_Component (First_Component (E_T)));
@@ -355,15 +356,23 @@ package body Exp_Attr is
                Attribute_Name => Name_Address);
       end if;
 
+      Sub_Ref :=
+        Make_Attribute_Reference (Loc,
+          Prefix => Sub,
+          Attribute_Name => Name_Access);
+
+      --  We set the type of the access reference to the already generated
+      --  access_to_subprogram type, and declare the reference analyzed, to
+      --  prevent further expansion when the enclosing aggregate is analyzed.
+
+      Set_Etype (Sub_Ref, Acc);
+      Set_Analyzed (Sub_Ref);
+
       Agg :=
         Make_Aggregate (Loc,
           Expressions =>
             New_List (
-              Obj_Ref,
-              Unchecked_Convert_To (Acc,
-                Make_Attribute_Reference (Loc,
-                  Prefix => Sub,
-                  Attribute_Name => Name_Address))));
+              Obj_Ref, Sub_Ref));
 
       Rewrite (N, Agg);
 
index 00eb5ca443ffcc59499ce6f3d07cc1fd61c14620..8cb372a255208cc96ca88dba16d11ffe41158081 100644 (file)
@@ -342,7 +342,7 @@ begin
          --  incorporate subunits at a lower level.
 
          if Operating_Mode = Generate_Code
-            and then Nkind (Unit (Cunit (Main_Unit))) = N_Subunit
+           and then Nkind (Unit (Cunit (Main_Unit))) = N_Subunit
          then
             Operating_Mode := Check_Semantics;
          end if;
@@ -355,8 +355,8 @@ begin
          --  Cleanup processing after completing main analysis
 
          if Operating_Mode = Generate_Code
-            or else (Operating_Mode = Check_Semantics
-                      and then ASIS_Mode)
+           or else (Operating_Mode = Check_Semantics
+                     and then ASIS_Mode)
          then
             Instantiate_Bodies;
          end if;
@@ -404,7 +404,8 @@ begin
    --  dispatching calls reference subprogram calls.
 
    if Generate_SCIL then
-      Check_SCIL_Nodes (Cunit (Main_Unit));
+      pragma Debug (Check_SCIL_Nodes (Cunit (Main_Unit)));
+      null;
    end if;
 
    --  Dump the source now. Note that we do this as soon as the analysis