[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 9 Jul 2012 13:09:52 +0000 (15:09 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 9 Jul 2012 13:09:52 +0000 (15:09 +0200)
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

15 files changed:
gcc/ada/ChangeLog
gcc/ada/a-ststio.ads
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/i-cstrea.ads
gcc/ada/layout.adb
gcc/ada/prj-util.ads
gcc/ada/raise-gcc.c
gcc/ada/s-commun.ads
gcc/ada/s-ficobl.ads
gcc/ada/s-fileio.ads
gcc/ada/s-os_lib.ads
gcc/ada/sem_attr.adb
gcc/ada/sem_cat.adb
gcc/ada/sem_ch13.adb

index 71e653167dbfaebcd48fde773ff0454d8d074ffb..30bd9724e22fd3d78cd68f3056e2e0ab7c01b568 100644 (file)
@@ -1,3 +1,19 @@
+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
index 35891b67035c264c17e2e223ee603fb7d7355dec..4049163fa8f62d81dc3f3e5f96e96b763997f73f 100644 (file)
@@ -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;
index d5fad3ecf548c4dd45dcf992f77231e63052484a..d2af1cf73f4283dcee2877a0f0e3d7f86671c189 100644 (file)
@@ -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;
 
index 0f8250ac7ab5bb097d9e3c66cf8a95aab8f863b0..e3a5c5615bcca23e2faa46b9f3f35c5a9b4e62cb 100644 (file)
@@ -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
index da29765abb51fc53320bbc5dbfc5d3914ced192e..37d8ab733db2681e8976801188e5afc4c19c1071 100644 (file)
@@ -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.
index c026dfeac490cdb4a58c488330a1a93d6f154637..7696e5937c0f8b1c948669957806f41314c96c4a 100644 (file)
@@ -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;
index 661ab2d4ccf2feb4a686370d8d02617c0ee0011a..892db282a57aba3f6985d3a2012befdb689f52e8 100644 (file)
@@ -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
index b0f83a9bde59de5791788956f9fcf610dc271251..bc79c5d82a1b462433a5492b6de9ebcc6ae38cd6 100644 (file)
@@ -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);
index 139a83be6df49a3f4a6a0a1c3507e81cccbd3308..1255efd6b7d7b931bbce7e89e8121e9fe05ee8fb 100644 (file)
@@ -35,7 +35,6 @@ with Ada.Streams;
 with System.CRTL;
 
 package System.Communication is
-
    pragma Preelaborate;
 
    function Last_Index
index ae48ffcd9492ada5daa6072c33f15cd09273b1a6..cd3d0cbe37f54ca6f98328450826b55f6db423d3 100644 (file)
@@ -40,7 +40,6 @@ with Interfaces.C_Streams;
 with System.CRTL;
 
 package System.File_Control_Block is
-
    pragma Preelaborate;
 
    ----------------------------
index d0ecaa9c1a9604202d9be957b4f943277784f964..f084d8dc5737d70c271906d073d018efaed749e9 100644 (file)
@@ -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;
index df8ad9b329cdbd3f19a1ac9625a51eda8fbd48bc..dbe33155fd5167888671d4c1c58a3529d0c1a1b1 100644 (file)
@@ -55,7 +55,6 @@ with System.Strings;
 
 package System.OS_Lib is
    pragma Elaborate_Body (OS_Lib);
-
    pragma Preelaborate;
 
    -----------------------
index abb0344ad7092be8ef9a59b8dc710b6402d6f770..efb6037f6eee0fea92491111fd64407bc571e3a6 100644 (file)
@@ -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
index e5d4dfbadda6c428347e1b7c1705b22044f3ea56..4d8b8ffc5d08f89df6d3f751802f4a5f6e1bf7ac 100644 (file)
@@ -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
index 80b1ab17dae5ef0cb3b92401ca65ff2c2d542a8a..3b5b20354c9d8fba2c592d528674cf45d21cd7be 100644 (file)
@@ -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;