2014-07-29 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jul 2014 13:27:42 +0000 (13:27 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jul 2014 13:27:42 +0000 (13:27 +0000)
* sem_ch3.adb, sinfo.ads, types.ads, sem_prag.adb, a-except-2005.adb,
sem_ch6.adb, par-ch3.adb: Minor reformatting.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213174 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/a-except-2005.adb
gcc/ada/par-ch3.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_prag.adb
gcc/ada/sinfo.ads
gcc/ada/types.ads

index 1b7701c..58a3246 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-29  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch3.adb, sinfo.ads, types.ads, sem_prag.adb, a-except-2005.adb,
+       sem_ch6.adb, par-ch3.adb: Minor reformatting.
+
 2014-07-29  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch6.adb (Check_Return_Subtype_Indication): Reject a return
index ab29b09..168a619 100644 (file)
@@ -403,9 +403,17 @@ package body Ada.Exceptions is
    --  These routines raise a specific exception with a reason message
    --  attached. The parameters are the file name and line number in each
    --  case. The names are defined by Exp_Ch11.Get_RT_Exception_Name.
-   --  Note that these routines should be declared in the same order as the
-   --  corresponding Rmsg_xx constants below, this is needed by the
-   --  .NET runtime (see exceptmsg.awk script).
+
+   --  Note on ordering of these routines. Normally in the Ada.Exceptions units
+   --  we don't care about the ordering of entries for Rcheck routines, and
+   --  the normal approach is to keep them in the same order as declarations
+   --  in Types.
+
+   --  This section is an IMPORTANT EXCEPTION. It is essential that the
+   --  routines in this section be declared in the same order as the Rmsg_xx
+   --  constants in the following section. This is required by the .Net runtime
+   --  which uses the exceptmsg.awk script to generate require exception data,
+   --  and this script requires and expects that this ordering rule holds.
 
    procedure Rcheck_CE_Access_Check
      (File : System.Address; Line : Integer);
@@ -479,7 +487,6 @@ package body Ada.Exceptions is
      (File : System.Address; Line : Integer);
    procedure Rcheck_PE_Stream_Operation_Not_Allowed
      (File : System.Address; Line : Integer);
-
    procedure Rcheck_CE_Access_Check_Ext
      (File : System.Address; Line, Column : Integer);
    procedure Rcheck_CE_Index_Check_Ext
index 1bad005..acf35a5 100644 (file)
@@ -3966,15 +3966,15 @@ package body Ch3 is
    begin
       if not Header_Already_Parsed then
 
-         --  not null access .. is a common form of access definition
-         --  access non null ..  is certainly rare, but syntactically legal.
-         --  not null access not null .. is rarer yet, and also legal.
+         --  NOT NULL ACCESS .. is a common form of access definition.
+         --  ACCESS NON NULL ..  is certainly rare, but syntactically legal.
+         --  NOT NULL ACCESS NOT NULL .. is rarer yet, and also legal.
          --  The last two cases are only meaningful if the following subtype
          --  indication denotes an access type (semantic check).
 
          Not_Null_Present := P_Null_Exclusion;     --  Ada 2005 (AI-231)
          Scan; -- past ACCESS
-         Not_Null_Subtype := P_Null_Exclusion;     --  Might also appear.
+         Not_Null_Subtype := P_Null_Exclusion;     --  Might also appear
       end if;
 
       if Token_Name = Name_Protected then
index e93230a..9c70acb 100644 (file)
@@ -1337,7 +1337,7 @@ package body Sem_Ch3 is
               Process_Subtype (S, P, T, 'P'));
          end if;
 
-         --  If the access definition is of the form : access not null ..
+         --  If the access definition is of the form: ACCESS NOT NULL ..
          --  the subtype indication must be of an access type. Create
          --  a null-excluding subtype of it.
 
@@ -1355,7 +1355,7 @@ package body Sem_Ch3 is
                   Decl :=
                     Make_Subtype_Declaration (Loc,
                       Defining_Identifier => Nam,
-                      Subtype_Indication =>
+                      Subtype_Indication  =>
                         New_Occurrence_Of (Entity (S), Loc));
                   Set_Null_Exclusion_Present (Decl);
                   Insert_Before (Parent (Def), Decl);
@@ -1383,7 +1383,7 @@ package body Sem_Ch3 is
 
       --  In Ada 2005, the type may have a limited view through some unit in
       --  its own context, allowing the following circularity that cannot be
-      --  detected earlier
+      --  detected earlier.
 
       elsif Is_Class_Wide_Type (Full_Desig) and then Etype (Full_Desig) = T
       then
index b80c497..cc1cc7b 100644 (file)
@@ -811,9 +811,11 @@ package body Sem_Ch6 is
                end if;
             end if;
 
-            --  Previous versions of this subprogram allowed the return value
-            --  to be the ancestor of the return type if the return type was
-            --  a null extension.  This was plainly incorrect.
+         --  All remaining cases are illegal
+
+         --  Note: previous versions of this subprogram allowed the return
+         --  value to be the ancestor of the return type if the return type
+         --  was a null extension. This was plainly incorrect.
 
          else
             Error_Msg_N
index 208a954..bc3468d 100644 (file)
@@ -11019,6 +11019,7 @@ package body Sem_Prag is
             --  integer address values. If Address is not private (e.g. on
             --  VMS, where it is an integer type), then this pragma has no
             --  purpose, so it is simply ignored.
+
             --  If Allow_Integer_Address is already set do nothing, otherwise
             --  calling RTE on RE_Address would cause a crash when loading
             --  system.ads.
index 1b2ae3e..2533f5b 100644 (file)
@@ -1850,6 +1850,9 @@ package Sinfo is
    --    expected type is a thin pointer to unconstrained array. This flag is
    --    to assist in detecting this illegal use of Unrestricted_Access.
 
+   --  Null_Excluding_Subtype (Flag16)
+   --    ??? needs documentation ???
+
    --  Original_Discriminant (Node2-Sem)
    --    Present in identifiers. Used in references to discriminants that
    --    appear in generic units. Because the names of the discriminants may be
index 061dfc2..a8d2f5b 100644 (file)
@@ -836,6 +836,14 @@ package Types is
    --       static string constant. Note that there is more than one version
    --       of a-except.adb which must be modified.
 
+   --  Note on ordering of references. For the tables in Ada.Exceptions units,
+   --  usually the ordering does not matter, and we use the same ordering as
+   --  is used here (note the requirement in the ordering here that CE/PE/SE
+   --  codes be kept together, so the subtype declarations work OK). However,
+   --  there is an important exception, which is in a-except-2005.adb, where
+   --  ordering of the Rcheck routines must correspond to the ordering of the
+   --  Rmsg_xx messages. This is required by the .NET scripts.
+
    type RT_Exception_Code is
      (CE_Access_Check_Failed,            -- 00
       CE_Access_Parameter_Is_Null,       -- 01