]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Refactor of Ultimate_Prefix
authorDenis Mazzucato <mazzucato@adacore.com>
Fri, 12 Sep 2025 13:50:54 +0000 (15:50 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 23 Sep 2025 13:01:13 +0000 (15:01 +0200)
gcc/ada/ChangeLog:

* sem_util.adb (Ultimate_Prefix): Clean-up the loop condition by using
Has_prefix instead of an explicit list of node kinds.

gcc/ada/sem_util.adb

index e6c183c5f9c3cc4256ae8e52fa05de3ba135c6ce..9e2083b8383d24916e981f49e02d480ca9c321cd 100644 (file)
@@ -29615,11 +29615,7 @@ package body Sem_Util is
 
    begin
       Pref := N;
-      while Nkind (Pref) in N_Explicit_Dereference
-                          | N_Indexed_Component
-                          | N_Selected_Component
-                          | N_Slice
-      loop
+      while Has_Prefix (Pref) loop
          Pref := Prefix (Pref);
       end loop;