Commit c18e9f65 by Tristan Gingold Committed by Arnaud Charlet

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

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
parent c607e6d5
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> 2012-10-29 Arnaud Charlet <charlet@adacore.com>
* usage.adb: Update usage line for -gnatw.k. * usage.adb: Update usage line for -gnatw.k.
......
...@@ -2394,8 +2394,13 @@ package body Bindgen is ...@@ -2394,8 +2394,13 @@ package body Bindgen is
-- The B.1 (39) implementation advice says that the adainit/adafinal -- The B.1 (39) implementation advice says that the adainit/adafinal
-- routines should be idempotent. Generate a flag to ensure that. -- 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;"); WBI (" Is_Elaborated : Boolean := False;");
end if;
WBI (""); WBI ("");
end if; end if;
......
...@@ -1537,7 +1537,12 @@ package body Exp_Ch3 is ...@@ -1537,7 +1537,12 @@ package body Exp_Ch3 is
Append_To (Args, Make_Identifier (Loc, Name_uMaster)); Append_To (Args, Make_Identifier (Loc, Name_uMaster));
end if; end if;
if not Restricted_Profile then
-- No _Chain for restricted profile
Append_To (Args, Make_Identifier (Loc, Name_uChain)); Append_To (Args, Make_Identifier (Loc, Name_uChain));
end if;
-- Ada 2005 (AI-287): In case of default initialized components -- Ada 2005 (AI-287): In case of default initialized components
-- with tasks, we generate a null string actual parameter. -- with tasks, we generate a null string actual parameter.
...@@ -1987,7 +1992,13 @@ package body Exp_Ch3 is ...@@ -1987,7 +1992,13 @@ package body Exp_Ch3 is
Append_To (Args, Make_Identifier (Loc, Name_uMaster)); Append_To (Args, Make_Identifier (Loc, Name_uMaster));
end if; end if;
if not Restricted_Profile then
-- No _Chain for restricted profile
Append_To (Args, Make_Identifier (Loc, Name_uChain)); Append_To (Args, Make_Identifier (Loc, Name_uChain));
end if;
Append_To (Args, Make_Identifier (Loc, Name_uTask_Name)); Append_To (Args, Make_Identifier (Loc, Name_uTask_Name));
First_Discr_Param := Next (Next (Next (First_Discr_Param))); First_Discr_Param := Next (Next (Next (First_Discr_Param)));
end if; end if;
...@@ -7791,7 +7802,12 @@ package body Exp_Ch3 is ...@@ -7791,7 +7802,12 @@ package body Exp_Ch3 is
Make_Parameter_Specification (Loc, Make_Parameter_Specification (Loc,
Defining_Identifier => Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uMaster), 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)));
if not Restricted_Profile then
-- No _Chain for restricted profile
Append_To (Formals, Append_To (Formals,
Make_Parameter_Specification (Loc, Make_Parameter_Specification (Loc,
...@@ -7801,14 +7817,14 @@ package body Exp_Ch3 is ...@@ -7801,14 +7817,14 @@ package body Exp_Ch3 is
Out_Present => True, Out_Present => True,
Parameter_Type => Parameter_Type =>
New_Reference_To (RTE (RE_Activation_Chain), Loc))); New_Reference_To (RTE (RE_Activation_Chain), Loc)));
end if;
Append_To (Formals, Append_To (Formals,
Make_Parameter_Specification (Loc, Make_Parameter_Specification (Loc,
Defining_Identifier => Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uTask_Name), Make_Defining_Identifier (Loc, Name_uTask_Name),
In_Present => True, In_Present => True,
Parameter_Type => Parameter_Type => New_Reference_To (Standard_String, Loc)));
New_Reference_To (Standard_String, Loc)));
end if; end if;
return Formals; return Formals;
...@@ -7949,15 +7965,14 @@ package body Exp_Ch3 is ...@@ -7949,15 +7965,14 @@ package body Exp_Ch3 is
Prefix => Prefix =>
Make_Selected_Component (Loc, Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target), Prefix => New_Copy_Tree (Target),
Selector_Name => Selector_Name => New_Reference_To (Tag_Comp, Loc)),
New_Reference_To (Tag_Comp, Loc)),
Attribute_Name => Name_Position))); Attribute_Name => Name_Position)));
-- Normal case: No discriminants in the parent type -- Normal case: No discriminants in the parent type
else else
-- Don't need to set any value if this interface shares -- Don't need to set any value if this interface shares the
-- the primary dispatch table. -- primary dispatch table.
if not Is_Ancestor (Iface, Typ, Use_Full_View => True) then if not Is_Ancestor (Iface, Typ, Use_Full_View => True) then
Append_To (Stmts_List, Append_To (Stmts_List,
......
...@@ -911,6 +911,12 @@ package body Exp_Ch9 is ...@@ -911,6 +911,12 @@ package body Exp_Ch9 is
-- Start of processing for Build_Activation_Chain_Entity -- Start of processing for Build_Activation_Chain_Entity
begin begin
-- Activation chain is never used in restricted profile
if Restricted_Profile then
return;
end if;
Find_Enclosing_Context (N, Context, Context_Id, Decls); Find_Enclosing_Context (N, Context, Context_Id, Decls);
-- If an activation chain entity has not been declared already, create -- If an activation chain entity has not been declared already, create
......
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