OSDN Git Service

* common.opt (Wmudflap): New option.
[pf3gnuchains/gcc-fork.git] / gcc / ada / types.ads
index 6573122..61318c8 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2002 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2007, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -16,8 +16,8 @@
 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 -- for  more details.  You should have  received  a copy of the GNU General --
 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
+-- Boston, MA 02110-1301, USA.                                              --
 --                                                                          --
 -- As a special exception,  if other files  instantiate  generics from this --
 -- unit, or you link  this unit with other files  to produce an executable, --
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with Unchecked_Deallocation;
-
-package Types is
-pragma Preelaborate (Types);
-
 --  This package contains host independent type definitions which are used
 --  in more than one unit in the compiler. They are gathered here for easy
 --  reference, though in some cases the full description is found in the
---  relevant module which implements the definition. The main reason that
---  they are not in their "natural" specs is that this would cause a lot of
---  inter-spec dependencies, and in particular some awkward circular
---  dependencies would have to be dealt with.
+--  relevant module which implements the definition. The main reason that they
+--  are not in their "natural" specs is that this would cause a lot of inter-
+--  spec dependencies, and in particular some awkward circular dependencies
+--  would have to be dealt with.
 
---  WARNING: There is a C version of this package. Any changes to this
---  source file must be properly reflected in the C header file a-types.h
+--  WARNING: There is a C version of this package. Any changes to this source
+--  file must be properly reflected in the C header file types.h declarations.
 
---  Note: the declarations in this package reflect an expectation that the
---  host machine has an efficient integer base type with a range at least
---  32 bits 2s-complement. If there are any machines for which this is not
---  a correct assumption, a significant number of changes will be required!
+--  Note: the declarations in this package reflect an expectation that the host
+--  machine has an efficient integer base type with a range at least 32 bits
+--  2s-complement. If there are any machines for which this is not a correct
+--  assumption, a significant number of changes will be required!
+
+with Unchecked_Deallocation;
+
+package Types is
+   pragma Preelaborate;
 
    -------------------------------
    -- General Use Integer Types --
@@ -93,7 +93,7 @@ pragma Preelaborate (Types);
 
    EOF : constant Character := ASCII.SUB;
    --  The character SUB (16#1A#) is used in DOS and other systems derived
-   --  from DOS (OS/2, NT etc) to signal the end of a text file. Internally
+   --  from DOS (XP, NT etc) to signal the end of a text file. Internally
    --  all source files are ended by an EOF character, even on Unix systems.
    --  An EOF character acts as the end of file only as the last character
    --  of a source buffer, in any other position, it is treated as a blank
@@ -106,6 +106,11 @@ pragma Preelaborate (Types);
 
    subtype Line_Terminator is Character range ASCII.LF .. ASCII.CR;
    --  Line terminator characters (LF, VT, FF, CR)
+   --
+   --  This definition is dubious now that we have two more wide character
+   --  sequences that constitute a line terminator. Every reference to this
+   --  subtype needs checking to make sure the wide character case is handled
+   --  appropriately. ???
 
    subtype Upper_Half_Character is
      Character range Character'Val (16#80#) .. Character'Val (16#FF#);
@@ -129,9 +134,9 @@ pragma Preelaborate (Types);
    -- Types Used for Text Buffer Handling --
    -----------------------------------------
 
-   --  We can't use type String for text buffers, since we must use the
-   --  standard 32-bit integer as an index value, since we count on all
-   --  index values being the same size.
+   --  We can not use type String for text buffers, since we must use the
+   --  standard 32-bit integer as an index value, since we count on all index
+   --  values being the same size.
 
    type Text_Ptr is new Int;
    --  Type used for subscripts in text buffer
@@ -162,14 +167,15 @@ pragma Preelaborate (Types);
 
    type Physical_Line_Number is range 1 .. Int'Last;
    for Physical_Line_Number'Size use 32;
-   --  Line number type, used for storing physical line numbers (i.e.
-   --  line numbers in the physical file being compiled, unaffected by
-   --  the presence of source reference pragmas.
+   --  Line number type, used for storing physical line numbers (i.e. line
+   --  numbers in the physical file being compiled, unaffected by the presence
+   --  of source reference pragmas.
 
    type Column_Number is range 0 .. 32767;
    for Column_Number'Size use 16;
-   --  Column number (assume that 2**15 is large enough, see declaration
-   --  of Hostparm.Max_Line_Length)
+   --  Column number (assume that 2**15 - 1 is large enough). The range for
+   --  this type is used to compute Hostparm.Max_Line_Length. See also the
+   --  processing for -gnatyM in Stylesw).
 
    No_Column_Number : constant Column_Number := 0;
    --  Special value used to indicate no column number
@@ -177,20 +183,20 @@ pragma Preelaborate (Types);
    subtype Source_Buffer is Text_Buffer;
    --  Type used to store text of a source file . The buffer for the main
    --  source (the source specified on the command line) has a lower bound
-   --  starting at zero. Subsequent subsidiary sources have lower bounds
-   --  which are one greater than the previous upper bound.
+   --  starting at zero. Subsequent subsidiary sources have lower bounds which
+   --  are one greater than the previous upper bound.
 
    subtype Big_Source_Buffer is Text_Buffer (0 .. Text_Ptr'Last);
    --  This is a virtual type used as the designated type of the access
    --  type Source_Buffer_Ptr, see Osint.Read_Source_File for details.
 
    type Source_Buffer_Ptr is access all Big_Source_Buffer;
-   --  Pointer to source buffer. We use virtual origin addressing for
-   --  source buffers, with thin pointers. The pointer points to a virtual
-   --  instance of type Big_Source_Buffer, where the actual type is in fact
-   --  of type Source_Buffer. The address is adjusted so that the virtual
-   --  origin addressing works correctly. See Osint.Read_Source_Buffer for
-   --  further details.
+   --  Pointer to source buffer. We use virtual origin addressing for source
+   --  buffers, with thin pointers. The pointer points to a virtual instance
+   --  of type Big_Source_Buffer, where the actual type is in fact of type
+   --  Source_Buffer. The address is adjusted so that the virtual origin
+   --  addressing works correctly. See Osint.Read_Source_Buffer for further
+   --  details.
 
    subtype Source_Ptr is Text_Ptr;
    --  Type used to represent a source location, which is a subscript of a
@@ -200,17 +206,27 @@ pragma Preelaborate (Types);
    --  are allowed to accommodate the following special values.
 
    No_Location : constant Source_Ptr := -1;
-   --  Value used to indicate no source position set in a node
+   --  Value used to indicate no source position set in a node. A test for
+   --  a Source_Ptr value being > No_Location is the approved way to test
+   --  for a standard value that does not include No_Location or any of the
+   --  following special definitions. One important use of No_Location is to
+   --  label generated nodes that we don't want the debugger to see in normal
+   --  mode (very often we conditionalize so that we set No_Location in normal
+   --  mode and the corresponding source line in -gnatD mode).
 
    Standard_Location : constant Source_Ptr := -2;
-   --  Used for all nodes in the representation of package Standard other
-   --  than nodes representing the contents of Standard.ASCII. Note that
-   --  testing for <= Standard_Location tests for both Standard_Location
-   --  and for Standard_ASCII_Location.
+   --  Used for all nodes in the representation of package Standard other than
+   --  nodes representing the contents of Standard.ASCII. Note that testing for
+   --  a value being <= Standard_Location tests for both Standard_Location and
+   --  for Standard_ASCII_Location.
 
    Standard_ASCII_Location : constant Source_Ptr := -3;
    --  Used for all nodes in the presentation of package Standard.ASCII
 
+   System_Location : constant Source_Ptr := -4;
+   --  Used to identify locations of pragmas scanned by Targparm, where we
+   --  know the location is in System, but we don't know exactly what line.
+
    First_Source_Ptr : constant Source_Ptr := 0;
    --  Starting source pointer index value for first source program
 
@@ -227,7 +243,6 @@ pragma Preelaborate (Types);
    --    Strings (type String_Id)
    --    Universal integers (type Uint)
    --    Universal reals (type Ureal)
-   --    Character codes (type Char_Code stored with a bias)
 
    --  In most contexts, the strongly typed interface determines which of
    --  these types is present. However, there are some situations (involving
@@ -251,13 +266,13 @@ pragma Preelaborate (Types);
    --  List_Id and Node_Id values (see further description below).
 
    List_High_Bound : constant := 0;
-   --  Maximum List_Id subscript value. This allows up to 100 million list
-   --  Id values, which is in practice infinite, and there is no need to
-   --  check the range. The range overlaps the node range by one element
-   --  (with value zero), which is used both for the Empty node, and for
-   --  indicating no list. The fact that the same value is used is convenient
-   --  because it means that the default value of Empty applies to both nodes
-   --  and lists, and also is more efficient to test for.
+   --  Maximum List_Id subscript value. This allows up to 100 million list Id
+   --  values, which is in practice infinite, and there is no need to check the
+   --  range. The range overlaps the node range by one element (with value
+   --  zero), which is used both for the Empty node, and for indicating no
+   --  list. The fact that the same value is used is convenient because it
+   --  means that the default value of Empty applies to both nodes and lists,
+   --  and also is more efficient to test for.
 
    Node_Low_Bound : constant := 0;
    --  The tree Id values start at zero, because we use zero for Empty (to
@@ -301,14 +316,14 @@ pragma Preelaborate (Types);
    --  is in practice infinite and there is no need to check the range.
 
    Ureal_Low_Bound : constant := 500_000_000;
-   --  Low bound for Ureal values.
+   --  Low bound for Ureal values
 
    Ureal_High_Bound : constant := 599_999_999;
    --  Maximum number of Ureal values stored is 100_000_000 which is in
    --  practice infinite so that no check is required.
 
    Uint_Low_Bound : constant := 600_000_000;
-   --  Low bound for Uint values.
+   --  Low bound for Uint values
 
    Uint_Table_Start : constant := 2_000_000_000;
    --  Location where table entries for universal integers start (see
@@ -318,10 +333,6 @@ pragma Preelaborate (Types);
    --  The range of Uint values is very large, since a substantial part
    --  of this range is used to store direct values, see Uintp for details.
 
-   Char_Code_Bias : constant := 2_100_000_000;
-   --  A bias value added to character code values stored in the tree which
-   --  ensures that they have different values from any of the above types.
-
    --  The following subtype definitions are used to provide convenient names
    --  for membership tests on Int values to see what data type range they
    --  lie in. Such tests appear only in the lowest level packages.
@@ -350,40 +361,6 @@ pragma Preelaborate (Types);
    subtype Ureal_Range     is Union_Id
      range Ureal_Low_Bound    .. Ureal_High_Bound;
 
-   subtype Char_Code_Range is Union_Id
-     range Char_Code_Bias    .. Char_Code_Bias + 2**16 - 1;
-
-   -----------------------------
-   -- Types for Namet Package --
-   -----------------------------
-
-   --  Name_Id values are used to identify entries in the names table. Except
-   --  for the special values No_Name, and Error_Name, they are subscript
-   --  values for the Names table defined in package Namet.
-
-   --  Note that with only a few exceptions, which are clearly documented, the
-   --  type Name_Id should be regarded as a private type. In particular it is
-   --  never appropriate to perform arithmetic operations using this type.
-
-   type Name_Id is range Names_Low_Bound .. Names_High_Bound;
-   for Name_Id'Size use 32;
-   --  Type used to identify entries in the names table
-
-   No_Name : constant Name_Id := Names_Low_Bound;
-   --  The special Name_Id value No_Name is used in the parser to indicate
-   --  a situation where no name is present (e.g. on a loop or block).
-
-   Error_Name : constant Name_Id := Names_Low_Bound +  1;
-   --  The special Name_Id value Error_Name is used in the parser to
-   --  indicate that some kind of error was encountered in scanning out
-   --  the relevant name, so it does not have a representable label.
-
-   subtype Error_Name_Or_No_Name is Name_Id range No_Name .. Error_Name;
-   --  Used to test for either error name or no name
-
-   First_Name_Id : constant Name_Id := Names_Low_Bound + 2;
-   --  Subscript of first entry in names table
-
    ----------------------------
    -- Types for Atree Package --
    ----------------------------
@@ -436,17 +413,17 @@ pragma Preelaborate (Types);
    ------------------------------
 
    --  List_Id values are used to identify node lists in the tree. They are
-   --  subscripts into the Lists table declared in package Tree. Note that
-   --  the special value Error_List is a subscript in this table, but the
-   --  value No_List is *not* a valid subscript, and any attempt to apply
-   --  list operations to No_List will cause a (detected) error.
+   --  subscripts into the Lists table declared in package Tree. Note that the
+   --  special value Error_List is a subscript in this table, but the value
+   --  No_List is *not* a valid subscript, and any attempt to apply list
+   --  operations to No_List will cause a (detected) error.
 
    type List_Id is range List_Low_Bound .. List_High_Bound;
    --  Type used to identify a node list
 
    No_List : constant List_Id := List_High_Bound;
    --  Used to indicate absence of a list. Note that the value is zero, which
-   --  is the same as Empty, which is helpful in initializing nodes where a
+   --  is the same as Empty, which is helpful in intializing nodes where a
    --  value of zero can represent either an empty node or an empty list.
 
    Error_List : constant List_Id := List_Low_Bound;
@@ -462,10 +439,10 @@ pragma Preelaborate (Types);
    -- Types for Elists Package --
    ------------------------------
 
-   --  Element list Id values are used to identify element lists stored in
-   --  the tree (see package Tree for further details). They are formed by
-   --  adding a bias (Element_List_Bias) to subscript values in the same
-   --  array that is used for node list headers.
+   --  Element list Id values are used to identify element lists stored in the
+   --  tree (see package Tree for further details). They are formed by adding a
+   --  bias (Element_List_Bias) to subscript values in the same array that is
+   --  used for node list headers.
 
    type Elist_Id is range Elist_Low_Bound .. Elist_High_Bound;
    --  Type used to identify an element list (Elist header table subscript)
@@ -476,7 +453,7 @@ pragma Preelaborate (Types);
    --  are not valid.
 
    First_Elist_Id : constant Elist_Id := No_Elist + 1;
-   --  Subscript of first allocated Elist header.
+   --  Subscript of first allocated Elist header
 
    --  Element Id values are used to identify individual elements of an
    --  element list (see package Elists for further details).
@@ -494,8 +471,8 @@ pragma Preelaborate (Types);
    -- Types for Stringt Package --
    -------------------------------
 
-   --  String_Id values are used to identify entries in the strings table.
-   --  They are subscripts into the strings table defined in package Strings.
+   --  String_Id values are used to identify entries in the strings table. They
+   --  are subscripts into the strings table defined in package Strings.
 
    --  Note that with only a few exceptions, which are clearly documented, the
    --  type String_Id should be regarded as a private type. In particular it is
@@ -515,19 +492,22 @@ pragma Preelaborate (Types);
    -- Character Code Type --
    -------------------------
 
-   --  The type Char is used for character data internally in the compiler,
-   --  but character codes in the source are represented by the Char_Code
-   --  type. Each character literal in the source is interpreted as being one
-   --  of the 2**16 possible Wide_Character codes, and a unique integer value
-   --  is assigned, corresponding to the POS value in the Wide_Character type.
-   --  String literals are similarly interpreted as a sequence of such codes.
+   --  The type Char is used for character data internally in the compiler, but
+   --  character codes in the source are represented by the Char_Code type.
+   --  Each character literal in the source is interpreted as being one of the
+   --  16#8000_0000 possible Wide_Wide_Character codes, and a unique Integer
+   --  Value is assigned, corresponding to the UTF_32 value, which also
+   --  correspondds to the POS value in the Wide_Wide_Character type, and also
+   --  corresponds to the POS value in the Wide_Character and Character types
+   --  for values that are in appropriate range. String literals are similarly
+   --  interpreted as a sequence of such codes.
 
-   --  Note: when character code values are stored in the tree, they are stored
-   --  by adding a bias value (Char_Code_Bias) that results in values that can
-   --  be distinguished from other types of values stored in the tree.
+   type Char_Code_Base is mod 2 ** 32;
+   for Char_Code_Base'Size use 32;
 
-   type Char_Code is mod 2 ** 16;
-   for Char_Code'Size use 16;
+   subtype Char_Code is Char_Code_Base range 0 .. 16#7FFF_FFFF#;
+   for Char_Code'Value_Size use 32;
+   for Char_Code'Object_Size use 32;
 
    function Get_Char_Code (C : Character) return Char_Code;
    pragma Inline (Get_Char_Code);
@@ -541,11 +521,21 @@ pragma Preelaborate (Types);
    --  Determines if the given character code is in range of type Character,
    --  and if so, returns True. If not, returns False.
 
+   function In_Wide_Character_Range (C : Char_Code) return Boolean;
+   pragma Inline (In_Wide_Character_Range);
+   --  Determines if the given character code is in range of the type
+   --  Wide_Character, and if so, returns True. If not, returns False.
+
    function Get_Character (C : Char_Code) return Character;
    pragma Inline (Get_Character);
-   --  For a character C that is in character range (see above function), this
+   --  For a character C that is in Character range (see above function), this
    --  function returns the corresponding Character value. It is an error to
-   --  call Get_Character if C is not in character range
+   --  call Get_Character if C is not in Character range.
+
+   function Get_Wide_Character (C : Char_Code) return Wide_Character;
+   --  For a character C that is in Wide_Character range (see above function),
+   --  this function returns the corresponding Wide_Character value. It is an
+   --  error to call Get_Wide_Character if C is not in Wide_Character range.
 
    ---------------------------------------
    -- Types used for Library Management --
@@ -562,28 +552,17 @@ pragma Preelaborate (Types);
    No_Unit : constant Unit_Number_Type := -1;
    --  Special value used to signal no unit
 
-   type Source_File_Index is new Nat;
+   type Source_File_Index is new Int range -1 .. Int'Last;
    --  Type used to index the source file table (see package Sinput)
 
+   Internal_Source_File : constant Source_File_Index :=
+                            Source_File_Index'First;
+   --  Value used to indicate the buffer for the source-code-like strings
+   --  internally created withing the compiler (see package Sinput)
+
    No_Source_File : constant Source_File_Index := 0;
    --  Value used to indicate no source file present
 
-   System_Source_File_Index : constant Source_File_Index := 1;
-   --  Value used for source file table entry for system.ads, which is
-   --  always the first source file read (see unit Targparm for details).
-
-   subtype File_Name_Type is Name_Id;
-   --  File names are stored in the names table and this synonym is used to
-   --  indicate that a Name_Id value is being used to hold a simple file
-   --  name (which does not include any directory information).
-
-   No_File : constant File_Name_Type := File_Name_Type (No_Name);
-   --  Constant used to indicate no file found
-
-   subtype Unit_Name_Type is Name_Id;
-   --  Unit names are stored in the names table and this synonym is used to
-   --  indicate that a Name_Id value is being used to hold a unit name.
-
    -----------------------------------
    -- Representation of Time Stamps --
    -----------------------------------
@@ -617,11 +596,10 @@ pragma Preelaborate (Types);
    --  Type used to represent time stamp
 
    Empty_Time_Stamp : constant Time_Stamp_Type := (others => ' ');
-   --  Type used to represent an empty or missing time stamp. Looks less
-   --  than any real time stamp if two time stamps are compared. Note that
-   --  although this is not a private type, clients should not rely on the
-   --  exact way in which this string is represented, and instead should
-   --  use the subprograms below.
+   --  Value representing an empty or missing time stamp. Looks less than any
+   --  real time stamp if two time stamps are compared. Note that although this
+   --  is not private, clients should not rely on the exact way in which this
+   --  string is represented, and instead should use the subprograms below.
 
    Dummy_Time_Stamp : constant Time_Stamp_Type := (others => '0');
    --  This is used for dummy time stamp values used in the D lines for
@@ -632,14 +610,15 @@ pragma Preelaborate (Types);
    function ">=" (Left, Right : Time_Stamp_Type) return Boolean;
    function "<"  (Left, Right : Time_Stamp_Type) return Boolean;
    function ">"  (Left, Right : Time_Stamp_Type) return Boolean;
-   --  Comparison functions on time stamps. Note that two time stamps
-   --  are defined as being equal if they have the same day/month/year
-   --  and the hour/minutes/seconds values are within 2 seconds of one
-   --  another. This deals with rounding effects in library file time
-   --  stamps caused by copying operations during installation. We have
-   --  particularly noticed that WinNT seems susceptible to such changes.
-   --  Note: the Empty_Time_Stamp value looks equal to itself, and less
-   --  than any non-empty time stamp value.
+   --  Comparison functions on time stamps. Note that two time stamps are
+   --  defined as being equal if they have the same day/month/year and the
+   --  hour/minutes/seconds values are within 2 seconds of one another. This
+   --  deals with rounding effects in library file time stamps caused by
+   --  copying operations during installation. We have particularly noticed
+   --  that WinNT seems susceptible to such changes.
+   --
+   --  Note : the Empty_Time_Stamp value looks equal to itself, and less than
+   --  any non-empty time stamp value.
 
    procedure Split_Time_Stamp
      (TS      : Time_Stamp_Type;
@@ -665,49 +644,77 @@ pragma Preelaborate (Types);
    -- Types used for Pragma Suppress Management --
    -----------------------------------------------
 
-   --  The following record contains an entry for each recognized check name
+   type Check_Id is new Nat;
+   --  Type used to represent a check id
+
+   No_Check_Id         : constant := 0;
+   --  Check_Id value used to indicate no check
+
+   Access_Check        : constant :=  1;
+   Accessibility_Check : constant :=  2;
+   Alignment_Check     : constant :=  3;
+   Discriminant_Check  : constant :=  4;
+   Division_Check      : constant :=  5;
+   Elaboration_Check   : constant :=  6;
+   Index_Check         : constant :=  7;
+   Length_Check        : constant :=  8;
+   Overflow_Check      : constant :=  9;
+   Range_Check         : constant := 10;
+   Storage_Check       : constant := 11;
+   Tag_Check           : constant := 12;
+   Validity_Check      : constant := 13;
+   --  Values used to represent individual predefined checks
+
+   All_Checks          : constant := 14;
+   --  Value used to represent All_Checks value
+
+   subtype Predefined_Check_Id is Check_Id range 1 .. All_Checks;
+   --  Subtype for predefined checks, including All_Checks
+
+   --  The following array contains an entry for each recognized check name
    --  for pragma Suppress. It is used to represent current settings of scope
    --  based suppress actions from pragma Suppress or command line settings.
 
-   type Suppress_Record is record
-      Access_Checks        : Boolean;
-      Accessibility_Checks : Boolean;
-      Discriminant_Checks  : Boolean;
-      Division_Checks      : Boolean;
-      Elaboration_Checks   : Boolean;
-      Index_Checks         : Boolean;
-      Length_Checks        : Boolean;
-      Overflow_Checks      : Boolean;
-      Range_Checks         : Boolean;
-      Storage_Checks       : Boolean;
-      Tag_Checks           : Boolean;
-   end record;
+   --  Note: when Suppress_Array (All_Checks) is True, then generally all other
+   --  specific check entries are set True, except for the Elaboration_Check
+   --  entry which is set only if an explicit Suppress for this check is given.
+   --  The reason for this non-uniformity is that we do not want All_Checks to
+   --  suppress elaboration checking when using the static elaboration model.
+   --  We recognize only an explicit suppress of Elaboration_Check as a signal
+   --  that the static elaboration checking should skip a compile time check.
+
+   type Suppress_Array is array (Predefined_Check_Id) of Boolean;
+   pragma Pack (Suppress_Array);
 
    --  To add a new check type to GNAT, the following steps are required:
 
-   --    1.  Add an appropriate entry to the above record type
-   --    2.  Add an entry to Snames spec and body for the new name
-   --    3.  Add an entry to the definition of Check_Id in the Snames spec
-   --    4.  Add a new entity flag definition in Einfo for the check
-   --    5.  Add a new function to Sem.Util to handle the new check test
-   --    6.  Add appropriate processing for pragma Suppress in Sem.Prag
-   --    7.  Add a branch to the case statement in Sem.Ch8.Pop_Scope
-   --    8.  Add a new Do_xxx_Check flag to Sinfo (if required)
-   --    9.  Add appropriate checks for the new test
+   --    1.  Add an entry to Snames spec and body for the new name
+   --    2.  Add an entry to the definition of Check_Id above
+   --    3.  Add a new function to Checks to handle the new check test
+   --    4.  Add a new Do_xxx_Check flag to Sinfo (if required)
+   --    5.  Add appropriate checks for the new test
 
    -----------------------------------
    -- Global Exception Declarations --
    -----------------------------------
 
    --  This section contains declarations of exceptions that are used
-   --  throughout the compiler.
+   --  throughout the compiler or in other GNAT tools.
 
    Unrecoverable_Error : exception;
-   --  This exception is raised to immediately terminate the compilation
-   --  of the current source program. Used in situations where things are
-   --  bad enough that it doesn't seem worth continuing (e.g. max errors
-   --  reached, or a required file is not found). Also raised when the
-   --  compiler finds itself in trouble after an error (see Comperr).
+   --  This exception is raised to immediately terminate the compilation of the
+   --  current source program. Used in situations where things are bad enough
+   --  that it doesn't seem worth continuing (e.g. max errors reached, or a
+   --  required file is not found). Also raised when the compiler finds itself
+   --  in trouble after an error (see Comperr).
+
+   Terminate_Program : exception;
+   --  This exception is raised to immediately terminate the tool being
+   --  executed. Each tool where this exception may be raised must have a
+   --  single exception handler that contains only a null statement and that is
+   --  the last statement of the program. If needed, procedure Set_Exit_Status
+   --  is called with the appropriate exit status before raising
+   --  Terminate_Program.
 
    ---------------------------------
    -- Parameter Mechanism Control --
@@ -726,10 +733,10 @@ pragma Preelaborate (Types);
    -- Run-Time Exception Codes --
    ------------------------------
 
-   --  When the code generator generates a run-time exception, it provides
-   --  a reason code which is one of the following. This reason code is used
-   --  to select the appropriate run-time routine to be called, determining
-   --  both the exception to be raised, and the message text to be added.
+   --  When the code generator generates a run-time exception, it provides a
+   --  reason code which is one of the following. This reason code is used to
+   --  select the appropriate run-time routine to be called, determining both
+   --  the exception to be raised, and the message text to be added.
 
    --  The prefix CE/PE/SE indicates the exception to be raised
    --    CE = Constraint_Error
@@ -745,46 +752,49 @@ pragma Preelaborate (Types);
    --    1. Modify the type and subtype declarations below appropriately,
    --       keeping things in alphabetical order.
 
-   --    2. Modify the corresponding definitions in a-types.h, including
+   --    2. Modify the corresponding definitions in types.h, including
    --       the definition of last_reason_code.
 
    --    3. Add a new routine in Ada.Exceptions with the appropriate call
-   --       and static string constant
-
-   --    4. Initialize the new entry in raise_decls
-
-   type RT_Exception_Code is (
-     CE_Access_Check_Failed,
-     CE_Access_Parameter_Is_Null,
-     CE_Discriminant_Check_Failed,
-     CE_Divide_By_Zero,
-     CE_Explicit_Raise,
-     CE_Index_Check_Failed,
-     CE_Invalid_Data,
-     CE_Length_Check_Failed,
-     CE_Overflow_Check_Failed,
-     CE_Partition_Check_Failed,
-     CE_Range_Check_Failed,
-     CE_Tag_Check_Failed,
-
-     PE_Access_Before_Elaboration,
-     PE_Accessibility_Check_Failed,
-     PE_All_Guards_Closed,
-     PE_Duplicated_Entry_Address,
-     PE_Explicit_Raise,
-     PE_Finalize_Raised_Exception,
-     PE_Invalid_Data,
-     PE_Misaligned_Address_Value,
-     PE_Missing_Return,
-     PE_Potentially_Blocking_Operation,
-     PE_Stubbed_Subprogram_Called,
-     PE_Unchecked_Union_Restriction,
-
-     SE_Empty_Storage_Pool,
-     SE_Explicit_Raise,
-     SE_Infinite_Recursion,
-     SE_Object_Too_Large,
-     SE_Restriction_Violation);
+   --       and static string constant. Note that there is more than one
+   --       version of a-except.adb which must be modified.
+
+   type RT_Exception_Code is
+     (CE_Access_Check_Failed,            -- 00
+      CE_Access_Parameter_Is_Null,       -- 01
+      CE_Discriminant_Check_Failed,      -- 02
+      CE_Divide_By_Zero,                 -- 03
+      CE_Explicit_Raise,                 -- 04
+      CE_Index_Check_Failed,             -- 05
+      CE_Invalid_Data,                   -- 06
+      CE_Length_Check_Failed,            -- 07
+      CE_Null_Exception_Id,              -- 08
+      CE_Null_Not_Allowed,               -- 09
+      CE_Overflow_Check_Failed,          -- 10
+      CE_Partition_Check_Failed,         -- 11
+      CE_Range_Check_Failed,             -- 12
+      CE_Tag_Check_Failed,               -- 13
+
+      PE_Access_Before_Elaboration,      -- 14
+      PE_Accessibility_Check_Failed,     -- 15
+      PE_All_Guards_Closed,              -- 16
+      PE_Current_Task_In_Entry_Body,     -- 17
+      PE_Duplicated_Entry_Address,       -- 18
+      PE_Explicit_Raise,                 -- 19
+      PE_Finalize_Raised_Exception,      -- 20
+      PE_Implicit_Return,                -- 21
+      PE_Misaligned_Address_Value,       -- 22
+      PE_Missing_Return,                 -- 23
+      PE_Overlaid_Controlled_Object,     -- 24
+      PE_Potentially_Blocking_Operation, -- 25
+      PE_Stubbed_Subprogram_Called,      -- 26
+      PE_Unchecked_Union_Restriction,    -- 27
+      PE_Non_Transportable_Actual,       -- 28
+
+      SE_Empty_Storage_Pool,             -- 29
+      SE_Explicit_Raise,                 -- 30
+      SE_Infinite_Recursion,             -- 31
+      SE_Object_Too_Large);              -- 32
 
    subtype RT_CE_Exceptions is RT_Exception_Code range
      CE_Access_Check_Failed ..
@@ -792,10 +802,10 @@ pragma Preelaborate (Types);
 
    subtype RT_PE_Exceptions is RT_Exception_Code range
      PE_Access_Before_Elaboration ..
-     PE_Unchecked_Union_Restriction;
+     PE_Non_Transportable_Actual;
 
    subtype RT_SE_Exceptions is RT_Exception_Code range
      SE_Empty_Storage_Pool ..
-     SE_Restriction_Violation;
+     SE_Object_Too_Large;
 
 end Types;