diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2019-09-17 08:01:23 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-09-17 08:01:23 +0000 |
commit | ee7c961db9da34d3e437eba0088f7291a7a5dfb4 (patch) | |
tree | 3b2d41314d94f44d3342e2258f34eadb4956cc3f /gcc/ada | |
parent | cbb0b55385692dca6898a2668766f17ea42c4d2e (diff) | |
download | gcc-ee7c961db9da34d3e437eba0088f7291a7a5dfb4.zip gcc-ee7c961db9da34d3e437eba0088f7291a7a5dfb4.tar.gz gcc-ee7c961db9da34d3e437eba0088f7291a7a5dfb4.tar.bz2 |
[Ada] A new utility routine for detecting attribute 'Old
Add a utility routine for detecting attribute 'Old. It will be
immediately reused in the GNATprove backend.
2019-09-17 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* sem_util.ads, sem_util.adb (Is_Attribute_Old): New utility
routine.
From-SVN: r275780
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 10 | ||||
-rw-r--r-- | gcc/ada/sem_util.ads | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a2f7e27..705756d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-09-17 Piotr Trojanek <trojanek@adacore.com> + + * sem_util.ads, sem_util.adb (Is_Attribute_Old): New utility + routine. + 2019-09-17 Yannick Moy <moy@adacore.com> * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add handling diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 86ae740..b7d2895 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -13559,6 +13559,16 @@ package body Sem_Util is Is_Volatile_Full_Access (Etype (Entity (N))))); end Is_Atomic_Or_VFA_Object; + ---------------------- + -- Is_Attribute_Old -- + ---------------------- + + function Is_Attribute_Old (N : Node_Id) return Boolean is + begin + return Nkind (N) = N_Attribute_Reference + and then Attribute_Name (N) = Name_Old; + end Is_Attribute_Old; + ------------------------- -- Is_Attribute_Result -- ------------------------- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index c9065e5..2d1bcf0 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1549,6 +1549,9 @@ package Sem_Util is -- Determine whether arbitrary node N denotes a reference to an object -- which is either atomic or Volatile_Full_Access. + function Is_Attribute_Old (N : Node_Id) return Boolean; + -- Determine whether node N denotes attribute 'Old + function Is_Attribute_Result (N : Node_Id) return Boolean; -- Determine whether node N denotes attribute 'Result |