diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-12-04 19:20:31 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-03 16:39:13 +0100 |
commit | 6bb5439c74a029446c14a4925e52d1b67afced0a (patch) | |
tree | 915a3b68c24c6b283d0f8c6d76ead95e80590889 /gcc | |
parent | 0c0d73490570674a311022efb31d43150081111c (diff) | |
download | gcc-6bb5439c74a029446c14a4925e52d1b67afced0a.zip gcc-6bb5439c74a029446c14a4925e52d1b67afced0a.tar.gz gcc-6bb5439c74a029446c14a4925e52d1b67afced0a.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/checks.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_ch4.adb | 4 | ||||
-rw-r--r-- | 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 467661b..d445ca8 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 6a3b7c6..18b3a4f 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 b45be17..50ba96b 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; |