public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1275] ada: Simplify iteration over record component items with possible pragmas
@ 2023-05-26  7:36 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-05-26  7:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c7a07d7e6a09c43682576f625fc232a0ba3ee3ba

commit r14-1275-gc7a07d7e6a09c43682576f625fc232a0ba3ee3ba
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Mon Mar 20 20:30:09 2023 +0100

    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.

Diff:
---
 gcc/ada/sem_util.adb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 64c12cc7ecf..e11eded398d 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-26  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26  7:36 [gcc r14-1275] ada: Simplify iteration over record component items with possible pragmas Marc Poulhi?s

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).