Commit a2c1791d by Arnaud Charlet

[multiple changes]

2012-07-09  Robert Dewar  <dewar@adacore.com>

	* layout.adb, i-cstrea.ads, a-ststio.ads, prj-util.ads, sem_cat.adb,
	s-commun.ads, s-ficobl.ads, s-os_lib.ads, s-fileio.ads: Minor
	reformatting.

2012-07-09  Eric Botcazou  <ebotcazou@adacore.com>

	* raise-gcc.c: Update comments. Fix typo.

2012-07-09  Thomas Quinot  <quinot@adacore.com>

	* einfo.adb, einfo.ads, sem_attr.adb, sem_ch13.adb: Attribute
	Scalar_Storage_Order can be defined or queried for array types as well
	as record types.

From-SVN: r189376
parent a6f0cb16
2012-07-09 Robert Dewar <dewar@adacore.com>
* layout.adb, i-cstrea.ads, a-ststio.ads, prj-util.ads, sem_cat.adb,
s-commun.ads, s-ficobl.ads, s-os_lib.ads, s-fileio.ads: Minor
reformatting.
2012-07-09 Eric Botcazou <ebotcazou@adacore.com>
* raise-gcc.c: Update comments. Fix typo.
2012-07-09 Thomas Quinot <quinot@adacore.com>
* einfo.adb, einfo.ads, sem_attr.adb, sem_ch13.adb: Attribute
Scalar_Storage_Order can be defined or queried for array types as well
as record types.
2012-07-09 Tristan Gingold <gingold@adacore.com> 2012-07-09 Tristan Gingold <gingold@adacore.com>
* a-exexpr-gcc.adb (CleanupUnwind_Handler): Now imported from * a-exexpr-gcc.adb (CleanupUnwind_Handler): Now imported from
......
...@@ -37,7 +37,6 @@ with Ada.IO_Exceptions; ...@@ -37,7 +37,6 @@ with Ada.IO_Exceptions;
with System.File_Control_Block; with System.File_Control_Block;
package Ada.Streams.Stream_IO is package Ada.Streams.Stream_IO is
pragma Preelaborate; pragma Preelaborate;
type Stream_Access is access all Root_Stream_Type'Class; type Stream_Access is access all Root_Stream_Type'Class;
......
...@@ -2602,7 +2602,7 @@ package body Einfo is ...@@ -2602,7 +2602,7 @@ package body Einfo is
function Reverse_Storage_Order (Id : E) return B is function Reverse_Storage_Order (Id : E) return B is
begin begin
pragma Assert (Is_Record_Type (Id)); pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
return Flag93 (Base_Type (Id)); return Flag93 (Base_Type (Id));
end Reverse_Storage_Order; end Reverse_Storage_Order;
......
...@@ -3535,11 +3535,12 @@ package Einfo is ...@@ -3535,11 +3535,12 @@ package Einfo is
-- Ada 2005 AI-133), or must occupy an integral number of storage units. -- Ada 2005 AI-133), or must occupy an integral number of storage units.
-- Reverse_Storage_Order (Flag93) [base type only] -- Reverse_Storage_Order (Flag93) [base type only]
-- Present in all record type entities. Set if entity has a -- Present in all record and array type entities. Set if entity has a
-- Scalar_Storage_Order aspect (set by an aspect clause or attribute -- Scalar_Storage_Order aspect (set by an aspect clause or attribute
-- definition clause) that has reversed the order of storage elements -- definition clause) that has reversed the order of storage elements
-- from the default value. When this flag is set, the Bit_Order aspect -- from the default value. When this flag is set for a record type,
-- must be set to the same value. -- the Bit_Order aspect must be set to the same value (either explicitly
-- or as the target default value).
-- RM_Size (Uint13) -- RM_Size (Uint13)
-- Present in all type and subtype entities. Contains the value of -- Present in all type and subtype entities. Contains the value of
......
...@@ -229,7 +229,6 @@ package Interfaces.C_Streams is ...@@ -229,7 +229,6 @@ package Interfaces.C_Streams is
-- path name. Use max_path_len given below as the size of buffer. -- path name. Use max_path_len given below as the size of buffer.
max_path_len : constant Integer; max_path_len : constant Integer;
-- max_path_len : Integer;
-- Maximum length of an allowable full path name on the system,including a -- Maximum length of an allowable full path name on the system,including a
-- terminating NUL character. Declared as a constant to allow references -- terminating NUL character. Declared as a constant to allow references
-- from other preelaborated GNAT library packages. -- from other preelaborated GNAT library packages.
......
...@@ -3103,18 +3103,17 @@ package body Layout is ...@@ -3103,18 +3103,17 @@ package body Layout is
-- the type, or the maximum allowed alignment. -- the type, or the maximum allowed alignment.
declare declare
S : Int; S : Int;
A : Nat;
A : Nat;
Max_Alignment : Nat; Max_Alignment : Nat;
begin begin
-- The given esize may be larger that int'last because of a previous -- The given Esize may be larger that int'last because of a previous
-- error, and the call to UI_To_Int will fail, so use default. -- error, and the call to UI_To_Int will fail, so use default.
if Esize (E) / SSU > Ttypes.Maximum_Alignment then if Esize (E) / SSU > Ttypes.Maximum_Alignment then
S := Ttypes.Maximum_Alignment; S := Ttypes.Maximum_Alignment;
else else
S := UI_To_Int (Esize (E)) / SSU; S := UI_To_Int (Esize (E)) / SSU;
end if; end if;
......
...@@ -239,11 +239,11 @@ package Prj.Util is ...@@ -239,11 +239,11 @@ package Prj.Util is
(Tree : Project_Tree_Ref; (Tree : Project_Tree_Ref;
Project : Project_Id); Project : Project_Id);
-- Call Action for every sources that are needed to use Project. This is -- Call Action for every sources that are needed to use Project. This is
-- either the sources corresponding to the units in attribute Interfaces or -- either the sources corresponding to the units in attribute Interfaces
-- all sources of the project. Note that only the bodies that are needed -- or all sources of the project. Note that only the bodies that are
-- (because the unit is generic or contains some inline pragmas) are -- needed (because the unit is generic or contains some inline pragmas)
-- handled. This routine must be called only when the project has been -- are handled. This routine must be called only when the project has
-- built successfully. -- been built successfully.
private private
type Text_File_Data is record type Text_File_Data is record
......
...@@ -207,6 +207,10 @@ db_phases (int phases) ...@@ -207,6 +207,10 @@ db_phases (int phases)
* Tables for the dwarf zero cost case * * Tables for the dwarf zero cost case *
======================================= =======================================
They are fully documented in:
http://sourcery.mentor.com/public/cxx-abi/exceptions.pdf
Here is a shorter presentation, with some specific comments for Ada.
call_site [] call_site []
------------------------------------------------------------------- -------------------------------------------------------------------
* region-start | region-length | landing-pad | first-action-index * * region-start | region-length | landing-pad | first-action-index *
...@@ -244,20 +248,32 @@ db_phases (int phases) ...@@ -244,20 +248,32 @@ db_phases (int phases)
(see below), from which information may be retrieved to check if it (see below), from which information may be retrieved to check if it
matches the exception being propagated. matches the exception being propagated.
action-filter > 0 means there is a regular handler to be run, * action-filter > 0:
means there is a regular handler to be run The value is also passed
action-filter < 0 means there is a some "exception_specification" to the landing pad to dispatch the exception.
data to retrieve, which is only relevant for C++
and should never show up for Ada. * action-filter < 0:
means there is a some "exception_specification" data to retrieve,
next-action points to the next entry in the list using a relative byte which is only relevant for C++ and should never show up for Ada.
index. 0 indicates there is no other entry. (Exception specification specifies which exceptions can be thrown
by a function. Such filter is emitted around the body of C++
functions defined like:
void foo ([...]) throw (A, B) { [...] }
These can be viewed as negativ filter: the landing pad is branched
to for exceptions that doesn't match the filter and usually aborts
the program).
* next-action
points to the next entry in the list using a relative byte offset. 0
indicates there is no other entry.
ttypes [] ttypes []
--------------- ---------------
* ttype-value * * ttype-value *
--------------- ---------------
This table is an array of addresses.
A null value indicates a catch-all handler. (Not used by Ada) A null value indicates a catch-all handler. (Not used by Ada)
Non null values are used to match the exception being propagated: Non null values are used to match the exception being propagated:
...@@ -1151,10 +1167,11 @@ __gnat_cleanupunwind_handler (int version, ...@@ -1151,10 +1167,11 @@ __gnat_cleanupunwind_handler (int version,
{ {
/* Terminate when the end of the stack is reached. */ /* Terminate when the end of the stack is reached. */
if ((phases & _UA_END_OF_STACK) != 0 if ((phases & _UA_END_OF_STACK) != 0
#ifdef __ia64__ #if defined (__ia64__) && defined (USE_LIBUNWIND_EXCEPTIONS)
/* Strictely follow the ia64 ABI: when end of stack is reached, /* Strictely follow the ia64 ABI: when end of stack is reached,
the callback will be called with a NULL stack pointer. */ the callback will be called with a NULL stack pointer.
|| _Unwind_GetREG (context, 12) == 0 No need for that when using libgcc unwinder. */
|| _Unwind_GetGR (context, 12) == 0
#endif #endif
) )
__gnat_unhandled_except_handler (exception); __gnat_unhandled_except_handler (exception);
......
...@@ -35,7 +35,6 @@ with Ada.Streams; ...@@ -35,7 +35,6 @@ with Ada.Streams;
with System.CRTL; with System.CRTL;
package System.Communication is package System.Communication is
pragma Preelaborate; pragma Preelaborate;
function Last_Index function Last_Index
......
...@@ -40,7 +40,6 @@ with Interfaces.C_Streams; ...@@ -40,7 +40,6 @@ with Interfaces.C_Streams;
with System.CRTL; with System.CRTL;
package System.File_Control_Block is package System.File_Control_Block is
pragma Preelaborate; pragma Preelaborate;
---------------------------- ----------------------------
......
...@@ -37,7 +37,6 @@ with Interfaces.C_Streams; ...@@ -37,7 +37,6 @@ with Interfaces.C_Streams;
with System.File_Control_Block; with System.File_Control_Block;
package System.File_IO is package System.File_IO is
pragma Preelaborate; pragma Preelaborate;
package FCB renames System.File_Control_Block; package FCB renames System.File_Control_Block;
......
...@@ -55,7 +55,6 @@ with System.Strings; ...@@ -55,7 +55,6 @@ with System.Strings;
package System.OS_Lib is package System.OS_Lib is
pragma Elaborate_Body (OS_Lib); pragma Elaborate_Body (OS_Lib);
pragma Preelaborate; pragma Preelaborate;
----------------------- -----------------------
......
...@@ -4569,8 +4569,9 @@ package body Sem_Attr is ...@@ -4569,8 +4569,9 @@ package body Sem_Attr is
Check_E0; Check_E0;
Check_Type; Check_Type;
if not Is_Record_Type (P_Type) then if not Is_Record_Type (P_Type) or else Is_Array_Type (P_Type) then
Error_Attr_P ("prefix of % attribute must be record type"); Error_Attr_P
("prefix of % attribute must be record or array type");
end if; end if;
if Bytes_Big_Endian xor Reverse_Storage_Order (P_Type) then if Bytes_Big_Endian xor Reverse_Storage_Order (P_Type) then
......
...@@ -224,9 +224,10 @@ package body Sem_Cat is ...@@ -224,9 +224,10 @@ package body Sem_Cat is
-- AI05-0206. -- AI05-0206.
elsif (Unit_Category = Remote_Types elsif (Unit_Category = Remote_Types
or else Unit_Category = Remote_Call_Interface) or else
and then (Nkind (N) = N_With_Clause Unit_Category = Remote_Call_Interface)
and then Private_Present (N)) and then Nkind (N) = N_With_Clause
and then Private_Present (N)
and then Is_Preelaborated (Depended_Entity) and then Is_Preelaborated (Depended_Entity)
then then
null; null;
...@@ -271,7 +272,8 @@ package body Sem_Cat is ...@@ -271,7 +272,8 @@ package body Sem_Cat is
-- on a preelaborated unit with a normal with_clause. -- on a preelaborated unit with a normal with_clause.
elsif (Unit_Category = Remote_Types elsif (Unit_Category = Remote_Types
or else Unit_Category = Remote_Call_Interface) or else
Unit_Category = Remote_Call_Interface)
and then Is_Preelaborated (Depended_Entity) and then Is_Preelaborated (Depended_Entity)
then then
Error_Msg_NE Error_Msg_NE
......
...@@ -3312,10 +3312,10 @@ package body Sem_Ch13 is ...@@ -3312,10 +3312,10 @@ package body Sem_Ch13 is
when Attribute_Scalar_Storage_Order => Scalar_Storage_Order : declare when Attribute_Scalar_Storage_Order => Scalar_Storage_Order : declare
begin begin
if not Is_Record_Type (U_Ent) then if not (Is_Record_Type (U_Ent) or else Is_Array_Type (U_Ent)) then
Error_Msg_N Error_Msg_N
("Scalar_Storage_Order can only be defined for record type", ("Scalar_Storage_Order can only be defined for "
Nam); & "record or array type", Nam);
elsif Duplicate_Clause then elsif Duplicate_Clause then
null; null;
......
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