]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Remove explicit call to Make_Unchecked_Type_Conversion
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 9 Jun 2022 20:01:06 +0000 (22:01 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 6 Jul 2022 13:29:47 +0000 (13:29 +0000)
Respect a comment in sinfo.ads, which says: "Unchecked type conversion
nodes should be created by calling Tbuild.Unchecked_Convert_To, rather
than by directly calling Nmake.Make_Unchecked_Type_Conversion."

No test appears to be affected by this change, so this is just a
cleanup.

gcc/ada/

* exp_ch6.adb (Build_Static_Check_Helper_Call): Replace explicit
call to Make_Unchecked_Type_Conversion with a call to
Unchecked_Convert_To.
* tbuild.adb (Unchecked_Convert_To): Fix whitespace.

gcc/ada/exp_ch6.adb
gcc/ada/tbuild.adb

index d6d9d008a55e5d6ef6b073ecd9754ea3fbe96103..b5764ad12e1ff12efdcb1dcdacc8a28ffdb1b2b7 100644 (file)
@@ -7578,9 +7578,7 @@ package body Exp_Ch6 is
               and then Etype (F) /= Etype (A)
             then
                Append_To (Actuals,
-                 Make_Unchecked_Type_Conversion (Loc,
-                   New_Occurrence_Of (Etype (F), Loc),
-                   New_Copy_Tree (A)));
+                 Unchecked_Convert_To (Etype (F), New_Copy_Tree (A)));
             else
                Append_To (Actuals, New_Copy_Tree (A));
             end if;
index 5aa9fbc8015d2562e27d5372152bf39741642025..df13e9f80b0067cdfb514d9df5bcbd4330a788be 100644 (file)
@@ -882,8 +882,8 @@ package body Tbuild is
       --  We don't really want to allow E_Void here, but existing code passes
       --  it.
 
-      Loc         : constant Source_Ptr := Sloc (Expr);
-      Result      : Node_Id;
+      Loc    : constant Source_Ptr := Sloc (Expr);
+      Result : Node_Id;
 
    begin
       --  If the expression is already of the correct type, then nothing
This page took 0.066745 seconds and 5 git commands to generate.