From: Piotr Trojanek <troja...@adacore.com>

Code cleanup; semantics is unaffected.

gcc/ada/ChangeLog:

        * checks.adb (Generate_Index_Checks): Reuse existing utility routine.
        * sem_ch4.adb (Analyze_Indexed_Component_Form): Likewise.
        * sem_prag.adb (Analyze_Pragma): Likewise.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/checks.adb   | 4 +---
 gcc/ada/sem_ch4.adb  | 4 +---
 gcc/ada/sem_prag.adb | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 467661bf418..d445ca828ae 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -7306,9 +7306,7 @@ package body Checks is
       --  Delay the generation of the check until 'Loop_Entry has been properly
       --  expanded. This is done in Expand_Loop_Entry_Attributes.
 
-      elsif Nkind (Prefix (N)) = N_Attribute_Reference
-        and then Attribute_Name (Prefix (N)) = Name_Loop_Entry
-      then
+      elsif Is_Attribute_Loop_Entry (Prefix (N)) then
          return;
       end if;
 
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 6a3b7c6e0a9..18b3a4fc22f 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -3053,9 +3053,7 @@ package body Sem_Ch4 is
       --  the indexed component denotes a loop name, the indexed form is turned
       --  into an attribute reference.
 
-      elsif Nkind (N) = N_Attribute_Reference
-        and then Attribute_Name (N) = Name_Loop_Entry
-      then
+      elsif Is_Attribute_Loop_Entry (N) then
          return;
       end if;
 
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index b45be174798..50ba96bbef1 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -13646,9 +13646,7 @@ package body Sem_Prag is
 
                function Process (N : Node_Id) return Traverse_Result is
                begin
-                  if Nkind (N) = N_Attribute_Reference
-                    and then Attribute_Name (N) = Name_Loop_Entry
-                  then
+                  if Is_Attribute_Loop_Entry (N) then
                      return Abandon;
                   else
                      return OK;
-- 
2.43.0

Reply via email to