From a2c1791d894d8d421bda4344219bc971ec7faa30 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 9 Jul 2012 15:09:52 +0200 Subject: [multiple changes] 2012-07-09 Robert Dewar * 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 * raise-gcc.c: Update comments. Fix typo. 2012-07-09 Thomas Quinot * 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 --- gcc/ada/ChangeLog | 16 ++++++++++++++++ gcc/ada/a-ststio.ads | 1 - gcc/ada/einfo.adb | 2 +- gcc/ada/einfo.ads | 7 ++++--- gcc/ada/i-cstrea.ads | 1 - gcc/ada/layout.adb | 7 +++---- gcc/ada/prj-util.ads | 10 +++++----- gcc/ada/raise-gcc.c | 39 ++++++++++++++++++++++++++++----------- gcc/ada/s-commun.ads | 1 - gcc/ada/s-ficobl.ads | 1 - gcc/ada/s-fileio.ads | 1 - gcc/ada/s-os_lib.ads | 1 - gcc/ada/sem_attr.adb | 5 +++-- gcc/ada/sem_cat.adb | 10 ++++++---- gcc/ada/sem_ch13.adb | 6 +++--- 15 files changed, 69 insertions(+), 39 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 71e65316..30bd972 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2012-07-09 Robert Dewar + + * 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 + + * raise-gcc.c: Update comments. Fix typo. + +2012-07-09 Thomas Quinot + + * 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 * a-exexpr-gcc.adb (CleanupUnwind_Handler): Now imported from diff --git a/gcc/ada/a-ststio.ads b/gcc/ada/a-ststio.ads index 35891b6..4049163 100644 --- a/gcc/ada/a-ststio.ads +++ b/gcc/ada/a-ststio.ads @@ -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; diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index d5fad3e..d2af1cf 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -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; diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 0f8250a..e3a5c56 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -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 diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads index da29765..37d8ab7 100644 --- a/gcc/ada/i-cstrea.ads +++ b/gcc/ada/i-cstrea.ads @@ -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. diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb index c026dfe..7696e59 100644 --- a/gcc/ada/layout.adb +++ b/gcc/ada/layout.adb @@ -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; diff --git a/gcc/ada/prj-util.ads b/gcc/ada/prj-util.ads index 661ab2d..892db28 100644 --- a/gcc/ada/prj-util.ads +++ b/gcc/ada/prj-util.ads @@ -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 diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index b0f83a9..bc79c5d 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -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); diff --git a/gcc/ada/s-commun.ads b/gcc/ada/s-commun.ads index 139a83b..1255efd 100644 --- a/gcc/ada/s-commun.ads +++ b/gcc/ada/s-commun.ads @@ -35,7 +35,6 @@ with Ada.Streams; with System.CRTL; package System.Communication is - pragma Preelaborate; function Last_Index diff --git a/gcc/ada/s-ficobl.ads b/gcc/ada/s-ficobl.ads index ae48ffc..cd3d0cb 100644 --- a/gcc/ada/s-ficobl.ads +++ b/gcc/ada/s-ficobl.ads @@ -40,7 +40,6 @@ with Interfaces.C_Streams; with System.CRTL; package System.File_Control_Block is - pragma Preelaborate; ---------------------------- diff --git a/gcc/ada/s-fileio.ads b/gcc/ada/s-fileio.ads index d0ecaa9..f084d8d 100644 --- a/gcc/ada/s-fileio.ads +++ b/gcc/ada/s-fileio.ads @@ -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; diff --git a/gcc/ada/s-os_lib.ads b/gcc/ada/s-os_lib.ads index df8ad9b..dbe3315 100644 --- a/gcc/ada/s-os_lib.ads +++ b/gcc/ada/s-os_lib.ads @@ -55,7 +55,6 @@ with System.Strings; package System.OS_Lib is pragma Elaborate_Body (OS_Lib); - pragma Preelaborate; ----------------------- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index abb0344..efb6037f 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -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 diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb index e5d4dfb..4d8b8ff 100644 --- a/gcc/ada/sem_cat.adb +++ b/gcc/ada/sem_cat.adb @@ -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 diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 80b1ab17..3b5b203 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -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; -- cgit v1.1