diff options
author | Ed Schonberg <schonberg@adacore.com> | 2018-05-29 09:42:29 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-29 09:42:29 +0000 |
commit | 999acab61b42c6641f7be13aa6a6452587106d43 (patch) | |
tree | f2e389061fe085f420a982e82e288ca441cbcc6b /gcc | |
parent | 944e24a31a9b3b3c4494853a8e2a2d589f65519f (diff) | |
download | gcc-999acab61b42c6641f7be13aa6a6452587106d43.zip gcc-999acab61b42c6641f7be13aa6a6452587106d43.tar.gz gcc-999acab61b42c6641f7be13aa6a6452587106d43.tar.bz2 |
[Ada] Unnesting: handle statement sequences that include an At_End handler
2018-05-29 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_unst.adb (Visit_Node): Handle statement sequences that include an
At_End handler.
From-SVN: r260885
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/exp_unst.adb | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0d478b0..ec13550 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-29 Ed Schonberg <schonberg@adacore.com> + + * exp_unst.adb (Visit_Node): Handle statement sequences that include an + At_End handler. + 2018-05-29 Eric Botcazou <ebotcazou@adacore.com> * repinfo.adb (List_Entities): Also recurse into blocks without label. diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index b1383f9..38e32cb 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -676,6 +676,16 @@ package body Exp_Unst is end loop; end; + elsif Nkind (N) = N_Handled_Sequence_Of_Statements + and then Present (At_End_Proc (N)) + then + + -- An At_End_Proc means there's a call from this block + -- to that subprogram. + + Append_Unique_Call ((N, Current_Subprogram, + Entity (At_End_Proc (N)))); + -- Handle a 'Access as a (potential) call elsif Nkind (N) = N_Attribute_Reference then @@ -850,10 +860,10 @@ package body Exp_Unst is and then Chars (Enclosing_Subprogram (Ent)) /= Name_uParent and then - -- Constants, variables and exceptions are potentially + -- Constants and variables are potentially -- uplevel references to global declarations. - (Ekind_In (Ent, E_Constant, E_Exception, E_Variable) + (Ekind_In (Ent, E_Constant, E_Variable) -- Formals are interesting, but not if being used as mere -- names of parameters for name notation calls. @@ -1817,6 +1827,7 @@ package body Exp_Unst is begin if Present (STT.ARECnF) and then Nkind (CTJ.N) /= N_Attribute_Reference + and then Nkind (CTJ.N) /= N_Handled_Sequence_Of_Statements then -- CTJ.N is a call to a subprogram which may require a pointer -- to an activation record. The subprogram containing the call |