diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-01 11:25:46 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-01 11:25:46 +0200 |
commit | 6bb8853384b56d015a5366da8a7572d50ad3bfc7 (patch) | |
tree | 4ad614e2c8327baf70062e1362be345789d1a42d /gcc/ada/aspects.ads | |
parent | 060a3f289f9c442174aea0599b5d609433f00952 (diff) | |
download | gcc-6bb8853384b56d015a5366da8a7572d50ad3bfc7.tar.gz |
[multiple changes]
2011-08-01 Robert Dewar <dewar@adacore.com>
* aspects.ads (Boolean_Aspects): New subtype.
* exp_ch13.adb (Expand_Freeze_Entity): Fix errors in handling aspects
for derived types in cases where the parent type and derived type have
aspects.
* freeze.adb (Freeze_Entity): Fix problems in handling derived type
with aspects when parent type also has aspects.
(Freeze_Entity): Deal with delay of boolean aspects (must evaluate
boolean expression at this point).
* sem_ch13.adb (Analyze_Aspect_Specifications): Delay all aspects in
accordance with final decision on the Ada 2012 feature.
* sinfo.ads, sinfo.adb (Is_Boolean_Aspect): New flag.
2011-08-01 Matthew Heaney <heaney@adacore.com>
* a-chtgbo.adb (Delete_Node_Sans_Free): Replace iterator with selector.
From-SVN: r177005
Diffstat (limited to 'gcc/ada/aspects.ads')
-rwxr-xr-x | gcc/ada/aspects.ads | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 9f44197dd42..6dabef3dfcc 100755 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -43,51 +43,56 @@ package Aspects is type Aspect_Id is (No_Aspect, -- Dummy entry for no aspect - Aspect_Ada_2005, -- GNAT - Aspect_Ada_2012, -- GNAT Aspect_Address, Aspect_Alignment, - Aspect_Atomic, - Aspect_Atomic_Components, Aspect_Bit_Order, Aspect_Component_Size, - Aspect_Discard_Names, Aspect_External_Tag, - Aspect_Favor_Top_Level, -- GNAT - Aspect_Inline, - Aspect_Inline_Always, -- GNAT Aspect_Input, Aspect_Invariant, Aspect_Machine_Radix, - Aspect_No_Return, Aspect_Object_Size, -- GNAT Aspect_Output, - Aspect_Pack, - Aspect_Persistent_BSS, -- GNAT Aspect_Post, Aspect_Pre, - Aspect_Predicate, -- GNAT??? - Aspect_Preelaborable_Initialization, - Aspect_Pure_Function, -- GNAT + Aspect_Predicate, Aspect_Read, - Aspect_Shared, -- GNAT (equivalent to Atomic) Aspect_Size, Aspect_Storage_Pool, Aspect_Storage_Size, Aspect_Stream_Size, Aspect_Suppress, + Aspect_Unsuppress, + Aspect_Value_Size, -- GNAT + Aspect_Warnings, + Aspect_Write, + + -- Remaining aspects have a static boolean value that turns the aspect + -- on or off. They all correspond to pragmas, and the flag Aspect_Cancel + -- is set on the pragma if the corresponding aspect is False. + + Aspect_Ada_2005, -- GNAT + Aspect_Ada_2012, -- GNAT + Aspect_Atomic, + Aspect_Atomic_Components, + Aspect_Discard_Names, + Aspect_Favor_Top_Level, -- GNAT + Aspect_Inline, + Aspect_Inline_Always, -- GNAT + Aspect_No_Return, + Aspect_Pack, + Aspect_Persistent_BSS, -- GNAT + Aspect_Preelaborable_Initialization, + Aspect_Pure_Function, -- GNAT + Aspect_Shared, -- GNAT (equivalent to Atomic) Aspect_Suppress_Debug_Info, -- GNAT Aspect_Unchecked_Union, Aspect_Universal_Aliasing, -- GNAT Aspect_Unmodified, -- GNAT Aspect_Unreferenced, -- GNAT Aspect_Unreferenced_Objects, -- GNAT - Aspect_Unsuppress, - Aspect_Value_Size, -- GNAT Aspect_Volatile, - Aspect_Volatile_Components, - Aspect_Warnings, - Aspect_Write); -- GNAT + Aspect_Volatile_Components); -- The following array indicates aspects that accept 'Class @@ -98,6 +103,16 @@ package Aspects is Aspect_Post => True, others => False); + -- The following subtype defines aspects accepting an optional static + -- boolean parameter indicating if the aspect should be active or + -- cancelling. If the parameter is missing the effective value is True, + -- enabling the aspect. If the parameter is present it must be a static + -- expression of type Standard.Boolean. If the value is True, then the + -- aspect is enabled. If it is False, the aspect is disabled. + + subtype Boolean_Aspects is + Aspect_Id range Aspect_Ada_2005 .. Aspect_Id'Last; + -- The following type is used for indicating allowed expression forms type Aspect_Expression is @@ -109,51 +124,30 @@ package Aspects is Aspect_Argument : constant array (Aspect_Id) of Aspect_Expression := (No_Aspect => Optional, - Aspect_Ada_2005 => Optional, - Aspect_Ada_2012 => Optional, Aspect_Address => Expression, Aspect_Alignment => Expression, - Aspect_Atomic => Optional, - Aspect_Atomic_Components => Optional, Aspect_Bit_Order => Expression, Aspect_Component_Size => Expression, - Aspect_Discard_Names => Optional, Aspect_External_Tag => Expression, - Aspect_Favor_Top_Level => Optional, - Aspect_Inline => Optional, - Aspect_Inline_Always => Optional, Aspect_Input => Name, Aspect_Invariant => Expression, Aspect_Machine_Radix => Expression, - Aspect_No_Return => Optional, Aspect_Object_Size => Expression, Aspect_Output => Name, - Aspect_Persistent_BSS => Optional, - Aspect_Pack => Optional, Aspect_Post => Expression, Aspect_Pre => Expression, Aspect_Predicate => Expression, - Aspect_Preelaborable_Initialization => Optional, - Aspect_Pure_Function => Optional, Aspect_Read => Name, - Aspect_Shared => Optional, Aspect_Size => Expression, Aspect_Storage_Pool => Name, Aspect_Storage_Size => Expression, Aspect_Stream_Size => Expression, Aspect_Suppress => Name, - Aspect_Suppress_Debug_Info => Optional, - Aspect_Unchecked_Union => Optional, - Aspect_Universal_Aliasing => Optional, - Aspect_Unmodified => Optional, - Aspect_Unreferenced => Optional, - Aspect_Unreferenced_Objects => Optional, Aspect_Unsuppress => Name, Aspect_Value_Size => Expression, - Aspect_Volatile => Optional, - Aspect_Volatile_Components => Optional, Aspect_Warnings => Name, - Aspect_Write => Name); + Aspect_Write => Name, + Boolean_Aspects => Optional); function Get_Aspect_Id (Name : Name_Id) return Aspect_Id; pragma Inline (Get_Aspect_Id); |