diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-04 11:01:16 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-04 11:01:16 +0200 |
commit | b37d5bc62b96ecbd96f409281f8741d40c4d3922 (patch) | |
tree | 717756996cfd0e8c8f8167063ffe7fe6077616ee /gcc/ada/exp_ch7.adb | |
parent | 7ab4d95af734d904c16bf4af815e8810546feff6 (diff) | |
download | gcc-b37d5bc62b96ecbd96f409281f8741d40c4d3922.zip gcc-b37d5bc62b96ecbd96f409281f8741d40c4d3922.tar.gz gcc-b37d5bc62b96ecbd96f409281f8741d40c4d3922.tar.bz2 |
[multiple changes]
2011-08-04 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch7.adb (Create_Finalizer): Remove local variables Spec_Nod and
Vis_Decls. When creating a library-level finalizer for a package spec,
both the declaration and body of the finalizer are inserted either in
the visible or private declarations of the package spec.
2011-08-04 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Derive_Subprograms): Complete assertion to request the
use of the full-view of a type when invoking Is_Ancestor.
* sem_type.adb (Is_Ancestor): For consistency, when the traversal of
the full-view of private parents is requested, then use also the
full-view of the parent of the first derivation.
From-SVN: r177338
Diffstat (limited to 'gcc/ada/exp_ch7.adb')
-rw-r--r-- | gcc/ada/exp_ch7.adb | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index abe960b3..f79520e 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -1562,38 +1562,23 @@ package body Exp_Ch7 is -- If the package spec has private declarations, the finalizer -- body must be added to the end of the list in order to have - -- visibility of all private controlled objects. The spec is - -- inserted at the top of the visible declarations. + -- visibility of all private controlled objects. if For_Package_Spec then - Prepend_To (Decls, Fin_Spec); - if Present (Priv_Decls) then + Append_To (Priv_Decls, Fin_Spec); Append_To (Priv_Decls, Fin_Body); else + Append_To (Decls, Fin_Spec); Append_To (Decls, Fin_Body); end if; - -- For package bodies, the finalizer body is added to the - -- declarative region of the body and finalizer spec goes - -- on the visible declarations of the package spec. + -- For package bodies, both the finalizer spec and body are + -- inserted at the end of the package declarations. else - declare - Spec_Nod : Node_Id; - Vis_Decls : List_Id; - - begin - Spec_Nod := Spec_Id; - while Nkind (Spec_Nod) /= N_Package_Specification loop - Spec_Nod := Parent (Spec_Nod); - end loop; - - Vis_Decls := Visible_Declarations (Spec_Nod); - - Prepend_To (Vis_Decls, Fin_Spec); - Append_To (Decls, Fin_Body); - end; + Append_To (Decls, Fin_Spec); + Append_To (Decls, Fin_Body); end if; -- Push the name of the package |