aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.ads
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-01-26 12:14:48 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-13 10:03:31 +0200
commit7f1289651145ed5590c883e9a531e3bcc11b1130 (patch)
treea505ad14987af75e51ea7912647733af61979af9 /gcc/ada/sem_util.ads
parent65c0029fd969b30794ee0778ddb08e60ee45d770 (diff)
ada: Refactor repeated code for querying Boolean-valued aspects
Code cleanup following a fix for aspect Exclusive_Functions; semantics is unaffected. gcc/ada/ * exp_ch9.adb (Build_Protected_Subprogram_Body, Build_Protected_Subprogram_Call_Cleanup): Reuse refactored routine. * sem_util.adb (Has_Enabled_Aspect): Refactored repeated code. (Is_Static_Function): Reuse refactored routine. * sem_util.ads (Has_Enabled_Aspect): New query routine refactored from repeated code.
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r--gcc/ada/sem_util.ads6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index a5eb1ecd7c1..527b1075c3f 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1559,6 +1559,12 @@ package Sem_Util is
-- Given arbitrary type Typ, determine whether it contains at least one
-- effectively volatile component.
+ function Has_Enabled_Aspect (Id : Entity_Id; A : Aspect_Id) return Boolean
+ with Pre => A in Boolean_Aspects;
+ -- Returns True if a Boolean-valued aspect is enabled on entity Id; i.e. it
+ -- is present and either has no aspect definition or its aspect definition
+ -- statically evaluates to True.
+
function Has_Volatile_Component (Typ : Entity_Id) return Boolean;
-- Given arbitrary type Typ, determine whether it contains at least one
-- volatile component.