diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-12 14:55:34 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-12 14:55:34 +0200 |
commit | 0c68c6135fcd6bf0b97fc801b1d0ddc606275651 (patch) | |
tree | a949f38b2e84ab28cb4d13c39188a8bc58d562e9 /gcc/ada/sem_ch13.adb | |
parent | fd8b40539cd4af7c08207dfdf61a98aea6deeab9 (diff) | |
download | gcc-0c68c6135fcd6bf0b97fc801b1d0ddc606275651.zip gcc-0c68c6135fcd6bf0b97fc801b1d0ddc606275651.tar.gz gcc-0c68c6135fcd6bf0b97fc801b1d0ddc606275651.tar.bz2 |
[multiple changes]
2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications):
Insert the corresponding pragma for aspect Abstract_State at
the top of the visible declarations of the related package.
Previously this was only done when the package is a compilation
unit.
2013-04-12 Arnaud Charlet <charlet@adacore.com>
* gnat_ugn.texi: Further menu clean ups.
* sem_prag.adb, opt.ads: Minor reformatting.
* sem_util.ads: Minor comment fix.
From-SVN: r197901
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r-- | gcc/ada/sem_ch13.adb | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 4c8bbc1..d06398a 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1968,12 +1968,27 @@ package body Sem_Ch13 is end if; end if; + -- Aspect Abstract_State introduces implicit declarations for all + -- state abstraction entities it defines. To emulate this behavior + -- insert the pragma at the start of the visible declarations of + -- the related package. + + if Nam = Name_Abstract_State + and then Nkind (N) = N_Package_Declaration + then + if No (Visible_Declarations (Specification (N))) then + Set_Visible_Declarations (Specification (N), New_List); + end if; + + Prepend (Aitem, Visible_Declarations (Specification (N))); + goto Continue; + -- In the context of a compilation unit, we directly put the -- pragma in the Pragmas_After list of the -- N_Compilation_Unit_Aux node (no delay is required here) -- except for aspects on a subprogram body (see below). - if Nkind (Parent (N)) = N_Compilation_Unit + elsif Nkind (Parent (N)) = N_Compilation_Unit and then (Present (Aitem) or else Is_Boolean_Aspect (Aspect)) then declare @@ -2014,20 +2029,6 @@ package body Sem_Ch13 is Prepend (Aitem, Declarations (N)); - -- Aspect Abstract_State produces implicit declarations for - -- all state abstraction entities it defines. To emulate - -- this behavior, insert the pragma at the start of the - -- visible declarations of the related package. - - elsif Nam = Name_Abstract_State - and then Nkind (N) = N_Package_Declaration - then - if No (Visible_Declarations (Specification (N))) then - Set_Visible_Declarations (Specification (N), New_List); - end if; - - Prepend (Aitem, Visible_Declarations (Specification (N))); - else if No (Pragmas_After (Aux)) then Set_Pragmas_After (Aux, New_List); |