+2014-10-10 Gary Dismukes <dismukes@adacore.com>
+
+ * sinfo.ads, gnat_ugn.texi, a-except.adb, a-except-2005.adb,
+ raise-gcc.c Spelling changes (prolog => prologue, epilog => epilogue).
+
+2014-10-10 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch5.adb (Is_Wrapped_In_Block): Handle properly blocks that
+ contain pragmas generated for loop invariants and type predicates.
+ Clarify use of this subprogram.
+
2014-10-10 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Analyze_Global_Item): Accept formal objects in Global
-- None of these procedures ever returns (they raise an exception). By
-- using pragma No_Return, we ensure that any junk code after the call,
- -- such as normal return epilog stuff, can be eliminated).
+ -- such as normal return epilogue stuff, can be eliminated).
pragma No_Return (Rcheck_CE_Access_Check);
pragma No_Return (Rcheck_CE_Null_Access_Parameter);
-- None of these procedures ever returns (they raise an exception). By
-- using pragma No_Return, we ensure that any junk code after the call,
- -- such as normal return epilog stuff, can be eliminated).
+ -- such as normal return epilogue stuff, can be eliminated).
pragma No_Return (Rcheck_CE_Access_Check);
pragma No_Return (Rcheck_CE_Null_Access_Parameter);
-- None of these procedures ever returns (they raise an exception). By
-- using pragma No_Return, we ensure that any junk code after the call,
- -- such as normal return epilog stuff, can be eliminated).
+ -- such as normal return epilogue stuff, can be eliminated).
pragma No_Return (Rcheck_00);
pragma No_Return (Rcheck_01);
location will advance to the next statement as usual. A special case
arises in the case of a @code{return} statement.
-Part of the code for a return statement is the ``epilog'' of the function.
+Part of the code for a return statement is the ``epilogue'' of the function.
This is the code that returns to the caller. There is only one copy of
-this epilog code, and it is typically associated with the last return
+this epilogue code, and it is typically associated with the last return
statement in the function if there is more than one return. In some
-implementations, this epilog is associated with the first statement
+implementations, this epilogue is associated with the first statement
of the function.
The result is that if you use the @code{next} command from a return
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2014, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
{
unsigned int len;
- /* Version = 1, no flags, no prolog. */
+ /* Version = 1, no flags, no prologue. */
if (unw[0] != 1 || unw[1] != 0)
return;
len = unw[2];
unw += 4;
while (len > 0)
{
- /* Offset in prolog = 0. */
+ /* Offset in prologue = 0. */
if (unw[0] != 0)
return;
switch (unw[1] & 0xf)
-- container iteration.
function Is_Wrapped_In_Block (N : Node_Id) return Boolean;
- -- Determine whether node N is the sole statement of a block
+ -- Determine whether loop statement N has been wrapped in a block to
+ -- capture finalization actions that may be generated for container
+ -- iterators. Prevents infinite recursion when block is analyzed.
+ -- Routine is a noop if loop is single statement within source block.
---------------------------
-- Is_Container_Iterator --
-------------------------
function Is_Wrapped_In_Block (N : Node_Id) return Boolean is
- HSS : constant Node_Id := Parent (N);
+ HSS : Node_Id;
+ Stat : Node_Id;
begin
- return
- Nkind (HSS) = N_Handled_Sequence_Of_Statements
- and then Nkind (Parent (HSS)) = N_Block_Statement
- and then First (Statements (HSS)) = N
- and then No (Next (First (Statements (HSS))));
+ if Ekind (Current_Scope) /= E_Block then
+ return False;
+
+ else
+ HSS :=
+ Handled_Statement_Sequence (Parent (Block_Node (Current_Scope)));
+
+ -- Skip leading pragmas that may be introduced for invariant and
+ -- predicate checks.
+
+ Stat := First (Statements (HSS));
+ while Present (Stat) and then Nkind (Stat) = N_Pragma loop
+ Stat := Next (Stat);
+ end loop;
+
+ return Stat = N and then No (Next (Stat));
+ end if;
end Is_Wrapped_In_Block;
-- Local declarations
-- Do_Storage_Check (Flag17-Sem)
-- This flag is set in an N_Allocator node to indicate that a storage
-- check is required for the allocation, or in an N_Subprogram_Body node
- -- to indicate that a stack check is required in the subprogram prolog.
+ -- to indicate that a stack check is required in the subprogram prologue.
-- The N_Allocator case is handled by the routine that expands the call
-- to the runtime routine. The N_Subprogram_Body case is handled by the
-- backend, and all the semantics does is set the flag.