]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Cleanup comment about mapping parameters when inlining
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 12 Aug 2022 09:51:30 +0000 (11:51 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 7 Nov 2022 08:36:31 +0000 (09:36 +0100)
Improve location of the comment about a special case for GNATprove mode.

gcc/ada/

* inline.adb (Establish_Actual_Mapping_For_Inlined_Call): Move
comment next to a condition that it describes.

gcc/ada/inline.adb

index e3f35daca09a266cb2ef8ffcea5f2c6a0c038105..a1ead98e67af19ec00510708f447077e65bcb5c7 100644 (file)
@@ -3013,14 +3013,10 @@ package body Inline is
             Temp_Typ := Etype (A);
          end if;
 
-         --  If the actual is a simple name or a literal, no need to
-         --  create a temporary, object can be used directly.
-
-         --  If the actual is a literal and the formal has its address taken,
-         --  we cannot pass the literal itself as an argument, so its value
-         --  must be captured in a temporary. Skip this optimization in
-         --  GNATprove mode, to make sure any check on a type conversion
-         --  will be issued.
+         --  If the actual is a simple name or a literal, no need to create a
+         --  temporary, object can be used directly. Skip this optimization in
+         --  GNATprove mode, to make sure any check on a type conversion will
+         --  be issued.
 
          if (Is_Entity_Name (A)
               and then
@@ -3039,6 +3035,10 @@ package body Inline is
                and then Formal_Is_Used_Once (F)
                and then not GNATprove_Mode)
 
+         --  If the actual is a literal and the formal has its address taken,
+         --  we cannot pass the literal itself as an argument, so its value
+         --  must be captured in a temporary.
+
            or else
              (Nkind (A) in
                 N_Real_Literal | N_Integer_Literal | N_Character_Literal