Commit 7f37fff1 by Arnaud Charlet

[multiple changes]

2015-10-16  Javier Miranda  <miranda@adacore.com>

	* sem_ch5.adb (Analyze_Iterator_Specification): Associate a
	transient scope with the renaming object declararation.
	* exp_util.adb (Insert_Actions): if the enclosing interator
	loop is marked as requiring the secondary stack then attach the
	actions to the transient scope.

2015-10-16  Bob Duff  <duff@adacore.com>

	* exp_ch7.adb: Minor spelling fixes.

2015-10-16  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Replace_Anonymous_Access_To_Protected_Subprogram):
	If anonymous type is component type of array type declaration,
	analyze its declaration in the current scope, not the enclosing
	one.

From-SVN: r228906
parent 16e49553
2015-10-16 Javier Miranda <miranda@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): Associate a
transient scope with the renaming object declararation.
* exp_util.adb (Insert_Actions): if the enclosing interator
loop is marked as requiring the secondary stack then attach the
actions to the transient scope.
2015-10-16 Bob Duff <duff@adacore.com>
* exp_ch7.adb: Minor spelling fixes.
2015-10-16 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Replace_Anonymous_Access_To_Protected_Subprogram):
If anonymous type is component type of array type declaration,
analyze its declaration in the current scope, not the enclosing
one.
2015-10-16 Gary Dismukes <dismukes@adacore.com> 2015-10-16 Gary Dismukes <dismukes@adacore.com>
* prj.adb, sem_util.adb, exp_ch6.adb: Minor reformatting. * prj.adb, sem_util.adb, exp_ch6.adb: Minor reformatting.
......
...@@ -1109,7 +1109,7 @@ package body Exp_Ch7 is ...@@ -1109,7 +1109,7 @@ package body Exp_Ch7 is
Finalizer_Decls : List_Id := No_List; Finalizer_Decls : List_Id := No_List;
-- Local variable declarations. This list holds the label declarations -- Local variable declarations. This list holds the label declarations
-- of all jump block alternatives as well as the declaration of the -- of all jump block alternatives as well as the declaration of the
-- local exception occurence and the raised flag: -- local exception occurrence and the raised flag:
-- E : Exception_Occurrence; -- E : Exception_Occurrence;
-- Raised : Boolean := False; -- Raised : Boolean := False;
-- L<counter value> : label; -- L<counter value> : label;
...@@ -5283,7 +5283,7 @@ package body Exp_Ch7 is ...@@ -5283,7 +5283,7 @@ package body Exp_Ch7 is
-- Abort : constant Boolean := Triggered_By_Abort; -- Abort : constant Boolean := Triggered_By_Abort;
-- <or> -- <or>
-- Abort : constant Boolean := False; -- no abort -- Abort : constant Boolean := False; -- no abort
-- E : Exception_Occurence; -- E : Exception_Occurrence;
-- Raised : Boolean := False; -- Raised : Boolean := False;
-- begin -- begin
...@@ -6047,7 +6047,7 @@ package body Exp_Ch7 is ...@@ -6047,7 +6047,7 @@ package body Exp_Ch7 is
-- when others => -- when others =>
-- if not Raised then -- if not Raised then
-- Raised := True; -- Raised := True;
-- Save_Occurence (E, Get_Current_Excep.all.all); -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if; -- end if;
-- end; -- end;
-- end if; -- end if;
...@@ -6065,7 +6065,7 @@ package body Exp_Ch7 is ...@@ -6065,7 +6065,7 @@ package body Exp_Ch7 is
-- Abort : constant Boolean := Triggered_By_Abort; -- Abort : constant Boolean := Triggered_By_Abort;
-- <or> -- <or>
-- Abort : constant Boolean := False; -- no abort -- Abort : constant Boolean := False; -- no abort
-- E : Exception_Occurence; -- E : Exception_Occurrence;
-- Raised : Boolean := False; -- Raised : Boolean := False;
-- --
-- begin -- begin
...@@ -6076,7 +6076,7 @@ package body Exp_Ch7 is ...@@ -6076,7 +6076,7 @@ package body Exp_Ch7 is
-- when others => -- when others =>
-- if not Raised then -- if not Raised then
-- Raised := True; -- Raised := True;
-- Save_Occurence (E, Get_Current_Excep.all.all); -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if; -- end if;
-- end; -- end;
-- end if; -- end if;
...@@ -6100,7 +6100,7 @@ package body Exp_Ch7 is ...@@ -6100,7 +6100,7 @@ package body Exp_Ch7 is
-- when others => -- when others =>
-- if not Raised then -- if not Raised then
-- Raised := True; -- Raised := True;
-- Save_Occurence (E, Get_Current_Excep.all.all); -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if; -- end if;
-- end; -- end;
-- . . . -- . . .
...@@ -6111,7 +6111,7 @@ package body Exp_Ch7 is ...@@ -6111,7 +6111,7 @@ package body Exp_Ch7 is
-- when others => -- when others =>
-- if not Raised then -- if not Raised then
-- Raised := True; -- Raised := True;
-- Save_Occurence (E, Get_Current_Excep.all.all); -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if; -- end if;
-- end; -- end;
-- <<L0>> -- <<L0>>
...@@ -6533,7 +6533,7 @@ package body Exp_Ch7 is ...@@ -6533,7 +6533,7 @@ package body Exp_Ch7 is
-- <or> -- <or>
-- Abort : constant Boolean := False; -- no abort -- Abort : constant Boolean := False; -- no abort
-- E : Exception_Occurence; -- E : Exception_Occurrence;
-- Raised : Boolean := False; -- Raised : Boolean := False;
-- begin -- begin
...@@ -7105,7 +7105,7 @@ package body Exp_Ch7 is ...@@ -7105,7 +7105,7 @@ package body Exp_Ch7 is
-- <or> -- <or>
-- Abort : constant Boolean := False; -- no abort -- Abort : constant Boolean := False; -- no abort
-- E : Exception_Occurence; -- E : Exception_Occurrence;
-- Raised : Boolean := False; -- Raised : Boolean := False;
-- begin -- begin
......
...@@ -4034,6 +4034,22 @@ package body Exp_Util is ...@@ -4034,6 +4034,22 @@ package body Exp_Util is
end if; end if;
return; return;
-- Iteration scheme located in a transient scope
elsif Nkind (P) = N_Iteration_Scheme
and then Present (Wrapped_Node)
then
-- If the enclosing iterator loop is marked as requiring the
-- secondary stack then the actions must be inserted in the
-- transient scope.
if Uses_Sec_Stack
(Find_Enclosing_Iterator_Loop (Current_Scope))
then
Store_Before_Actions_In_Scope (Ins_Actions);
return;
end if;
end if; end if;
-- Statements, declarations, pragmas, representation clauses -- Statements, declarations, pragmas, representation clauses
......
...@@ -5913,7 +5913,13 @@ package body Sem_Ch3 is ...@@ -5913,7 +5913,13 @@ package body Sem_Ch3 is
Mark_Rewrite_Insertion (Comp); Mark_Rewrite_Insertion (Comp);
if Nkind_In (N, N_Object_Declaration, N_Access_Function_Definition) then if Nkind_In (N, N_Object_Declaration, N_Access_Function_Definition)
or else (Nkind (Parent (N)) = N_Full_Type_Declaration
and then not Is_Type (Current_Scope))
then
-- Declaration can be analyzed in the current scope.
Analyze (Decl); Analyze (Decl);
else else
......
...@@ -30,6 +30,7 @@ with Einfo; use Einfo; ...@@ -30,6 +30,7 @@ with Einfo; use Einfo;
with Errout; use Errout; with Errout; use Errout;
with Expander; use Expander; with Expander; use Expander;
with Exp_Ch6; use Exp_Ch6; with Exp_Ch6; use Exp_Ch6;
with Exp_Ch7; use Exp_Ch7;
with Exp_Util; use Exp_Util; with Exp_Util; use Exp_Util;
with Freeze; use Freeze; with Freeze; use Freeze;
with Ghost; use Ghost; with Ghost; use Ghost;
...@@ -1959,6 +1960,16 @@ package body Sem_Ch5 is ...@@ -1959,6 +1960,16 @@ package body Sem_Ch5 is
Name => Name =>
New_Copy_Tree (Iter_Name, New_Sloc => Loc)); New_Copy_Tree (Iter_Name, New_Sloc => Loc));
-- Create a transient scope to ensure that all the temporaries
-- generated by Remove_Side_Effects as part of processing this
-- renaming declaration (if any) are attached by Insert_Actions
-- to it. It has no effect on the generated code if no actions
-- are added to it (see Wrap_Transient_Declaration).
if Expander_Active then
Establish_Transient_Scope (Name (Decl), Sec_Stack => True);
end if;
Insert_Actions (Parent (Parent (N)), New_List (Decl)); Insert_Actions (Parent (Parent (N)), New_List (Decl));
Rewrite (Name (N), New_Occurrence_Of (Id, Loc)); Rewrite (Name (N), New_Occurrence_Of (Id, Loc));
Set_Etype (Id, Typ); Set_Etype (Id, Typ);
......
...@@ -2346,9 +2346,9 @@ package body Sem_Util is ...@@ -2346,9 +2346,9 @@ package body Sem_Util is
return Id; return Id;
end Get_Function_Id; end Get_Function_Id;
--------------------------- -------------------------------
-- Preanalyze_Expression -- -- Preanalyze_Without_Errors --
--------------------------- -------------------------------
procedure Preanalyze_Without_Errors (N : Node_Id) is procedure Preanalyze_Without_Errors (N : Node_Id) is
Status : constant Boolean := Get_Ignore_Errors; Status : constant Boolean := Get_Ignore_Errors;
......
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