]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Simplify detection of the enclosing scope
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 16 Jan 2024 12:07:20 +0000 (13:07 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 May 2024 07:55:57 +0000 (09:55 +0200)
Code cleanup; behaviour is unaffected.

gcc/ada/

* sem_attr.adb (Analyze_Access_Attribute): Replace loop with
Current_Scope_No_Loops.

gcc/ada/sem_attr.adb

index 6140cc0c0d63d62ed07f7142f04b267ac2ffb651..e80a144ebb240752b03d5ccf1e58daf2ea5c866e 100644 (file)
@@ -988,10 +988,7 @@ package body Sem_Attr is
                --  expanded into a loop. Locate scope of type definition,
                --  if any.
 
-               Scop := Current_Scope;
-               while Ekind (Scop) = E_Loop loop
-                  Scop := Scope (Scop);
-               end loop;
+               Scop := Current_Scope_No_Loops;
 
                --  OK if we are within the scope of a limited type
                --  let's mark the component as having per object constraint