]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Rename Image_Should_Call_Put_Image into Image_Must_Call_Put_Image
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 21 Jan 2026 10:13:45 +0000 (11:13 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 25 May 2026 08:28:14 +0000 (10:28 +0200)
The former is a bit of a misnomer, since there is absolutely no leeway.

gcc/ada/ChangeLog:

* exp_put_image.ads (Image_Should_Call_Put_Image): Rename into...
(Image_Must_Call_Put_Image): ...this.
* exp_put_image.adb (Image_Should_Call_Put_Image): Rename into...
(Image_Must_Call_Put_Image): ...this.
* exp_imgv.adb (Expand_Image_Attribute): Adjust to above renaming.
(Expand_Wide_Image_Attribute): Likewise.
(Expand_Wide_Wide_Image_Attribute): Likewise.
* sem_attr.adb (Eval_Attribute): Likewise.

gcc/ada/exp_imgv.adb
gcc/ada/exp_put_image.adb
gcc/ada/exp_put_image.ads
gcc/ada/sem_attr.adb

index 082acbe4d88a5a8c50380f762fb9c4ca94c514c2..1d7af928690daec9f83c9e6bd33e66b74371f21e 100644 (file)
@@ -1047,10 +1047,9 @@ package body Exp_Imgv is
          return;
       end if;
 
-      --  If Image should be transformed using Put_Image, then do so. See
-      --  Exp_Put_Image for details.
+      --  If Image must be turned into Put_Image, then do so
 
-      if Exp_Put_Image.Image_Should_Call_Put_Image (N) then
+      if Exp_Put_Image.Image_Must_Call_Put_Image (N) then
          Establish_Transient_Scope (N, Manage_Sec_Stack => True);
          Rewrite (N, Exp_Put_Image.Build_Image_Call (N));
          Analyze_And_Resolve (N, Standard_String, Suppress => All_Checks);
@@ -1860,10 +1859,9 @@ package body Exp_Imgv is
          return;
       end if;
 
-      --  If Image should be transformed using Put_Image, then do so. See
-      --  Exp_Put_Image for details.
+      --  If Image must be turned into Put_Image, then do so
 
-      if Exp_Put_Image.Image_Should_Call_Put_Image (N) then
+      if Exp_Put_Image.Image_Must_Call_Put_Image (N) then
          Establish_Transient_Scope (N, Manage_Sec_Stack => True);
          Rewrite (N, Exp_Put_Image.Build_Image_Call (N));
          Analyze_And_Resolve (N, Standard_Wide_String, Suppress => All_Checks);
@@ -1970,10 +1968,9 @@ package body Exp_Imgv is
          return;
       end if;
 
-      --  If Image should be transformed using Put_Image, then do so. See
-      --  Exp_Put_Image for details.
+      --  If Image must be turned into Put_Image, then do so
 
-      if Exp_Put_Image.Image_Should_Call_Put_Image (N) then
+      if Exp_Put_Image.Image_Must_Call_Put_Image (N) then
          Establish_Transient_Scope (N, Manage_Sec_Stack => True);
          Rewrite (N, Exp_Put_Image.Build_Image_Call (N));
          Analyze_And_Resolve
index 2853ffad38d60b6bc5245e2c4a1389a48ebb6522..0bc1a88737563678968fa6ee06d06b0809a934a5 100644 (file)
@@ -1240,11 +1240,11 @@ package body Exp_Put_Image is
       return Make_Defining_Identifier (Loc, Sname);
    end Make_Put_Image_Name;
 
-   ---------------------------------
-   -- Image_Should_Call_Put_Image --
-   ---------------------------------
+   -------------------------------
+   -- Image_Must_Call_Put_Image --
+   -------------------------------
 
-   function Image_Should_Call_Put_Image (N : Node_Id) return Boolean is
+   function Image_Must_Call_Put_Image (N : Node_Id) return Boolean is
    begin
       if Ada_Version < Ada_2022 then
          return False;
@@ -1282,7 +1282,7 @@ package body Exp_Put_Image is
 
          return False;
       end;
-   end Image_Should_Call_Put_Image;
+   end Image_Must_Call_Put_Image;
 
    ----------------------
    -- Build_Image_Call --
index 09a68b8426bcbd64822e8b01f2292635fa38d654..30703aa247c410a99f152bb6709f2beeb2aa17a4 100644 (file)
@@ -82,9 +82,9 @@ package Exp_Put_Image is
    function Build_Unknown_Put_Image_Call (N : Node_Id) return Node_Id;
    --  Build a call to Put_Image_Unknown
 
-   function Image_Should_Call_Put_Image (N : Node_Id) return Boolean;
-   --  True if T'Image should call T'Put_Image. N is the attribute_reference
-   --  T'Image.
+   function Image_Must_Call_Put_Image (N : Node_Id) return Boolean;
+   --  True if T'Image must be implemented by a call to T'Put_Image. N is the
+   --  attribute reference to T'Image.
 
    function Build_Image_Call (N : Node_Id) return Node_Id;
    --  N is a call to T'[[Wide_]Wide_]Image, and this translates it into the
index d9155c72323d861414b800e5928ae0bcae98230b..2dd502f21bc2e8befb15b6ce3220dba3956ae2b7 100644 (file)
@@ -8525,7 +8525,7 @@ package body Sem_Attr is
         and then Is_Enumeration_Type (Etype (P))
         and then not Is_Character_Type (Etype (P))
         and then Compile_Time_Known_Value (P)
-        and then not Image_Should_Call_Put_Image (N)
+        and then not Image_Must_Call_Put_Image (N)
       then
          Fold_Compile_Time_Known_Enumeration_Image (P);
          Set_Is_Static_Expression
@@ -9740,7 +9740,7 @@ package body Sem_Attr is
          if Is_Enumeration_Type (Etype (P))
            and then not Is_Character_Type (Etype (P))
            and then Compile_Time_Known_Value (E1)
-           and then not Image_Should_Call_Put_Image (N)
+           and then not Image_Must_Call_Put_Image (N)
          then
             Fold_Compile_Time_Known_Enumeration_Image (E1);
             Set_Is_Static_Expression (N, False);