summaryrefslogtreecommitdiff
path: root/gcc/ada/aspects.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-04 09:59:56 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-04 09:59:56 +0000
commitec6f6da513b5d84baf0b97d33a3becc10097d828 (patch)
tree07e0788cedddd16403f58e25a7894f5ecbc3c505 /gcc/ada/aspects.ads
parentb0aa049b5600820450c258b3b33cb118945f041f (diff)
downloadgcc-ec6f6da513b5d84baf0b97d33a3becc10097d828.tar.gz
2014-08-04 Robert Dewar <dewar@adacore.com>
* prj-strt.adb, prj-strt.ads, sem_attr.adb: Minor reformatting. 2014-08-04 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb Add an entry in table Canonical_Aspect for Default_Initial_Condition. * aspects.ads Add an entry in tables Aspect_Id, Aspect_Argument, Aspect_Names and Aspect_Delay for Default_Initial_Condition. * einfo.adb Flag3 is now Has_Default_Init_Cond. Flag132 is now Is_Default_Init_Cond_ Procedure. Flag133 is now Has_Inherited_Default_Init_Cond. (Default_Init_Cond_Procedure): New routine. (Has_Default_Init_Cond): New routine. (Has_Inherited_Default_Init_Cond): New routine. (Is_Default_Init_Cond_Procedure): New routine. (Set_Default_Init_Cond_Procedure): New routine. (Set_Has_Default_Init_Cond): New routine. (Set_Has_Inherited_Default_Init_Cond): New routine. (Set_Is_Default_Init_Cond_Procedure): New routine. (Write_Entity_Flags): Output all the new flags. * einfo.ads New attributes Default_Init_Cond_Procedure, Has_Inherited_Default_Init_Cond and Is_Default_Init_Cond_Procedure along with usage in nodes. (Default_Init_Cond_Procedure): New routine. (Has_Default_Init_Cond): New routine and pragma Inline. (Has_Inherited_Default_Init_Cond): New routine and pragma Inline. (Is_Default_Init_Cond_Procedure): New routine and pragma Inline. (Set_Default_Init_Cond_Procedure): New routine. (Set_Has_Default_Init_Cond): New routine and pragma Inline. (Set_Has_Inherited_Default_Init_Cond): New routine and pragma Inline. (Set_Is_Default_Init_Cond_Procedure): New routine and pragma Inline. * exp_ch3.adb (Expand_N_Object_Declaration): New constant Next_N. Generate a call to the default initial condition procedure if the object's type is subject to the pragma. (Freeze_Type): Generate the body of the default initial condition procedure or inherit the spec from a parent type. * exp_ch7.adb Add with and use clause for Exp_Prag. (Expand_Pragma_Initial_Condition): Removed. * exp_prag.ads, exp_prag.adb (Expand_Pragma_Initial_Condition): New routine. * par-prag.adb (Prag): Pragma Default_Initial_Condition does not need special treatment by the parser. * sem_ch3.adb (Build_Derived_Record_Type): Propagate the attributes related to pragma Default_Initial_Condition to the derived type. (Process_Full_View): Propagate the attributes related to pragma Default_Initial_Condition to the full view. * sem_ch7.adb (Analyze_Package_Specification): Build the declaration of the default initial condition procedure for all types that qualify or inherit the one from the parent type. * sem_ch13.adb (Analyze_Aspect_Specifications): Add processing for aspect Default_Initial_Condition. (Check_Aspect_At_Freeze_Point): Aspect Default_Initial_Condition does not require delayed analysis. (Replace_Type_References_Generic): Moved to spec. * sem_ch13.ads (Replace_Type_References_Generic): Moved from body. * sem_prag.adb Add an entry in table Sif_Glags for Default_Initial_Condition. (Analyze_Pragma): Pragma Default_Initial_Condition is now part of assertion policy. Add processing for pragma Default_Initial_Condition. (Is_Valid_Assertion_Kind): Pragma Default_Initial_Condition is now recognized as a proper assertion policy. * sem_util.ads, sem_util.adb (Build_Default_Init_Cond_Call): New routine. (Build_Default_Init_Cond_Procedure_Body): New routine. (Build_Default_Init_Cond_Procedure_Declaration): New routine. (Inherit_Default_Init_Cond_Procedure): New routine. * snames.ads-tmpl Add new predefined name and pragma id for Default_Initial_Condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213552 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/aspects.ads')
-rw-r--r--gcc/ada/aspects.ads146
1 files changed, 75 insertions, 71 deletions
diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads
index 84567f3bcc0..8e47172803a 100644
--- a/gcc/ada/aspects.ads
+++ b/gcc/ada/aspects.ads
@@ -86,6 +86,7 @@ package Aspects is
Aspect_Convention,
Aspect_CPU,
Aspect_Default_Component_Value,
+ Aspect_Default_Initial_Condition, -- GNAT
Aspect_Default_Iterator,
Aspect_Default_Value,
Aspect_Depends, -- GNAT
@@ -296,76 +297,77 @@ package Aspects is
-- The following array indicates what argument type is required
Aspect_Argument : constant array (Aspect_Id) of Aspect_Expression :=
- (No_Aspect => Optional_Expression,
- Aspect_Abstract_State => Expression,
- Aspect_Address => Expression,
- Aspect_Alignment => Expression,
- Aspect_Annotate => Expression,
- Aspect_Attach_Handler => Expression,
- Aspect_Bit_Order => Expression,
- Aspect_Component_Size => Expression,
- Aspect_Constant_Indexing => Name,
- Aspect_Contract_Cases => Expression,
- Aspect_Convention => Name,
- Aspect_CPU => Expression,
- Aspect_Default_Component_Value => Expression,
- Aspect_Default_Iterator => Name,
- Aspect_Default_Value => Expression,
- Aspect_Depends => Expression,
- Aspect_Dimension => Expression,
- Aspect_Dimension_System => Expression,
- Aspect_Dispatching_Domain => Expression,
- Aspect_Dynamic_Predicate => Expression,
- Aspect_External_Name => Expression,
- Aspect_External_Tag => Expression,
- Aspect_Global => Expression,
- Aspect_Implicit_Dereference => Name,
- Aspect_Initial_Condition => Expression,
- Aspect_Initializes => Expression,
- Aspect_Input => Name,
- Aspect_Interrupt_Priority => Expression,
- Aspect_Invariant => Expression,
- Aspect_Iterable => Expression,
- Aspect_Iterator_Element => Name,
- Aspect_Link_Name => Expression,
- Aspect_Linker_Section => Expression,
- Aspect_Machine_Radix => Expression,
- Aspect_Object_Size => Expression,
- Aspect_Output => Name,
- Aspect_Part_Of => Expression,
- Aspect_Post => Expression,
- Aspect_Postcondition => Expression,
- Aspect_Pre => Expression,
- Aspect_Precondition => Expression,
- Aspect_Predicate => Expression,
- Aspect_Priority => Expression,
- Aspect_Read => Name,
- Aspect_Refined_Depends => Expression,
- Aspect_Refined_Global => Expression,
- Aspect_Refined_Post => Expression,
- Aspect_Refined_State => Expression,
- Aspect_Relative_Deadline => Expression,
- Aspect_Scalar_Storage_Order => Expression,
- Aspect_Simple_Storage_Pool => Name,
- Aspect_Size => Expression,
- Aspect_Small => Expression,
- Aspect_SPARK_Mode => Optional_Name,
- Aspect_Static_Predicate => Expression,
- Aspect_Storage_Pool => Name,
- Aspect_Storage_Size => Expression,
- Aspect_Stream_Size => Expression,
- Aspect_Suppress => Name,
- Aspect_Synchronization => Name,
- Aspect_Test_Case => Expression,
- Aspect_Type_Invariant => Expression,
- Aspect_Unsuppress => Name,
- Aspect_Value_Size => Expression,
- Aspect_Variable_Indexing => Name,
- Aspect_Warnings => Name,
- Aspect_Write => Name,
-
- Boolean_Aspects => Optional_Expression,
- Library_Unit_Aspects => Optional_Expression);
+ (No_Aspect => Optional_Expression,
+ Aspect_Abstract_State => Expression,
+ Aspect_Address => Expression,
+ Aspect_Alignment => Expression,
+ Aspect_Annotate => Expression,
+ Aspect_Attach_Handler => Expression,
+ Aspect_Bit_Order => Expression,
+ Aspect_Component_Size => Expression,
+ Aspect_Constant_Indexing => Name,
+ Aspect_Contract_Cases => Expression,
+ Aspect_Convention => Name,
+ Aspect_CPU => Expression,
+ Aspect_Default_Component_Value => Expression,
+ Aspect_Default_Initial_Condition => Optional_Expression,
+ Aspect_Default_Iterator => Name,
+ Aspect_Default_Value => Expression,
+ Aspect_Depends => Expression,
+ Aspect_Dimension => Expression,
+ Aspect_Dimension_System => Expression,
+ Aspect_Dispatching_Domain => Expression,
+ Aspect_Dynamic_Predicate => Expression,
+ Aspect_External_Name => Expression,
+ Aspect_External_Tag => Expression,
+ Aspect_Global => Expression,
+ Aspect_Implicit_Dereference => Name,
+ Aspect_Initial_Condition => Expression,
+ Aspect_Initializes => Expression,
+ Aspect_Input => Name,
+ Aspect_Interrupt_Priority => Expression,
+ Aspect_Invariant => Expression,
+ Aspect_Iterable => Expression,
+ Aspect_Iterator_Element => Name,
+ Aspect_Link_Name => Expression,
+ Aspect_Linker_Section => Expression,
+ Aspect_Machine_Radix => Expression,
+ Aspect_Object_Size => Expression,
+ Aspect_Output => Name,
+ Aspect_Part_Of => Expression,
+ Aspect_Post => Expression,
+ Aspect_Postcondition => Expression,
+ Aspect_Pre => Expression,
+ Aspect_Precondition => Expression,
+ Aspect_Predicate => Expression,
+ Aspect_Priority => Expression,
+ Aspect_Read => Name,
+ Aspect_Refined_Depends => Expression,
+ Aspect_Refined_Global => Expression,
+ Aspect_Refined_Post => Expression,
+ Aspect_Refined_State => Expression,
+ Aspect_Relative_Deadline => Expression,
+ Aspect_Scalar_Storage_Order => Expression,
+ Aspect_Simple_Storage_Pool => Name,
+ Aspect_Size => Expression,
+ Aspect_Small => Expression,
+ Aspect_SPARK_Mode => Optional_Name,
+ Aspect_Static_Predicate => Expression,
+ Aspect_Storage_Pool => Name,
+ Aspect_Storage_Size => Expression,
+ Aspect_Stream_Size => Expression,
+ Aspect_Suppress => Name,
+ Aspect_Synchronization => Name,
+ Aspect_Test_Case => Expression,
+ Aspect_Type_Invariant => Expression,
+ Aspect_Unsuppress => Name,
+ Aspect_Value_Size => Expression,
+ Aspect_Variable_Indexing => Name,
+ Aspect_Warnings => Name,
+ Aspect_Write => Name,
+
+ Boolean_Aspects => Optional_Expression,
+ Library_Unit_Aspects => Optional_Expression);
-----------------------------------------
-- Table Linking Names and Aspect_Id's --
@@ -392,9 +394,10 @@ package Aspects is
Aspect_Contract_Cases => Name_Contract_Cases,
Aspect_Convention => Name_Convention,
Aspect_CPU => Name_CPU,
+ Aspect_Default_Component_Value => Name_Default_Component_Value,
+ Aspect_Default_Initial_Condition => Name_Default_Initial_Condition,
Aspect_Default_Iterator => Name_Default_Iterator,
Aspect_Default_Value => Name_Default_Value,
- Aspect_Default_Component_Value => Name_Default_Component_Value,
Aspect_Depends => Name_Depends,
Aspect_Dimension => Name_Dimension,
Aspect_Dimension_System => Name_Dimension_System,
@@ -675,6 +678,7 @@ package Aspects is
Aspect_Async_Writers => Never_Delay,
Aspect_Contract_Cases => Never_Delay,
Aspect_Convention => Never_Delay,
+ Aspect_Default_Initial_Condition => Never_Delay,
Aspect_Depends => Never_Delay,
Aspect_Dimension => Never_Delay,
Aspect_Dimension_System => Never_Delay,