[Ada] Support aspect Relaxed_Initialization and attribute Initialized
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 27 Mar 2020 22:39:03 +0000 (23:39 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 15 Jun 2020 08:04:26 +0000 (04:04 -0400)
commite577151d02b9e73e2aa985f0254f5a2f060d3e54
tree9afd7a3467a20949924b55fb50d45d9c50200134
parent6a920eb51077cd465472eabb24a49b3e4ca30e93
[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.
gcc/ada/aspects.ads
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/exp_attr.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/ada/snames.ads-tmpl