]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Refine types of local constants that store Etype results
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 11 Jun 2021 14:04:13 +0000 (16:04 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 20 Sep 2021 12:31:32 +0000 (12:31 +0000)
gcc/ada/

* exp_aggr.adb, exp_ch4.adb, exp_ch5.adb, sprint.adb: Refine
types of local constants.

gcc/ada/exp_aggr.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_ch5.adb
gcc/ada/sprint.adb

index 1b0843666058b87a2da0c7a07a58e0a35f63523c..00bd8c0e985dbdc96606d4183c582f6c38d587d1 100644 (file)
@@ -4003,7 +4003,7 @@ package body Exp_Aggr is
                  and then Present (First_Index (Etype (Expr_Q)))
                then
                   declare
-                     Expr_Q_Type : constant Node_Id := Etype (Expr_Q);
+                     Expr_Q_Type : constant Entity_Id := Etype (Expr_Q);
                   begin
                      Append_List_To (L,
                        Build_Array_Aggr_Code
index 45b9c769360ca1e32ba7aa9ca1f45c5b6213bfba..c52ec35d3eaa8cbfcd4785e4fa7ee419d2eaf8eb 100644 (file)
@@ -7763,8 +7763,8 @@ package body Exp_Ch4 is
 
          if Is_Unchecked_Union (Op_Type) then
             declare
-               Lhs_Type : constant Node_Id := Etype (L_Exp);
-               Rhs_Type : constant Node_Id := Etype (R_Exp);
+               Lhs_Type : constant Entity_Id := Etype (L_Exp);
+               Rhs_Type : constant Entity_Id := Etype (R_Exp);
 
                Lhs_Discr_Vals : Elist_Id;
                --  List of inferred discriminant values for left operand.
index 8ac9662902567293ebf8cbd9b305c326332c3147..08ce562f0fa20beabf3f3234b17871328e4f4fe9 100644 (file)
@@ -742,8 +742,8 @@ package body Exp_Ch5 is
       --  in the front end.
 
       declare
-         L_Index_Typ : constant Node_Id := Etype (First_Index (L_Type));
-         R_Index_Typ : constant Node_Id := Etype (First_Index (R_Type));
+         L_Index_Typ : constant Entity_Id := Etype (First_Index (L_Type));
+         R_Index_Typ : constant Entity_Id := Etype (First_Index (R_Type));
 
          Left_Lo  : constant Node_Id := Type_Low_Bound  (L_Index_Typ);
          Left_Hi  : constant Node_Id := Type_High_Bound (L_Index_Typ);
@@ -1382,8 +1382,8 @@ package body Exp_Ch5 is
 
       Loc  : constant Source_Ptr := Sloc (N);
 
-      L_Index_Typ : constant Node_Id := Etype (First_Index (L_Type));
-      R_Index_Typ : constant Node_Id := Etype (First_Index (R_Type));
+      L_Index_Typ : constant Entity_Id := Etype (First_Index (L_Type));
+      R_Index_Typ : constant Entity_Id := Etype (First_Index (R_Type));
       Left_Lo  : constant Node_Id := Type_Low_Bound  (L_Index_Typ);
       Right_Lo : constant Node_Id := Type_Low_Bound  (R_Index_Typ);
 
index c1f1edecd80da652b3c17ca863e8be2fcee65383..8dc96a4f206b26d8866a2e4464ca64af29d2862f 100644 (file)
@@ -4222,7 +4222,7 @@ package body Sprint is
          --  Itype to be printed
 
          declare
-            B : constant Node_Id := Etype (Typ);
+            B : constant Entity_Id := Etype (Typ);
             P : constant Node_Id := Parent (Typ);
             S : constant Saved_Output_Buffer := Save_Output_Buffer;
             --  Save current output buffer