[Ada] Support aspect Relaxed_Initialization and attribute Initialized
2020-06-15 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* aspects.ads (Aspect_Id): Add Aspect_Relaxed_Initialization.
(Implementation_Defined_Aspect): Add new aspect.
(Aspect_Argument): Add new aspect with Optional_Expression
argument.
(Is_Representation_Aspect): Add new aspect as a
non-representation one.
(Aspect_Names): Add name for the new aspect.
(Aspect_Delay): Add new aspect as a non-delayed one.
* sem_ch3.adb: Minor reformatting.
* einfo.ads, einfo.adb (Is_Relaxed_Initialization_State): New
query; reuses existing code for querying abstract state options.
* exp_attr.adb (Expand_N_Attribute_Reference): For now ignore
attribute 'Initialized.
* sem_attr.adb (Analyze_Attribute_Old_Result): Allow attribute
'Result to be used in the aspect Relaxed_Initialization
expression.
(Analyze_Attribute): Analyze attribute 'Initialized; based on
existing code for attribute 'Valid_Scalars.
(Eval_Attribute): Do not expect attribute 'Initialized, just
like attribute 'Valid_Scalars is not expected.
* sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): New
routine.
(Analyze_Aspect_Specifications): Analyze new aspect in a
dedicated routine.
(Check_Aspect_At_Freeze_Point): Do not expect new aspect.
* sem_prag.adb (Analyze_Abstract_State): Support option
Relaxed_Initialization on abstract states.
* sem_util.ads, sem_util.adb (Has_Relaxed_Initialization): New
query for the GNATprove backend.
* snames.ads-tmpl (Snames): Add Name_Ids for the new aspect and
attribute; add an Attribute_Id for the new attribute.