Commit 161c5cc5 by Arnaud Charlet

[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
parent 2590ef12
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.
2013-10-14 Robert Dewar <dewar@adacore.com>
* sem_res.adb: Minor fix to error message text.
* errout.ads, erroutc.ads: Minor reformatting.
* s-ststop.ads, s-stratt.ads: Clean up documentation of block IO
......
......@@ -861,6 +861,16 @@ package body Ada.Exceptions is
-- in case we do not want any exception tracing support. This is
-- why this package is separated.
--------------------------------------
-- Get_Exception_Machine_Occurrence --
--------------------------------------
function Get_Exception_Machine_Occurrence (X : Exception_Occurrence)
return System.Address is
begin
return X.Machine_Occurrence;
end Get_Exception_Machine_Occurrence;
-----------
-- Image --
-----------
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
......@@ -51,12 +51,8 @@ with System.Standard_Library;
with System.Traceback_Entries;
package Ada.Exceptions is
pragma Warnings (Off);
pragma Preelaborate_05;
pragma Warnings (On);
-- In accordance with Ada 2005 AI-362. The warnings pragmas are so that we
-- can compile this using older compiler versions, which will ignore the
-- pragma, which is fine for the bootstrap.
-- In accordance with Ada 2005 AI-362.
type Exception_Id is private;
pragma Preelaborable_Initialization (Exception_Id);
......@@ -337,6 +333,15 @@ private
-- this, and it would not work right, because of the Msg and Tracebacks
-- fields which have unused entries not copied by Save_Occurrence.
function Get_Exception_Machine_Occurrence (X : Exception_Occurrence)
return System.Address;
pragma Export (Ada, Get_Exception_Machine_Occurrence,
"__gnat_get_exception_machine_occurrence");
-- Get the machine occurrence corresponding to an exception occurrence.
-- It is Null_Address if there is no machine occurrence (in runtimes that
-- doesn't use GCC mechanism) or if it has been lost (Save_Occurrence
-- doesn't save the machine occurrence).
function EO_To_String (X : Exception_Occurrence) return String;
function String_To_EO (S : String) return Exception_Occurrence;
pragma Stream_Convert (Exception_Occurrence, String_To_EO, EO_To_String);
......
......@@ -1463,3 +1463,10 @@ __gnat_personality_seh0 (PEXCEPTION_RECORD ms_exc, void *this_frame,
ms_disp, __gnat_personality_imp);
}
#endif /* SEH */
#if !defined (__USING_SJLJ_EXCEPTIONS__)
/* Size of the _Unwind_Exception structure. This is used by g-cppexc to get
the offset to the C++ object. */
const int __gnat_unwind_exception_size = sizeof (_Unwind_Exception);
#endif
......@@ -591,6 +591,7 @@ package Rtsfind is
RE_Root_Stream_Type, -- Ada.Streams
RE_Stream_Element, -- Ada.Streams
RE_Stream_Element_Array, -- Ada.Streams
RE_Stream_Element_Offset, -- Ada.Streams
RE_Stream_Access, -- Ada.Streams.Stream_IO
......@@ -1477,6 +1478,24 @@ package Rtsfind is
RE_W_WC, -- System.Stream_Attributes
RE_W_WWC, -- System.Stream_Attributes
RE_Storage_Array_Input, -- System.Strings.Stream_Ops
RE_Storage_Array_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_Storage_Array_Output, -- System.Strings.Stream_Ops
RE_Storage_Array_Output_Blk_IO, -- System.Strings.Stream_Ops
RE_Storage_Array_Read, -- System.Strings.Stream_Ops
RE_Storage_Array_Read_Blk_IO, -- System.Strings.Stream_Ops
RE_Storage_Array_Write, -- System.Strings.Stream_Ops
RE_Storage_Array_Write_Blk_IO, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Input, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Output, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Output_Blk_IO, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Read, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Read_Blk_IO, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Write, -- System.Strings.Stream_Ops
RE_Stream_Element_Array_Write_Blk_IO, -- System.Strings.Stream_Ops
RE_String_Input, -- System.Strings.Stream_Ops
RE_String_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_String_Output, -- System.Strings.Stream_Ops
......@@ -1485,6 +1504,7 @@ package Rtsfind is
RE_String_Read_Blk_IO, -- System.Strings.Stream_Ops
RE_String_Write, -- System.Strings.Stream_Ops
RE_String_Write_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_String_Input, -- System.Strings.Stream_Ops
RE_Wide_String_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_String_Output, -- System.Strings.Stream_Ops
......@@ -1493,6 +1513,7 @@ package Rtsfind is
RE_Wide_String_Read_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_String_Write, -- System.Strings.Stream_Ops
RE_Wide_String_Write_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_Wide_String_Input, -- System.Strings.Stream_Ops
RE_Wide_Wide_String_Input_Blk_IO, -- System.Strings.Stream_Ops
RE_Wide_Wide_String_Output, -- System.Strings.Stream_Ops
......@@ -1844,6 +1865,7 @@ package Rtsfind is
RE_Root_Stream_Type => Ada_Streams,
RE_Stream_Element => Ada_Streams,
RE_Stream_Element_Array => Ada_Streams,
RE_Stream_Element_Offset => Ada_Streams,
RE_Stream_Access => Ada_Streams_Stream_IO,
......@@ -2734,6 +2756,24 @@ package Rtsfind is
RE_W_WC => System_Stream_Attributes,
RE_W_WWC => System_Stream_Attributes,
RE_Storage_Array_Input => System_Strings_Stream_Ops,
RE_Storage_Array_Input_Blk_IO => System_Strings_Stream_Ops,
RE_Storage_Array_Output => System_Strings_Stream_Ops,
RE_Storage_Array_Output_Blk_IO => System_Strings_Stream_Ops,
RE_Storage_Array_Read => System_Strings_Stream_Ops,
RE_Storage_Array_Read_Blk_IO => System_Strings_Stream_Ops,
RE_Storage_Array_Write => System_Strings_Stream_Ops,
RE_Storage_Array_Write_Blk_IO => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Input => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Input_Blk_IO => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Output => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Output_Blk_IO => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Read => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Read_Blk_IO => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Write => System_Strings_Stream_Ops,
RE_Stream_Element_Array_Write_Blk_IO => System_Strings_Stream_Ops,
RE_String_Input => System_Strings_Stream_Ops,
RE_String_Input_Blk_IO => System_Strings_Stream_Ops,
RE_String_Output => System_Strings_Stream_Ops,
......@@ -2742,6 +2782,7 @@ package Rtsfind is
RE_String_Read_Blk_IO => System_Strings_Stream_Ops,
RE_String_Write => System_Strings_Stream_Ops,
RE_String_Write_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_String_Input => System_Strings_Stream_Ops,
RE_Wide_String_Input_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_String_Output => System_Strings_Stream_Ops,
......@@ -2749,6 +2790,7 @@ package Rtsfind is
RE_Wide_String_Read => System_Strings_Stream_Ops,
RE_Wide_String_Read_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_String_Write => System_Strings_Stream_Ops,
RE_Wide_String_Write_Blk_IO => System_Strings_Stream_Ops,
RE_Wide_Wide_String_Input => System_Strings_Stream_Ops,
RE_Wide_Wide_String_Input_Blk_IO => System_Strings_Stream_Ops,
......
......@@ -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 --
------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment