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>
* a-exexpr-gcc.adb (CleanupUnwind_Handler): Now imported from
......
......@@ -37,7 +37,6 @@ with Ada.IO_Exceptions;
with System.File_Control_Block;
package Ada.Streams.Stream_IO is
pragma Preelaborate;
type Stream_Access is access all Root_Stream_Type'Class;
......
......@@ -2602,7 +2602,7 @@ package body Einfo is
function Reverse_Storage_Order (Id : E) return B is
begin
pragma Assert (Is_Record_Type (Id));
pragma Assert (Is_Record_Type (Id) or else Is_Array_Type (Id));
return Flag93 (Base_Type (Id));
end Reverse_Storage_Order;
......
......@@ -3535,11 +3535,12 @@ package Einfo is
-- Ada 2005 AI-133), or must occupy an integral number of storage units.
-- 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
-- definition clause) that has reversed the order of storage elements
-- from the default value. When this flag is set, the Bit_Order aspect
-- must be set to the same value.
-- from the default value. When this flag is set for a record type,
-- the Bit_Order aspect must be set to the same value (either explicitly
-- or as the target default value).
-- RM_Size (Uint13)
-- Present in all type and subtype entities. Contains the value of
......
......@@ -229,7 +229,6 @@ package Interfaces.C_Streams is
-- path name. Use max_path_len given below as the size of buffer.
max_path_len : constant Integer;
-- max_path_len : Integer;
-- Maximum length of an allowable full path name on the system,including a
-- terminating NUL character. Declared as a constant to allow references
-- from other preelaborated GNAT library packages.
......
......@@ -3103,18 +3103,17 @@ package body Layout is
-- the type, or the maximum allowed alignment.
declare
S : Int;
S : Int;
A : Nat;
A : Nat;
Max_Alignment : Nat;
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.
if Esize (E) / SSU > Ttypes.Maximum_Alignment then
S := Ttypes.Maximum_Alignment;
else
S := UI_To_Int (Esize (E)) / SSU;
end if;
......
......@@ -239,11 +239,11 @@ package Prj.Util is
(Tree : Project_Tree_Ref;
Project : Project_Id);
-- Call Action for every sources that are needed to use Project. This is
-- either the sources corresponding to the units in attribute Interfaces or
-- all sources of the project. Note that only the bodies that are needed
-- (because the unit is generic or contains some inline pragmas) are
-- handled. This routine must be called only when the project has been
-- built successfully.
-- either the sources corresponding to the units in attribute Interfaces
-- or all sources of the project. Note that only the bodies that are
-- needed (because the unit is generic or contains some inline pragmas)
-- are handled. This routine must be called only when the project has
-- been built successfully.
private
type Text_File_Data is record
......
......@@ -207,6 +207,10 @@ db_phases (int phases)
* 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 []
-------------------------------------------------------------------
* region-start | region-length | landing-pad | first-action-index *
......@@ -244,20 +248,32 @@ db_phases (int phases)
(see below), from which information may be retrieved to check if it
matches the exception being propagated.
action-filter > 0 means there is a regular handler to be run,
action-filter < 0 means there is a some "exception_specification"
data to retrieve, which is only relevant for C++
and should never show up for Ada.
next-action points to the next entry in the list using a relative byte
index. 0 indicates there is no other entry.
* action-filter > 0:
means there is a regular handler to be run The value is also passed
to the landing pad to dispatch the exception.
* action-filter < 0:
means there is a some "exception_specification" data to retrieve,
which is only relevant for C++ and should never show up for Ada.
(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 []
---------------
* ttype-value *
---------------
This table is an array of addresses.
A null value indicates a catch-all handler. (Not used by Ada)
Non null values are used to match the exception being propagated:
......@@ -1151,10 +1167,11 @@ __gnat_cleanupunwind_handler (int version,
{
/* Terminate when the end of the stack is reached. */
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,
the callback will be called with a NULL stack pointer. */
|| _Unwind_GetREG (context, 12) == 0
the callback will be called with a NULL stack pointer.
No need for that when using libgcc unwinder. */
|| _Unwind_GetGR (context, 12) == 0
#endif
)
__gnat_unhandled_except_handler (exception);
......
......@@ -35,7 +35,6 @@ with Ada.Streams;
with System.CRTL;
package System.Communication is
pragma Preelaborate;
function Last_Index
......
......@@ -40,7 +40,6 @@ with Interfaces.C_Streams;
with System.CRTL;
package System.File_Control_Block is
pragma Preelaborate;
----------------------------
......
......@@ -37,7 +37,6 @@ with Interfaces.C_Streams;
with System.File_Control_Block;
package System.File_IO is
pragma Preelaborate;
package FCB renames System.File_Control_Block;
......
......@@ -55,7 +55,6 @@ with System.Strings;
package System.OS_Lib is
pragma Elaborate_Body (OS_Lib);
pragma Preelaborate;
-----------------------
......
......@@ -4569,8 +4569,9 @@ package body Sem_Attr is
Check_E0;
Check_Type;
if not Is_Record_Type (P_Type) then
Error_Attr_P ("prefix of % attribute must be record type");
if not Is_Record_Type (P_Type) or else Is_Array_Type (P_Type) then
Error_Attr_P
("prefix of % attribute must be record or array type");
end if;
if Bytes_Big_Endian xor Reverse_Storage_Order (P_Type) then
......
......@@ -224,9 +224,10 @@ package body Sem_Cat is
-- AI05-0206.
elsif (Unit_Category = Remote_Types
or else Unit_Category = Remote_Call_Interface)
and then (Nkind (N) = N_With_Clause
and then Private_Present (N))
or else
Unit_Category = Remote_Call_Interface)
and then Nkind (N) = N_With_Clause
and then Private_Present (N)
and then Is_Preelaborated (Depended_Entity)
then
null;
......@@ -271,7 +272,8 @@ package body Sem_Cat is
-- on a preelaborated unit with a normal with_clause.
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)
then
Error_Msg_NE
......
......@@ -3312,10 +3312,10 @@ package body Sem_Ch13 is
when Attribute_Scalar_Storage_Order => Scalar_Storage_Order : declare
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
("Scalar_Storage_Order can only be defined for record type",
Nam);
("Scalar_Storage_Order can only be defined for "
& "record or array type", Nam);
elsif Duplicate_Clause then
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