diff options
Diffstat (limited to 'gcc/ada/exp_ch11.adb')
| -rw-r--r-- | gcc/ada/exp_ch11.adb | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb index ee6010a7..7192178 100644 --- a/gcc/ada/exp_ch11.adb +++ b/gcc/ada/exp_ch11.adb @@ -1031,7 +1031,7 @@ package body Exp_Ch11 is -- "hoisted" (i.e., Is_Statically_Allocated and not Is_Library_Level) -- entity must also be either Library_Level or hoisted. It turns out -- that this would be incompatible with the current treatment of an - -- object which is local to a subprogram, subject to an Export pragma, + -- object that is local to a subprogram, subject to an Export pragma, -- not subject to an address clause, and whose declaration contains -- references to other local (non-hoisted) objects (e.g., in the initial -- value expression). @@ -1279,27 +1279,17 @@ package body Exp_Ch11 is -- Add cleanup actions if required. No cleanup actions are needed in -- thunks associated with interfaces, because they only displace the - -- pointer to the object. For extended return statements, we need - -- cleanup actions if the Handled_Statement_Sequence contains generated - -- objects of controlled types, for example. We do not want to clean up - -- the return object. - - if Nkind (Parent (N)) not in N_Accept_Statement - | N_Extended_Return_Statement - | N_Package_Body - and then not Delay_Cleanups (Current_Scope) - and then not Is_Thunk (Current_Scope) - then - Expand_Cleanup_Actions (Parent (N)); + -- pointer to the object. - elsif Nkind (Parent (N)) = N_Extended_Return_Statement - and then Handled_Statement_Sequence (Parent (N)) = N + if Nkind (Parent (N)) not in N_Accept_Statement | N_Package_Body and then not Delay_Cleanups (Current_Scope) + and then not Is_Thunk (Current_Scope) then - pragma Assert (not Is_Thunk (Current_Scope)); Expand_Cleanup_Actions (Parent (N)); end if; + -- Protect the Finally_Statements with abort defer/undefer + if Present (Finally_Statements (N)) and then Abort_Allowed then if Exceptions_OK then Set_Finally_Statements @@ -1558,7 +1548,7 @@ package body Exp_Ch11 is Build_Location_String (Buf, Loc); -- If the exception is a renaming, use the exception that it - -- renames (which might be a predefined exception, e.g.). + -- renames (which might be a predefined exception). if Present (Renamed_Entity (Id)) then Id := Renamed_Entity (Id); |
