aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_put_image.ads
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2021-03-29 17:09:31 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-21 06:45:17 -0400
commit20922782976048592eb9240ad2ab8690b207dc24 (patch)
tree748250705a37e2de4446058ca5a8e2bf0cf2c5d4 /gcc/ada/exp_put_image.ads
parent88bed4e088a197e89051b520da8bb3631a10f9c0 (diff)
downloadgcc-20922782976048592eb9240ad2ab8690b207dc24.zip
gcc-20922782976048592eb9240ad2ab8690b207dc24.tar.gz
gcc-20922782976048592eb9240ad2ab8690b207dc24.tar.bz2
[Ada] Add Ada.Strings.Text_Buffers and replace uses of Ada.Strings.Text_Output
gcc/ada/ * Make-generated.in (GEN_IL_FLAGS): Keep only GNAT flags. (ada/stamp-gen_il): Remove dependencies on libgnat/ sources. Do not copy libgnat/ sources locally and tidy up. * Makefile.rtl: Include object files for new Text_Buffer units in the GNATRTL_NONTASKING_OBJS list. * exp_put_image.ads, exp_put_image.adb: Update Rtsfind calls to match new specs. For example, calls to RE_Sink are replaced with calls to RE_Root_Buffer_Type. Update comments and change subprogram names accordingly (e.g., Preload_Sink is changed to Preload_Root_Buffer_Type). * impunit.adb: Add 6 new predefined units (Text_Buffers and 5 child units thereof). * rtsfind.ads, rtsfind.adb: Add interfaces for accessing the Ada.Strings.Text_Buffers package and declarations therein (including the Unbounded child unit). Do not (yet) delete interfaces for accessing the old Text_Output package. * sem_attr.adb (Check_Put_Image_Attribute): Replace RE_Sink uses with RE_Root_Buffer_Type and update comments accordingly. * sem_ch10.adb (Analyze_Compilation_Unit): Update call to reflect name change of callee (that is, the former Preload_Sink is now Preload_Root_Buffer_Type). * sem_ch13.adb (Has_Good_Profile): Replace RE_Sink use with RE_Root_Buffer_Type. (Build_Spec): Update comment describing a parameter type. * gen_il.ads: Remove clauses for the old Text_Output package and add them for Ada.Streams.Stream_IO. (Sink): Declare. (Create_File): Likewise. (Increase_Indent): Likewise. (Decrease_Indent): Likewise. (Put): Likewise. (LF): Likewise. * gen_il.adb: Add clauses for Ada.Streams.Stream_IO. (Create_File): New procedure. (Increase_Indent): Likewise. (Decrease_Indent): Likewise. (Put): New procedures. * gen_il-gen.adb: Add clauses for Ada.Text_IO. Replace Sink'Class with Sink throughout. Use string concatenation and LF marker instead of formatted strings and "\n" marker. Update Indent/Outdent calls to use new Increase_Indent/Decrease_Indent names. (Put_Membership_Query_Decl): Remove. * gen_il-internals.ads: Replace Sink'Class with Sink throughout. (Ptypes): Remove. (Pfields): Likewise. * gen_il-internals.adb: Remove clauses for GNAT.OS_Lib and Ada.Strings.Text_Buffers.Files. Replace Sink'Class with Sink throughout. Use string concatenation and LF marker instead of formatted strings and "\n" marker. (Stdout): Remove. (Ptypes): Likewise. (Pfields): Likewise. * libgnarl/s-putaim.ads: Modify context clause, update declaration of subtype Sink to refer to Text_Buffers.Root_Buffer_Type instead of the old Text_Output.Sink type. * libgnarl/s-putaim.adb: Modify context clause and add use clause to refer to Text_Buffers package. * libgnat/a-cbdlli.ads, libgnat/a-cbdlli.adb, libgnat/a-cbhama.ads, libgnat/a-cbhama.adb, libgnat/a-cbhase.ads, libgnat/a-cbhase.adb, libgnat/a-cbmutr.ads, libgnat/a-cbmutr.adb, libgnat/a-cborma.ads, libgnat/a-cborma.adb, libgnat/a-cborse.ads, libgnat/a-cborse.adb, libgnat/a-cdlili.ads, libgnat/a-cdlili.adb, libgnat/a-cidlli.ads, libgnat/a-cidlli.adb, libgnat/a-cihama.ads, libgnat/a-cihama.adb, libgnat/a-cihase.ads, libgnat/a-cihase.adb, libgnat/a-cimutr.ads, libgnat/a-cimutr.adb, libgnat/a-ciorma.ads, libgnat/a-ciorma.adb, libgnat/a-ciormu.ads, libgnat/a-ciormu.adb, libgnat/a-ciorse.ads, libgnat/a-ciorse.adb, libgnat/a-coboho.ads, libgnat/a-coboho.adb, libgnat/a-cobove.ads, libgnat/a-cobove.adb, libgnat/a-cohama.ads, libgnat/a-cohama.adb, libgnat/a-cohase.ads, libgnat/a-cohase.adb, libgnat/a-coinho.ads, libgnat/a-coinho.adb, libgnat/a-coinho__shared.ads, libgnat/a-coinho__shared.adb, libgnat/a-coinve.ads, libgnat/a-coinve.adb, libgnat/a-comutr.ads, libgnat/a-comutr.adb, libgnat/a-convec.ads, libgnat/a-convec.adb, libgnat/a-coorma.ads, libgnat/a-coorma.adb, libgnat/a-coormu.ads, libgnat/a-coormu.adb, libgnat/a-coorse.ads, libgnat/a-coorse.adb, libgnat/a-nbnbin.ads, libgnat/a-nbnbin.adb, libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.ads, libgnat/a-nbnbre.adb, libgnat/a-strunb.ads, libgnat/a-strunb.adb, libgnat/a-strunb__shared.ads, libgnat/a-strunb__shared.adb, libgnat/s-rannum.ads, libgnat/s-rannum.adb: Modify Put_Image procedure used in Put_Image aspect specification to conform to Ada profile rules (in particular, the first parameter shall be of type Ada.Strings.Text_Buffers.Root_Buffer_Type'Class). * libgnat/a-sttebu.ads, libgnat/a-sttebu.adb, libgnat/a-stbubo.ads, libgnat/a-stbubo.adb, libgnat/a-stbufi.ads, libgnat/a-stbufi.adb, libgnat/a-stbufo.ads, libgnat/a-stbufo.adb, libgnat/a-stbuun.ads, libgnat/a-stbuun.adb, libgnat/a-stbuut.ads, libgnat/a-stbuut.adb: A new predefined unit, Ada.Strings.Text_Buffers, and five child units. Two of the five are RM-defined: Bounded and Unbounded. The remaining three are GNAT-defined: Files, Utils, and Formatting. The buffer type corresponding to an output file, type Files.File_Buffer, is simpler (and perhaps therefore slower) than its predecessor. Caching similar to what was being done before could be added later if that seems appropriate. * libgnat/s-putima.ads: Modify context clause, update declaration of subtype Sink to refer to Text_Buffers.Root_Buffer_Type instead of the old Text_Output.Sink type. * libgnat/s-putima.adb: Modify context clause. Update Indent/Outdent calls to use new Increase_Indent/Decrease_Indent names; ditto for "Put_String => Put" name change. * libgnat/a-stteou__bootstrap.ads: Delete.
Diffstat (limited to 'gcc/ada/exp_put_image.ads')
-rw-r--r--gcc/ada/exp_put_image.ads13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/ada/exp_put_image.ads b/gcc/ada/exp_put_image.ads
index 7ef8eef..4f049f1 100644
--- a/gcc/ada/exp_put_image.ads
+++ b/gcc/ada/exp_put_image.ads
@@ -27,8 +27,9 @@ with Types; use Types;
package Exp_Put_Image is
- -- Routines to build Put_Image calls. See Ada.Strings.Text_Output.Utils and
- -- System.Put_Images for the run-time routines we are generating calls to.
+ -- Routines to build Put_Image calls. See Ada.Strings.Text_Buffers.Utils
+ -- and System.Put_Images for the run-time routines we are generating calls
+ -- to.
-- For a call to T'Put_Image, if T is elementary, we expand the code
-- inline. If T is a tagged type, then Put_Image is a primitive procedure
@@ -94,10 +95,10 @@ package Exp_Put_Image is
-- 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
- -- compilation, because otherwise it happens during freezing, which
+ procedure Preload_Root_Buffer_Type (Compilation_Unit : Node_Id);
+ -- Call RTE (RE_Root_Buffer_Type) if necessary, to load the packages
+ -- involved in Put_Image. We need to do this explicitly, fairly early
+ -- during compilation, because otherwise it happens during freezing, which
-- triggers visibility bugs in generic instantiations.
end Exp_Put_Image;