aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2020-05-19 16:11:28 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-08 10:55:51 -0400
commitc1fece377a93b1809243280fcbe01b143f105c9c (patch)
tree38d9a16399e332804a3f4ebd08bf74263545d1d2
parent01f27c64770ae34cb659679e2c25f2fea44fbbb6 (diff)
downloadgcc-c1fece377a93b1809243280fcbe01b143f105c9c.zip
gcc-c1fece377a93b1809243280fcbe01b143f105c9c.tar.gz
gcc-c1fece377a93b1809243280fcbe01b143f105c9c.tar.bz2
[Ada] Add utility function to recognize attribute 'Loop_Entry
gcc/ada/ * sem_util.ads, sem_util.adb (Is_Attribute_Loop_Entry): New function for GNATProve.
-rw-r--r--gcc/ada/sem_util.adb10
-rw-r--r--gcc/ada/sem_util.ads3
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 96563cb..8dd9e18 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -14456,6 +14456,16 @@ package body Sem_Util is
return Is_Atomic_Object (N) or else Is_Volatile_Full_Access_Object (N);
end Is_Atomic_Or_VFA_Object;
+ -----------------------------
+ -- Is_Attribute_Loop_Entry --
+ -----------------------------
+
+ function Is_Attribute_Loop_Entry (N : Node_Id) return Boolean is
+ begin
+ return Nkind (N) = N_Attribute_Reference
+ and then Attribute_Name (N) = Name_Loop_Entry;
+ end Is_Attribute_Loop_Entry;
+
----------------------
-- Is_Attribute_Old --
----------------------
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 2c6259b..b467e26 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -1621,6 +1621,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_Loop_Entry (N : Node_Id) return Boolean;
+ -- Determine whether node N denotes attribute 'Loop_Entry
+
function Is_Attribute_Old (N : Node_Id) return Boolean;
-- Determine whether node N denotes attribute 'Old