]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Change local object from variable to constant
authorPiotr Trojanek <trojanek@adacore.com>
Sun, 10 May 2020 19:56:42 +0000 (21:56 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:16:30 +0000 (13:16 -0300)
gcc/ada/

* sem_aggr.adb (Resolve_Delta_Array_Aggregate): Make Index_Type
a constant.

gcc/ada/sem_aggr.adb

index a17f156ee6750b97c6b1c2812247fb5eae7b4695..9e2801adfcbf63326804c04349a7902c325cbb73 100644 (file)
@@ -2660,15 +2660,13 @@ package body Sem_Aggr is
    -----------------------------------
 
    procedure Resolve_Delta_Array_Aggregate (N : Node_Id; Typ : Entity_Id) is
-      Deltas : constant List_Id := Component_Associations (N);
+      Deltas     : constant List_Id   := Component_Associations (N);
+      Index_Type : constant Entity_Id := Etype (First_Index (Typ));
 
-      Assoc      : Node_Id;
-      Choice     : Node_Id;
-      Index_Type : Entity_Id;
+      Assoc  : Node_Id;
+      Choice : Node_Id;
 
    begin
-      Index_Type := Etype (First_Index (Typ));
-
       Assoc := First (Deltas);
       while Present (Assoc) loop
          if Nkind (Assoc) = N_Iterated_Component_Association then