[Ada] Ada2022: AI12-0143 Index attribute for entry families
authorJavier Miranda <miranda@adacore.com>
Fri, 1 Apr 2022 20:06:27 +0000 (20:06 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 18 May 2022 08:41:05 +0000 (08:41 +0000)
commit337c80a6bcf248f021e9731bba7543fb5bfb3553
treea6ea99d6150f44a042d63fdc207873b9f384599c
parent3c63f73051458b24298eb82ddd109bbc6a453464
[Ada] Ada2022: AI12-0143 Index attribute for entry families

gcc/ada/

* snames.ads-tmpl (Name_Index): New attribute name.
(Attribute_Id): Adding Attribute_Index as regular attribute.
* sem_attr.adb (Attribute_22): Adding Attribute_Index as Ada
2022 attribute.
(Analyze_Index_Attribute): Check that 'Index appears in a
pre-/postcondition aspect or pragma associated with an entry
family.
(Analyze_Attribute): Adding semantic analysis for 'Index.
(Eval_Attribute): Register 'Index as can never be folded.
(Resolve_Attribute): Resolve attribute 'Index.
* sem_ch9.adb (Check_Wrong_Attribute_In_Postconditions): New
subprogram.
(Analyze_Requeue): Check that the requeue target shall not have
an applicable specific or class-wide postcondition which
includes an Index attribute reference.
* exp_attr.adb (Expand_N_Attribute_Reference): Transform
attribute Index into a renaming of the second formal of the
wrapper built for an entry family that has contract cases.
* einfo.ads (Is_Entry_Wrapper): Complete documentation.
gcc/ada/einfo.ads
gcc/ada/exp_attr.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_ch9.adb
gcc/ada/snames.ads-tmpl