diff options
author | Bob Duff <duff@adacore.com> | 2020-03-27 08:26:19 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-12 04:29:32 -0400 |
commit | a3483a77e5dd55112bd97543c8dd00275c16b345 (patch) | |
tree | 4c3dd338f369a87fd909486c61f5965a6f986dc3 /gcc/ada/exp_put_image.ads | |
parent | 3961bedab9b39baa27cd7844ec4a1be5db348a11 (diff) | |
download | gcc-a3483a77e5dd55112bd97543c8dd00275c16b345.zip gcc-a3483a77e5dd55112bd97543c8dd00275c16b345.tar.gz gcc-a3483a77e5dd55112bd97543c8dd00275c16b345.tar.bz2 |
[Ada] Enable Put_Image in pre-Ada-2020 modes
2020-06-12 Bob Duff <duff@adacore.com>
gcc/ada/
* exp_attr.adb (Put_Image): Remove assertion. This assertion is
False in mixed-Ada-version programs.
* exp_put_image.adb (Tagged_Put_Image_Enabled): New flag to make
it easy to experiment with Put_Image on tagged types. False in
this version.
(Enable_Put_Image): Enable in pre-2020. Workarounds: Disable
for tagged types if Tagged_Put_Image_Enabled is False. Disable
for access-to-subprogram types. Disable if errors have been
detected, or Sink is unavailable.
(Preload_Sink): Move all conditionals here, from Sem_Ch10, so
they can be nearby related code in Enable_Put_Image. Load Sink
only if we have seen a tagged type. This removes the dilemma
about calling Preload_Sink when compiling the compiler, which
caused unwanted dependences.
* exp_put_image.ads (Preload_Sink): New formal Compilation_Unit,
needed to move all conditionals here, from Sem_Ch10.
* libgnat/a-stouut.adb (Put_UTF_8): Make this suitable for
inlining, so we don't get warnings about inlining in some tests.
And so it can be inlined!
* opt.ads (Tagged_Seen): New flag (see Preload_Sink).
* scng.adb (Scan): Set new Tagged_Seen flag.
* sem_ch10.adb (Analyze_Compilation_Unit): Move conditionals and
comments regarding Preload_Sink into Preload_Sink.
Diffstat (limited to 'gcc/ada/exp_put_image.ads')
-rw-r--r-- | gcc/ada/exp_put_image.ads | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/ada/exp_put_image.ads b/gcc/ada/exp_put_image.ads index 6b5f6b0..3ee8f8b 100644 --- a/gcc/ada/exp_put_image.ads +++ b/gcc/ada/exp_put_image.ads @@ -85,10 +85,10 @@ package Exp_Put_Image is function Build_Unknown_Put_Image_Call (N : Node_Id) return Node_Id; -- Build a call to Put_Image_Unknown - procedure Preload_Sink; - -- Call RTE (RE_Sink), 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. + 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 + -- triggers visibility bugs in generic instantiations. end Exp_Put_Image; |