[Ada] Put_Image: preload type Sink, change what types have it enabled
authorBob Duff <duff@adacore.com>
Mon, 23 Mar 2020 16:40:45 +0000 (12:40 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 12 Jun 2020 08:29:19 +0000 (04:29 -0400)
commit05f799de948ca5a5e51a2cc7a406cc93bea91735
treea71bddb19cac1d4f2ffb4fe56f37f2aab717c8db
parent052d6488478db2b3c55d165aac653dc63582e38b
[Ada] Put_Image: preload type Sink, change what types have it enabled

2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

* exp_put_image.ads, exp_put_image.adb (Preload_Sink): Procedure
for preloading type Sink.  This has the side effect of loading
various dependents, including Ada.Strings.UTF_Encoding.
(Enable_Put_Image): Disable Put_Image in pre-2020 versions of
Ada.  This limitation can probably be lifted later.  Enable for
tagged types except in predefined units.  Disable for CPP types;
Put_Image is legal, just prints the type name.
* sem_attr.adb (Check_Put_Image_Attribute): Don't complain about
Put_Image of CPP types; instead call the "unknown" version of
Put_Image.
* sem_ch10.adb (Analyze_Compilation_Unit): Call Preload_Sink.
gcc/ada/exp_put_image.adb
gcc/ada/exp_put_image.ads
gcc/ada/sem_attr.adb
gcc/ada/sem_ch10.adb