diff options
author | Bob Duff <duff@adacore.com> | 2020-01-28 15:06:41 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-04 05:11:15 -0400 |
commit | 110d0820bfcb421b8c680409cf5c65aa2a0b4b8e (patch) | |
tree | b7f7f5be5a1a3d29e95cf08be19feded42995b7c /gcc/ada/tbuild.adb | |
parent | a3fbeceef46546fd47ed370474feed347c86713f (diff) | |
download | gcc-110d0820bfcb421b8c680409cf5c65aa2a0b4b8e.zip gcc-110d0820bfcb421b8c680409cf5c65aa2a0b4b8e.tar.gz gcc-110d0820bfcb421b8c680409cf5c65aa2a0b4b8e.tar.bz2 |
[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.
Diffstat (limited to 'gcc/ada/tbuild.adb')
-rw-r--r-- | gcc/ada/tbuild.adb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb index f71b0db..140cb21 100644 --- a/gcc/ada/tbuild.adb +++ b/gcc/ada/tbuild.adb @@ -365,6 +365,24 @@ package body Tbuild is End_Label => End_Label); end Make_Implicit_Loop_Statement; + -------------------- + -- Make_Increment -- + -------------------- + + function Make_Increment + (Loc : Source_Ptr; Index : Entity_Id; Typ : Entity_Id) return Node_Id is + begin + return Make_Assignment_Statement (Loc, + Name => New_Occurrence_Of (Index, Loc), + Expression => + Make_Attribute_Reference (Loc, + Prefix => + New_Occurrence_Of (Typ, Loc), + Attribute_Name => Name_Succ, + Expressions => New_List ( + New_Occurrence_Of (Index, Loc)))); + end Make_Increment; + -------------------------- -- Make_Integer_Literal -- --------------------------- |