diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2023-03-20 20:30:09 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-05-26 09:29:17 +0200 |
commit | c7a07d7e6a09c43682576f625fc232a0ba3ee3ba (patch) | |
tree | 2dc8e7629b3714319f660d4b5d0b0bf5854a3f0f | |
parent | fd3eff65551876a04febca1621d7d19f9390aab6 (diff) | |
download | gcc-c7a07d7e6a09c43682576f625fc232a0ba3ee3ba.zip gcc-c7a07d7e6a09c43682576f625fc232a0ba3ee3ba.tar.gz gcc-c7a07d7e6a09c43682576f625fc232a0ba3ee3ba.tar.bz2 |
ada: Simplify iteration over record component items with possible pragmas
Code cleanup; semantics is unaffected.
gcc/ada/
* sem_util.adb (Is_Null_Record_Definition): Use First_Non_Pragma and
Next_Non_Pragma to ignore pragmas within component list.
-rw-r--r-- | gcc/ada/sem_util.adb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 64c12cc..e11eded 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -18699,19 +18699,17 @@ package body Sem_Util is return True; end if; - Item := First (Component_Items (Component_List (Record_Def))); + Item := First_Non_Pragma (Component_Items (Component_List (Record_Def))); while Present (Item) loop if Nkind (Item) = N_Component_Declaration and then Is_Internal_Name (Chars (Defining_Identifier (Item))) then null; - elsif Nkind (Item) = N_Pragma then - null; else return False; end if; - Item := Next (Item); + Next_Non_Pragma (Item); end loop; return True; |