]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Implement aspect No_Controlled_Parts
authorJustin Squirek <squirek@adacore.com>
Wed, 20 Jan 2021 17:09:19 +0000 (12:09 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 May 2021 09:28:56 +0000 (05:28 -0400)
commit7a6303e53b4d2328eb43c933f2cbd7f53526962c
treea5b357b10e5436fc0284fbbdde7900183383af05
parentfb246154cdeb518b8e8a584032afbda4d381a03b
[Ada] Implement aspect No_Controlled_Parts

gcc/ada/

* aspects.ads: Add entries to register
Aspect_No_Controlled_Parts.
* freeze.adb (Check_No_Controlled_Parts_Violations): Added to
check requirements of aspect No_Controlled_Parts after a type
has been frozen.
(Freeze_Entity): Add call to
Check_No_Controlled_Parts_Violations.
(Find_Aspect_No_Controlled_Parts): Created to obtain the aspect
specification for No_Controlled_Parts on a given type when
present.
(Find_Aspect_No_Controlled_Parts_Value): Protect against invalid
value.
(Has_Aspect_No_Controlled_Parts): Created as a prediate function
to check if No_Controlled_Parts has been specified on a type for
Get_Anacestor_Types_With_Specification.
(Get_Aspect_No_Controlled_Parts_Value): Created to obtain the
value of the aspect No_Controlled_Parts when specified on a
given type.
(Get_Generic_Formal_Types_In_Hierarchy): Created to collect
formal types in a given type's hierarchy.
(Get_Types_With_Aspect_In_Hierarchy): Created to collect types
in a given type's hierarchy with No_Controlled_Parts specified.
* sem_ch13.adb (Analyze_One_Aspect): Add processing for
No_Controlled_Parts, and fix error in check for allowed pragmas
for formal types.
(Check_Expr_Is_OK_Static_Expression): Created to enforce
checking of static expressions in the same vein as
Analyze_Pragma.Check_Expr_OK_Static_Expression.
* sem_util.adb (Collect_Types_In_Hierarchy): Created to collect
types in a given type's hierarchy that match a given predicate
function.
* sem_util.ads: Fix typo.
* snames.ads-tmpl: Add entry for No_Controlled_Parts.
gcc/ada/aspects.ads
gcc/ada/freeze.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/ada/snames.ads-tmpl