+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
with System.File_Control_Block;
package Ada.Streams.Stream_IO is
-
pragma Preelaborate;
type Stream_Access is access all Root_Stream_Type'Class;
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;
-- 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
-- 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.
-- 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;
(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
* 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 *
(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:
{
/* 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);
with System.CRTL;
package System.Communication is
-
pragma Preelaborate;
function Last_Index
with System.CRTL;
package System.File_Control_Block is
-
pragma Preelaborate;
----------------------------
with System.File_Control_Block;
package System.File_IO is
-
pragma Preelaborate;
package FCB renames System.File_Control_Block;
package System.OS_Lib is
pragma Elaborate_Body (OS_Lib);
-
pragma Preelaborate;
-----------------------
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
-- 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;
-- 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
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;