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.
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);
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);
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
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;
return False;
end;
- end Image_Should_Call_Put_Image;
+ end Image_Must_Call_Put_Image;
----------------------
-- Build_Image_Call --
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
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
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);