Commit 236f1042 by Arnaud Charlet

[multiple changes]

2012-10-05  Robert Dewar  <dewar@adacore.com>

	* sem_ch7.adb: Minor reformatting.

2012-10-05  Ed Schonberg  <schonberg@adacore.com>

	* sem_prag.adb (Analyze_Pragma, case Persistent_BSS): check for
	a duplicate pragma before Rep_Item_Too_Late to prevent spurious
	messages about duplicate pragmas.

2012-10-05  Ed Schonberg  <schonberg@adacore.com>

	* exp_util.adb (Find_Init_Call): If the successor of the
	object declaration is a block, check whether it contains the
	initialization call, because it may have been created by actuals
	that use the secondary stack.

From-SVN: r192130
parent 95081e99
2012-10-05 Robert Dewar <dewar@adacore.com>
* sem_ch7.adb: Minor reformatting.
2012-10-05 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Persistent_BSS): check for
a duplicate pragma before Rep_Item_Too_Late to prevent spurious
messages about duplicate pragmas.
2012-10-05 Ed Schonberg <schonberg@adacore.com>
* exp_util.adb (Find_Init_Call): If the successor of the
object declaration is a block, check whether it contains the
initialization call, because it may have been created by actuals
that use the secondary stack.
2012-10-05 Thomas Quinot <quinot@adacore.com>
* sem_dim.adb, errout.adb, errout.ads (Analyze_Dimension_Call): Add
......
......@@ -2166,6 +2166,7 @@ package body Exp_Util is
(Var : Entity_Id;
Rep_Clause : Node_Id) return Node_Id
is
Par : constant Node_Id := Parent (Var);
Typ : constant Entity_Id := Etype (Var);
Init_Proc : Entity_Id;
......@@ -2204,6 +2205,7 @@ package body Exp_Util is
begin
if not Has_Non_Null_Base_Init_Proc (Typ) then
-- No init proc for the type, so obviously no call to be found
return Empty;
......@@ -2213,7 +2215,7 @@ package body Exp_Util is
-- First scan the list containing the declaration of Var
Init_Call := Find_Init_Call_In_List (From => Next (Parent (Var)));
Init_Call := Find_Init_Call_In_List (From => Next (Par));
-- If not found, also look on Var's freeze actions list, if any, since
-- the init call may have been moved there (case of an address clause
......@@ -2224,6 +2226,23 @@ package body Exp_Util is
Find_Init_Call_In_List (First (Actions (Freeze_Node (Var))));
end if;
-- If the initialization call has actuals that use the secondary stack,
-- the call may have been wrapped into a temporary block, in which case
-- the block itself has to be removed.
if No (Init_Call) and then Nkind (Next (Par)) = N_Block_Statement then
declare
Blk : constant Node_Id := Next (Par);
begin
if Present
(Find_Init_Call_In_List
(First (Statements (Handled_Statement_Sequence (Blk)))))
then
Init_Call := Blk;
end if;
end;
end if;
return Init_Call;
end Find_Init_Call;
......
......@@ -1390,11 +1390,13 @@ package body Sem_Ch7 is
then
declare
ASN : Node_Id;
begin
ASN := First (Aspect_Specifications (Parent (E)));
while Present (ASN) loop
if Chars (Identifier (ASN)) = Name_Invariant
or else Chars (Identifier (ASN)) = Name_Type_Invariant
or else
Chars (Identifier (ASN)) = Name_Type_Invariant
then
Build_Invariant_Procedure (E, N);
exit;
......
......@@ -12130,6 +12130,11 @@ package body Sem_Prag is
Ent := Entity (Get_Pragma_Arg (Arg1));
Decl := Parent (Ent);
-- Check for duplication before inserting in list of
-- representation items.
Check_Duplicate_Pragma (Ent);
if Rep_Item_Too_Late (Ent, N) then
return;
end if;
......@@ -12145,8 +12150,6 @@ package body Sem_Prag is
Arg1);
end if;
Check_Duplicate_Pragma (Ent);
Prag :=
Make_Linker_Section_Pragma
(Ent, Sloc (N), ".persistent.bss");
......
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