]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Reuse existing utility routine to detect attribute Loop_Entry
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 4 Dec 2024 18:20:31 +0000 (19:20 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 3 Jan 2025 15:39:13 +0000 (16:39 +0100)
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.

gcc/ada/checks.adb
gcc/ada/sem_ch4.adb
gcc/ada/sem_prag.adb

index 467661bf4186de51efa107b38beff08b40fb206b..d445ca828ae075357c2fa9d13266e653f7af9e8e 100644 (file)
@@ -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;
 
index 6a3b7c6e0a987f7bdbb2d4420e0647ae9278f2d0..18b3a4fc22f53f62bfe5df1b29a7c786abeeadd5 100644 (file)
@@ -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;
 
index b45be1747981b7142a9667609bb0ad7afa4b2b0f..50ba96bbef1d6a46ffd030e11825183a88e6c732 100644 (file)
@@ -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;