]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Simplify iteration over formal parameters for Global/Depends check
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 7 Jan 2021 10:50:51 +0000 (11:50 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 4 May 2021 09:17:34 +0000 (05:17 -0400)
gcc/ada/

* sem_prag.adb (Collect_Global_Item): Iterate directly over
formals.

gcc/ada/sem_prag.adb

index 0eb6ff653606c4f58e6e91602fc7e68ac24afb33..645b892ddd1992cb9caf7e28aa00654d683a9f45 100644 (file)
@@ -30246,7 +30246,7 @@ package body Sem_Prag is
 
          --  Process all formal parameters
 
-         Formal := First_Entity (Spec_Id);
+         Formal := First_Formal (Spec_Id);
          while Present (Formal) loop
             if Ekind (Formal) in E_In_Out_Parameter | E_In_Parameter then
                Append_New_Elmt (Formal, Subp_Inputs);
@@ -30277,7 +30277,7 @@ package body Sem_Prag is
                Append_New_Elmt (Formal, Subp_Outputs);
             end if;
 
-            Next_Entity (Formal);
+            Next_Formal (Formal);
          end loop;
 
       --  Otherwise the input denotes a task type, a task body, or the