https://gcc.gnu.org/g:6bb5439c74a029446c14a4925e52d1b67afced0a
commit r15-6532-g6bb5439c74a029446c14a4925e52d1b67afced0a Author: Piotr Trojanek <troja...@adacore.com> Date: Wed Dec 4 19:20:31 2024 +0100 ada: Reuse existing utility routine to detect attribute Loop_Entry 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. Diff: --- 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 467661bf4186..d445ca828ae0 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 6a3b7c6e0a98..18b3a4fc22f5 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 b45be1747981..50ba96bbef1d 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;