diff options
author | Bob Duff <duff@adacore.com> | 2020-03-31 18:59:11 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-15 04:04:38 -0400 |
commit | acc20d256c51f394904b904e8a8ceea3a44855fc (patch) | |
tree | b11a3f53620fa45fafdb068a26d75ac2412a3f66 /gcc/ada/exp_put_image.ads | |
parent | 2b20de3abdb894c847d2741f35910d584c8f699a (diff) | |
download | gcc-acc20d256c51f394904b904e8a8ceea3a44855fc.zip gcc-acc20d256c51f394904b904e8a8ceea3a44855fc.tar.gz gcc-acc20d256c51f394904b904e8a8ceea3a44855fc.tar.bz2 |
[Ada] T'Image calls T'Put_Image
2020-06-15 Bob Duff <duff@adacore.com>
gcc/ada/
* exp_put_image.ads, exp_put_image.adb
(Image_Should_Call_Put_Image): New function to determine whether
the call to Put_Image should be generated.
(Build_Image_Call): New procedure to generate the call to
Put_Image.
* exp_imgv.adb (Expand_Image_Attribute): Use underlying types to
bypass privacy (only in Ada 2020). If
Image_Should_Call_Put_Image is True (which happens only in Ada
2020), then call Build_Image_Call.
* rtsfind.ads, rtsfind.adb: Add the necessary declarations in
Ada.Strings.Text_Output.Buffers.
* sem_attr.adb (Check_Image_Type): Enable the Ada 2020 case.
* libgnat/a-stoufo.ads, libgnat/a-stoufo.adb: Use the less
restrictive type that allows newline characters.
Diffstat (limited to 'gcc/ada/exp_put_image.ads')
-rw-r--r-- | gcc/ada/exp_put_image.ads | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/exp_put_image.ads b/gcc/ada/exp_put_image.ads index 3ee8f8b..00b3371 100644 --- a/gcc/ada/exp_put_image.ads +++ b/gcc/ada/exp_put_image.ads @@ -85,6 +85,15 @@ 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 Build_Image_Call (N : Node_Id) return Node_Id; + -- N is a call to T'Image, and this translates it into the appropriate code + -- to call T'Put_Image into a buffer and then extract the string from the + -- buffer. + procedure Preload_Sink (Compilation_Unit : Node_Id); -- Call RTE (RE_Sink) if necessary, to load the packages involved in -- Put_Image. We need to do this explicitly, fairly early during |