]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Use procedural variant of Next_Index where possible
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 9 Mar 2023 23:14:32 +0000 (00:14 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 25 May 2023 07:44:19 +0000 (09:44 +0200)
Code cleanup; semantics is unaffected.

gcc/ada/

* einfo-utils.adb (Write_Entity_Info): Use procedural Next_Index.
* sem_aggr.adb (Collect_Aggr_Bounds): Reuse local constant.
(Resolve_Null_Array_Aggregate): Use procedural Next_Index.

gcc/ada/einfo-utils.adb
gcc/ada/sem_aggr.adb

index fa28a9e010065a0096d60054c4d7d3ba7d1f5d48..d1db66ff6972ae7aad31257d9cf725f7b3c55427 100644 (file)
@@ -3171,7 +3171,7 @@ package body Einfo.Utils is
                Index := First_Index (Id);
                while Present (Index) loop
                   Write_Attribute (" ", Etype (Index));
-                  Index := Next_Index (Index);
+                  Next_Index (Index);
                end loop;
 
                Write_Eol;
index 33c44c42a24c1828c5cf9ff3de6d4aeb2be05cec..d9520ca8f4b8cb1a33c27122d91e35866e8a9016 100644 (file)
@@ -464,8 +464,8 @@ package body Sem_Aggr is
          This_Range : constant Node_Id := Aggregate_Bounds (N);
          --  The aggregate range node of this specific sub-aggregate
 
-         This_Low  : constant Node_Id := Low_Bound  (Aggregate_Bounds (N));
-         This_High : constant Node_Id := High_Bound (Aggregate_Bounds (N));
+         This_Low  : constant Node_Id := Low_Bound  (This_Range);
+         This_High : constant Node_Id := High_Bound (This_Range);
          --  The aggregate bounds of this specific sub-aggregate
 
          Assoc : Node_Id;
@@ -4175,7 +4175,7 @@ package body Sem_Aggr is
          Append (Make_Range (Loc, New_Copy_Tree (Lo), Hi), Constr);
          Analyze_And_Resolve (Last (Constr), Etype (Index));
 
-         Index := Next_Index (Index);
+         Next_Index (Index);
       end loop;
 
       Set_Compile_Time_Known_Aggregate (N);