[Ada] Put_Image attribute
authorBob Duff <duff@adacore.com>
Tue, 28 Jan 2020 20:06:41 +0000 (15:06 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 4 Jun 2020 09:11:15 +0000 (05:11 -0400)
commit110d0820bfcb421b8c680409cf5c65aa2a0b4b8e
treeb7f7f5be5a1a3d29e95cf08be19feded42995b7c
parenta3fbeceef46546fd47ed370474feed347c86713f
[Ada] Put_Image attribute

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

gcc/ada/

* libgnat/a-stobbu.adb, libgnat/a-stobbu.ads,
libgnat/a-stobfi.adb, libgnat/a-stobfi.ads,
libgnat/a-stoubu.adb, libgnat/a-stoubu.ads,
libgnat/a-stoufi.adb, libgnat/a-stoufi.ads,
libgnat/a-stoufo.adb, libgnat/a-stoufo.ads,
libgnat/a-stouut.adb, libgnat/a-stouut.ads,
libgnat/a-stteou.ads, libgnat/s-putaim.adb,
libgnat/s-putaim.ads, libgnat/s-putima.adb, libgnat/s-putima.ads
(Ada.Strings.Text_Output and children, System.Put_Images): New
runtime support for Put_Image.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add
exp_put_image.o.
* exp_put_image.adb, exp_put_image.ads: New compiler package
that generates calls to runtime routines that implement
Put_Image.
* Makefile.rtl: Add object files for Ada.Strings.Text_Output and
children and System.Put_Images.
* aspects.adb: Simplify initialization of Canonical_Aspect.
* aspects.ads: Improve documentation. Add Aspect_Put_Image.
* exp_attr.adb: Add support for Put_Image, by calling routines
in Exp_Put_Image.
* sem_util.adb (Is_Predefined_Dispatching_Operation): Return
True for new TSS_Put_Image operation.
* exp_ch3.adb: For tagged types, build a dispatching
TSS_Put_Image operation by calling routines in Exp_Put_Image.
* exp_disp.adb, exp_disp.ads: Make TSS_Put_Image be number 10,
adjusting other operations' numbers after 10. We choose 10
because that's the last number shared by all runtimes.
* exp_strm.adb: Use named notation as appropriate.
* exp_cg.adb, exp_tss.ads: Add TSS_Put_Image.
* libgnat/a-tags.ads: Modify Max_Predef_Prims for the new
TSS_Put_Image.
* impunit.adb: Add new runtime packages.
* rtsfind.adb, rtsfind.ads: Add support for
Ada.Strings.Text_Output, Ada.Strings.Text_Output.Utils, and
System.Put_Images.
* sem_attr.adb: Error checking for Put_Image calls.
* sem_ch12.adb (Valid_Default_Attribute): Support for passing
Put_Image as a generic formal parameter.
* sem_ch13.adb: Analysis of Put_Image aspect. Turn it into a
Put_Image attribute definition clause.
* sem_ch8.adb (Analyze_Subprogram_Renaming): Support for
renaming of the Put_Image attribute.
* snames.adb-tmpl: Fix comments.
* snames.ads-tmpl (Name_Put_Image): New Name_Id.
(Attribute_Put_Image): New Attribute_Id.
* tbuild.adb, tbuild.ads (Make_Increment): New utility.
43 files changed:
gcc/ada/Makefile.rtl
gcc/ada/aspects.adb
gcc/ada/aspects.ads
gcc/ada/exp_attr.adb
gcc/ada/exp_cg.adb
gcc/ada/exp_ch3.adb
gcc/ada/exp_disp.adb
gcc/ada/exp_disp.ads
gcc/ada/exp_put_image.adb [new file with mode: 0644]
gcc/ada/exp_put_image.ads [new file with mode: 0644]
gcc/ada/exp_strm.adb
gcc/ada/exp_tss.ads
gcc/ada/gcc-interface/Make-lang.in
gcc/ada/impunit.adb
gcc/ada/libgnat/a-stobbu.adb [new file with mode: 0644]
gcc/ada/libgnat/a-stobbu.ads [new file with mode: 0644]
gcc/ada/libgnat/a-stobfi.adb [new file with mode: 0644]
gcc/ada/libgnat/a-stobfi.ads [new file with mode: 0644]
gcc/ada/libgnat/a-stoubu.adb [new file with mode: 0644]
gcc/ada/libgnat/a-stoubu.ads [new file with mode: 0644]
gcc/ada/libgnat/a-stoufi.adb [new file with mode: 0644]
gcc/ada/libgnat/a-stoufi.ads [new file with mode: 0644]
gcc/ada/libgnat/a-stoufo.adb [new file with mode: 0644]
gcc/ada/libgnat/a-stoufo.ads [new file with mode: 0644]
gcc/ada/libgnat/a-stouut.adb [new file with mode: 0644]
gcc/ada/libgnat/a-stouut.ads [new file with mode: 0644]
gcc/ada/libgnat/a-stteou.ads [new file with mode: 0644]
gcc/ada/libgnat/a-tags.ads
gcc/ada/libgnat/s-putaim.adb [new file with mode: 0644]
gcc/ada/libgnat/s-putaim.ads [new file with mode: 0644]
gcc/ada/libgnat/s-putima.adb [new file with mode: 0644]
gcc/ada/libgnat/s-putima.ads [new file with mode: 0644]
gcc/ada/rtsfind.adb
gcc/ada/rtsfind.ads
gcc/ada/sem_attr.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch8.adb
gcc/ada/sem_util.adb
gcc/ada/snames.adb-tmpl
gcc/ada/snames.ads-tmpl
gcc/ada/tbuild.adb
gcc/ada/tbuild.ads