+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>
* prj.adb, sem_util.adb, exp_ch6.adb: Minor reformatting.
Finalizer_Decls : List_Id := No_List;
-- Local variable declarations. This list holds the label declarations
-- 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;
-- Raised : Boolean := False;
-- L<counter value> : label;
-- Abort : constant Boolean := Triggered_By_Abort;
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- begin
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- end if;
-- Abort : constant Boolean := Triggered_By_Abort;
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
--
-- begin
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- end if;
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- . . .
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- <<L0>>
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- begin
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- begin
end if;
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;
-- Statements, declarations, pragmas, representation clauses
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);
else
with Errout; use Errout;
with Expander; use Expander;
with Exp_Ch6; use Exp_Ch6;
+with Exp_Ch7; use Exp_Ch7;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Ghost; use Ghost;
Name =>
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));
Rewrite (Name (N), New_Occurrence_Of (Id, Loc));
Set_Etype (Id, Typ);
return Id;
end Get_Function_Id;
- ---------------------------
- -- Preanalyze_Expression --
- ---------------------------
+ -------------------------------
+ -- Preanalyze_Without_Errors --
+ -------------------------------
procedure Preanalyze_Without_Errors (N : Node_Id) is
Status : constant Boolean := Get_Ignore_Errors;