bindgen.adb (Gen_Output_File_Ada): Do not emit declaration for Is_Elaborated if not...
authorTristan Gingold <gingold@adacore.com>
Mon, 29 Oct 2012 10:52:28 +0000 (10:52 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 29 Oct 2012 10:52:28 +0000 (11:52 +0100)
2012-10-29  Tristan Gingold  <gingold@adacore.com>

* bindgen.adb (Gen_Output_File_Ada): Do not emit declaration for
Is_Elaborated if not referenced.

2012-10-29  Tristan Gingold  <gingold@adacore.com>

* exp_ch9.adb (Build_Activation_Chain_Entity): Punt in restricted
profile.
* exp_ch3.adb (Build_Initialization_Call): Do no append _Chain
parameter in restricted profile.
(Build_Init_Call_Thru): Likewise.
(Init_Formals): Likewise.
* exp_ch3.adb: Minor reformatting.

From-SVN: r192925

gcc/ada/ChangeLog
gcc/ada/bindgen.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch9.adb

index d408c9557e1c1ce56028aaa75d9e213183878355..7bc26c6a8a1127760e06f6d217ba7771d99d081c 100644 (file)
@@ -1,3 +1,18 @@
+2012-10-29  Tristan Gingold  <gingold@adacore.com>
+
+       * bindgen.adb (Gen_Output_File_Ada): Do not emit declaration for
+       Is_Elaborated if not referenced.
+
+2012-10-29  Tristan Gingold  <gingold@adacore.com>
+
+       * exp_ch9.adb (Build_Activation_Chain_Entity): Punt in restricted
+       profile.
+       * exp_ch3.adb (Build_Initialization_Call): Do no append _Chain
+       parameter in restricted profile.
+       (Build_Init_Call_Thru): Likewise.
+       (Init_Formals): Likewise.
+       * exp_ch3.adb: Minor reformatting.
+
 2012-10-29  Arnaud Charlet  <charlet@adacore.com>
 
        * usage.adb: Update usage line for -gnatw.k.
index f29e2dad302ef1c68bac2d6abcb85848be557c81..e178a57a21b9fd50d184e0c01e13d8607959f3fe 100644 (file)
@@ -2394,8 +2394,13 @@ package body Bindgen is
 
          --  The B.1 (39) implementation advice says that the adainit/adafinal
          --  routines should be idempotent. Generate a flag to ensure that.
+         --  This is not needed if we are suppressing the standard library
+         --  since it would never be referenced.
+
+         if not Suppress_Standard_Library_On_Target then
+            WBI ("   Is_Elaborated : Boolean := False;");
+         end if;
 
-         WBI ("   Is_Elaborated : Boolean := False;");
          WBI ("");
       end if;
 
index af5dadd9abc68bf98432dd10af59950ee4e10c15..9911d213bf2351bf5bad14a7f5185a63dce07a03 100644 (file)
@@ -1537,7 +1537,12 @@ package body Exp_Ch3 is
             Append_To (Args, Make_Identifier (Loc, Name_uMaster));
          end if;
 
-         Append_To (Args, Make_Identifier (Loc, Name_uChain));
+         if not Restricted_Profile then
+
+            --  No _Chain for restricted profile
+
+            Append_To (Args, Make_Identifier (Loc, Name_uChain));
+         end if;
 
          --  Ada 2005 (AI-287): In case of default initialized components
          --  with tasks, we generate a null string actual parameter.
@@ -1987,7 +1992,13 @@ package body Exp_Ch3 is
                Append_To (Args, Make_Identifier (Loc, Name_uMaster));
             end if;
 
-            Append_To (Args, Make_Identifier (Loc, Name_uChain));
+            if not Restricted_Profile then
+
+               --  No _Chain for restricted profile
+
+               Append_To (Args, Make_Identifier (Loc, Name_uChain));
+            end if;
+
             Append_To (Args, Make_Identifier (Loc, Name_uTask_Name));
             First_Discr_Param := Next (Next (Next (First_Discr_Param)));
          end if;
@@ -7791,24 +7802,29 @@ package body Exp_Ch3 is
            Make_Parameter_Specification (Loc,
              Defining_Identifier =>
                Make_Defining_Identifier (Loc, Name_uMaster),
-             Parameter_Type => New_Reference_To (RTE (RE_Master_Id), Loc)));
+             Parameter_Type      =>
+               New_Reference_To (RTE (RE_Master_Id), Loc)));
 
-         Append_To (Formals,
-           Make_Parameter_Specification (Loc,
-             Defining_Identifier =>
-               Make_Defining_Identifier (Loc, Name_uChain),
-             In_Present => True,
-             Out_Present => True,
-             Parameter_Type =>
-               New_Reference_To (RTE (RE_Activation_Chain), Loc)));
+         if not Restricted_Profile then
+
+            --  No _Chain for restricted profile
+
+            Append_To (Formals,
+              Make_Parameter_Specification (Loc,
+                Defining_Identifier =>
+                  Make_Defining_Identifier (Loc, Name_uChain),
+                In_Present          => True,
+                Out_Present         => True,
+                Parameter_Type      =>
+                  New_Reference_To (RTE (RE_Activation_Chain), Loc)));
+         end if;
 
          Append_To (Formals,
            Make_Parameter_Specification (Loc,
              Defining_Identifier =>
                Make_Defining_Identifier (Loc, Name_uTask_Name),
-             In_Present => True,
-             Parameter_Type =>
-               New_Reference_To (Standard_String, Loc)));
+             In_Present          => True,
+             Parameter_Type      => New_Reference_To (Standard_String, Loc)));
       end if;
 
       return Formals;
@@ -7907,7 +7923,7 @@ package body Exp_Ch3 is
                           (RTE (RE_Set_Dynamic_Offset_To_Top), Loc),
                 Parameter_Associations => New_List (
                   Make_Attribute_Reference (Loc,
-                    Prefix => New_Copy_Tree (Target),
+                    Prefix         => New_Copy_Tree (Target),
                     Attribute_Name => Name_Address),
 
                   Unchecked_Convert_To (RTE (RE_Tag),
@@ -7920,7 +7936,7 @@ package body Exp_Ch3 is
                      Make_Attribute_Reference (Loc,
                        Prefix         =>
                          Make_Selected_Component (Loc,
-                           Prefix => New_Copy_Tree (Target),
+                           Prefix        => New_Copy_Tree (Target),
                            Selector_Name =>
                              New_Reference_To (Tag_Comp, Loc)),
                        Attribute_Name => Name_Position)),
@@ -7946,18 +7962,17 @@ package body Exp_Ch3 is
                                        (Offset_To_Top_Comp, Loc)),
                 Expression =>
                   Make_Attribute_Reference (Loc,
-                    Prefix         =>
+                    Prefix       =>
                       Make_Selected_Component (Loc,
-                        Prefix => New_Copy_Tree (Target),
-                        Selector_Name =>
-                          New_Reference_To (Tag_Comp, Loc)),
+                        Prefix        => New_Copy_Tree (Target),
+                        Selector_Name => New_Reference_To (Tag_Comp, Loc)),
                   Attribute_Name => Name_Position)));
 
          --  Normal case: No discriminants in the parent type
 
          else
-            --  Don't need to set any value if this interface shares
-            --  the primary dispatch table.
+            --  Don't need to set any value if this interface shares the
+            --  primary dispatch table.
 
             if not Is_Ancestor (Iface, Typ, Use_Full_View => True) then
                Append_To (Stmts_List,
index 6e370f4d8717d38ccf00ff5ff62e1eed051335f7..b39484fc1ef12ee96d1c115e345a5f67d4e777e6 100644 (file)
@@ -911,6 +911,12 @@ package body Exp_Ch9 is
    --  Start of processing for Build_Activation_Chain_Entity
 
    begin
+      --  Activation chain is never used in restricted profile
+
+      if Restricted_Profile then
+         return;
+      end if;
+
       Find_Enclosing_Context (N, Context, Context_Id, Decls);
 
       --  If an activation chain entity has not been declared already, create