diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-14 15:53:02 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-14 15:53:02 +0200 |
commit | 161c5cc509e5e8abd70ec84848c43f51a9b1cbcb (patch) | |
tree | ef04c8f1c5d0d38bf962a2310fac94d96a929607 /gcc/ada/s-ststop.ads | |
parent | 2590ef129b3c7fa8dd899eed69e97b418411f40e (diff) | |
download | gcc-161c5cc509e5e8abd70ec84848c43f51a9b1cbcb.zip gcc-161c5cc509e5e8abd70ec84848c43f51a9b1cbcb.tar.gz gcc-161c5cc509e5e8abd70ec84848c43f51a9b1cbcb.tar.bz2 |
[multiple changes]
2013-10-14 Robert Dewar <dewar@adacore.com>
* exp_attr.adb (Find_Stream_Subprogram): Optimize
Storage_Array stream handling.
(Find_Stream_Subprogram): Optimize Stream_Element_Array stream handling
* rtsfind.ads: Add entry for Stream_Element_Array Add
entries for RE_Storage_Array subprograms Add entries for
RE_Stream_Element_Array subprograms
* s-ststop.ads, s-ststop.adb: Add processing for System.Storage_Array.
Add processing for Ada.Stream_Element_Array.
2013-10-14 Tristan Gingold <gingold@adacore.com>
* a-except-2005.ads, a-except-2005.adb:
(Get_Exception_Machine_Occurrence): New function.
* raise-gcc.c (__gnat_unwind_exception_size): New constant.
From-SVN: r203560
Diffstat (limited to 'gcc/ada/s-ststop.ads')
-rw-r--r-- | gcc/ada/s-ststop.ads | 94 |
1 files changed, 87 insertions, 7 deletions
diff --git a/gcc/ada/s-ststop.ads b/gcc/ada/s-ststop.ads index 0c7813f..a3fb3c6 100644 --- a/gcc/ada/s-ststop.ads +++ b/gcc/ada/s-ststop.ads @@ -33,9 +33,14 @@ -- the following types using a "block IO" approach in which the entire data -- item is written in one operation, instead of writing individual characters. +-- Ada.Stream_Element_Array -- Ada.String -- Ada.Wide_String -- Ada.Wide_Wide_String +-- System.Storage_Array + +-- Note: this routine is in Ada.Strings because historically it handled only +-- the string types. It is not worth moving it at this stage. -- The compiler will generate references to the subprograms in this package -- when expanding stream attributes for the above mentioned types. Example: @@ -48,21 +53,96 @@ -- or -- String_Output_Blk_IO (Some_Stream, Some_String); --- This expansion occurs only if System.Stream_Attributes.Block_IO_OK returns --- True, indicating that this approach is compatible with the expectations of --- System.Stream_Attributes. For the default implementation of this package, --- there is no difference between writing the elements one by one using the --- default output routine for the element type and writing the whole array --- using block IO. +-- String_Output form is used if pragma Restrictions (No_String_Optimziations) +-- is active, which requires element by element operations. The BLK_IO form +-- is used if this restriction is not set, allowing block optimization. --- In addition, +-- Note that if System.Stream_Attributes.Block_IO_OK is False, then the BLK_IO +-- form is treated as equivalent to the normal case, so that the optimization +-- is inhibited anyway, regardless of the setting of the restriction. This +-- handles versions of System.Stream_Attributes (in particular the XDR version +-- found in s-stratt-xdr) which do not permit block io optimization. pragma Compiler_Unit; with Ada.Streams; +with System.Storage_Elements; + package System.Strings.Stream_Ops is + ------------------------------------- + -- Storage_Array stream operations -- + ------------------------------------- + + function Storage_Array_Input + (Strm : access Ada.Streams.Root_Stream_Type'Class) + return System.Storage_Elements.Storage_Array; + + function Storage_Array_Input_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class) + return System.Storage_Elements.Storage_Array; + + procedure Storage_Array_Output + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : System.Storage_Elements.Storage_Array); + + procedure Storage_Array_Output_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : System.Storage_Elements.Storage_Array); + + procedure Storage_Array_Read + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : out System.Storage_Elements.Storage_Array); + + procedure Storage_Array_Read_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : out System.Storage_Elements.Storage_Array); + + procedure Storage_Array_Write + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : System.Storage_Elements.Storage_Array); + + procedure Storage_Array_Write_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : System.Storage_Elements.Storage_Array); + + -------------------------------------------- + -- Stream_Element_Array stream operations -- + -------------------------------------------- + + function Stream_Element_Array_Input + (Strm : access Ada.Streams.Root_Stream_Type'Class) + return Ada.Streams.Stream_Element_Array; + + function Stream_Element_Array_Input_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class) + return Ada.Streams.Stream_Element_Array; + + procedure Stream_Element_Array_Output + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : Ada.Streams.Stream_Element_Array); + + procedure Stream_Element_Array_Output_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : Ada.Streams.Stream_Element_Array); + + procedure Stream_Element_Array_Read + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : out Ada.Streams.Stream_Element_Array); + + procedure Stream_Element_Array_Read_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : out Ada.Streams.Stream_Element_Array); + + procedure Stream_Element_Array_Write + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : Ada.Streams.Stream_Element_Array); + + procedure Stream_Element_Array_Write_Blk_IO + (Strm : access Ada.Streams.Root_Stream_Type'Class; + Item : Ada.Streams.Stream_Element_Array); + ------------------------------ -- String stream operations -- ------------------------------ |