diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2022-03-07 14:07:15 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-16 08:42:02 +0000 |
commit | 457fb3369aec1e9d681853bcd33d77bb8da2f8ea (patch) | |
tree | 9b56ea69647ccdaae40e18eeda4ef5ead73f82df /gcc | |
parent | 07ee67a44d90380c3ab13587dd7d3f4714379d1f (diff) | |
download | gcc-457fb3369aec1e9d681853bcd33d77bb8da2f8ea.zip gcc-457fb3369aec1e9d681853bcd33d77bb8da2f8ea.tar.gz gcc-457fb3369aec1e9d681853bcd33d77bb8da2f8ea.tar.bz2 |
[Ada] Clarify code for detecting volatile refinement properties
Routine Type_Or_Variable_Has_Enabled_Property handles either types or
objects; replace negation with an explicit positive condition.
Cleanup related to handling of volatile refinement aspects in SPARK;
behaviour is unaffected.
gcc/ada/
* sem_util.adb (Type_Or_Variable_Has_Enabled_Property): Clarify.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_util.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index d53c435..6cf3c70 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12696,10 +12696,10 @@ package body Sem_Util is return Type_Or_Variable_Has_Enabled_Property (First_Subtype (Etype (Base_Type (Item_Id)))); - -- If not specified explicitly for an object and the type + -- If not specified explicitly for an object and its type -- is effectively volatile, then take result from the type. - elsif not Is_Type (Item_Id) + elsif Is_Object (Item_Id) and then Is_Effectively_Volatile (Etype (Item_Id)) then return Has_Enabled_Property (Etype (Item_Id), Property); |