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/scng.adb | |
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/scng.adb')
-rw-r--r-- | gcc/ada/scng.adb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index 46d1f8e..fd3dacc 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -2568,6 +2568,12 @@ package body Scng is Accumulate_Token_Checksum; Token := Token_Type'Val (Get_Name_Table_Byte (Token_Name)); + -- See Exp_Put_Image for documentation of Tagged_Seen + + if Token = Tok_Tagged then + Tagged_Seen := True; + end if; + -- Keyword style checks if Style_Check then |