]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove redundant explicit calls to UI_From_Int in comparisons
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 8 Jan 2021 19:48:58 +0000 (20:48 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 5 May 2021 08:18:59 +0000 (04:18 -0400)
gcc/ada/

* exp_ch4.adb, sem_ch13.adb, sem_eval.adb, sem_res.adb: Remove
redundant calls to UI_From_Int.

gcc/ada/exp_ch4.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_res.adb

index a4af950dc0914880ca009c000630c03274d30cce..0ef744b48f36b80ffaf7eac52e8d94c23b05da87 100644 (file)
@@ -4262,7 +4262,7 @@ package body Exp_Ch4 is
             --  larger type for the operands, to prevent spurious constraint
             --  errors on large legal literals of the type.
 
-            if Modulus (Etype (N)) > UI_From_Int (Int (Integer'Last)) then
+            if Modulus (Etype (N)) > Int (Integer'Last) then
                Target_Type := Standard_Long_Long_Integer;
             else
                Target_Type := Standard_Integer;
index 5d9e58d256984b6651c7ddd3aedbb0741ac8fd9a..989ab6e8b024971fc66e1a91490096d072ab9af8 100644 (file)
@@ -12304,7 +12304,7 @@ package body Sem_Ch13 is
       --  Reject patently improper size values
 
       if Is_Elementary_Type (T)
-        and then Siz > UI_From_Int (Int'Last)
+        and then Siz > Int'Last
       then
          Error_Msg_N ("Size value too large for elementary type", N);
 
index 87a2f1f916b704ffc67bc581d6f44e8d5397be3a..a1e32f9c1724ff1491b2e481ee784499cfdefaf1 100644 (file)
@@ -4137,7 +4137,7 @@ package body Sem_Eval is
 
          Len := String_Length (Strval (N));
 
-         if UI_From_Int (Len) > String_Type_Len (Bas) then
+         if Len > String_Type_Len (Bas) then
 
             --  Issue message. Note that this message is a warning if the
             --  string literal is not marked as static (happens in some cases
index d0f82262eaf7ddf7791d5435bec3f9cc75ef8bd3..77af6ce4799d482125e2aa798981df4814fe7eb1 100644 (file)
@@ -11555,14 +11555,14 @@ package body Sem_Res is
                Comp_Typ_Hi : constant Node_Id :=
                                Type_High_Bound (Component_Type (Typ));
 
-               Char_Val : Uint;
+               Char_Val : Int;
 
             begin
                if Compile_Time_Known_Value (Comp_Typ_Lo)
                  and then Compile_Time_Known_Value (Comp_Typ_Hi)
                then
                   for J in 1 .. Strlen loop
-                     Char_Val := UI_From_Int (Int (Get_String_Char (Str, J)));
+                     Char_Val := Int (Get_String_Char (Str, J));
 
                      if Char_Val < Expr_Value (Comp_Typ_Lo)
                        or else Char_Val > Expr_Value (Comp_Typ_Hi)
@@ -11587,7 +11587,7 @@ package body Sem_Res is
       --  heavy artillery for this situation, but it is hard work to avoid.
 
       declare
-         Lits : constant List_Id    := New_List;
+         Lits : constant List_Id := New_List;
          P    : Source_Ptr := Loc + 1;
          C    : Char_Code;