OSDN Git Service

2008-12-17 Sebastian Pop <sebastian.pop@amd.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / ali.ads
index 5a4dcaa..c4be2ef 100644 (file)
@@ -6,18 +6,17 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2006, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2008, 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- --
--- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
 -- 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,  51  Franklin  Street,  Fifth  Floor, --
--- Boston, MA 02110-1301, USA.                                              --
+-- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license.          --
 --                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
@@ -30,6 +29,7 @@
 
 with Casing;  use Casing;
 with Gnatvsn; use Gnatvsn;
+with Namet;   use Namet;
 with Rident;  use Rident;
 with Table;
 with Types;   use Types;
@@ -90,7 +90,7 @@ package ALI is
       Afile : File_Name_Type;
       --  Name of ALI file
 
-      Ofile_Full_Name : Name_Id;
+      Ofile_Full_Name : File_Name_Type;
       --  Full name of object file corresponding to the ALI file
 
       Sfile : File_Name_Type;
@@ -122,82 +122,78 @@ package ALI is
       --  Id of last Sdep table entry for this file
 
       Main_Program : Main_Program_Type;
-      --  Indicator of whether first unit can be used as main program.
-      --  Not set if 'M' appears in Ignore_Lines.
+      --  Indicator of whether first unit can be used as main program. Not set
+      --  if 'M' appears in Ignore_Lines.
 
       Main_Priority : Int;
-      --  Indicates priority value if Main_Program field indicates that
-      --  this can be a main program. A value of -1 (No_Main_Priority)
-      --  indicates that no parameter was found, or no M line was present.
-      --  Not set if 'M' appears in Ignore_Lines.
+      --  Indicates priority value if Main_Program field indicates that this
+      --  can be a main program. A value of -1 (No_Main_Priority) indicates
+      --  that no parameter was found, or no M line was present. Not set if
+      --  'M' appears in Ignore_Lines.
 
       Time_Slice_Value : Int;
       --  Indicates value of time slice parameter from T=xxx on main program
-      --  line. A value of -1 indicates that no T=xxx parameter was found,
-      --  or no M line was present.
-      --  Not set if 'M' appears in Ignore_Lines.
+      --  line. A value of -1 indicates that no T=xxx parameter was found, or
+      --  no M line was present. Not set if 'M' appears in Ignore_Lines.
 
       WC_Encoding : Character;
       --  Wide character encoding if main procedure. Otherwise not relevant.
       --  Not set if 'M' appears in Ignore_Lines.
 
       Locking_Policy : Character;
-      --  Indicates locking policy for units in this file. Space means
-      --  tasking was not used, or that no Locking_Policy pragma was
-      --  present or that this is a language defined unit. Otherwise set
-      --  to first character (upper case) of policy name.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Indicates locking policy for units in this file. Space means tasking
+      --  was not used, or that no Locking_Policy pragma was present or that
+      --  this is a language defined unit. Otherwise set to first character
+      --  (upper case) of policy name. Not set if 'P' appears in Ignore_Lines.
 
       Queuing_Policy : Character;
-      --  Indicates queuing policy for units in this file. Space means
-      --  tasking was not used, or that no Queuing_Policy pragma was
-      --  present or that this is a language defined unit. Otherwise set
-      --  to first character (upper case) of policy name.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Indicates queuing policy for units in this file. Space means tasking
+      --  was not used, or that no Queuing_Policy pragma was present or that
+      --  this is a language defined unit. Otherwise set to first character
+      --  (upper case) of policy name. Not set if 'P' appears in Ignore_Lines.
 
       Task_Dispatching_Policy : Character;
-      --  Indicates task dispatching policy for units in this file. Space
-      --  means tasking was not used, or that no Task_Dispatching_Policy
-      --  pragma was present or that this is a language defined unit.
-      --  Otherwise set to first character (upper case) of policy name.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Indicates task dispatching policy for units in this file. Space means
+      --  tasking was not used, or that no Task_Dispatching_Policy pragma was
+      --  present or that this is a language defined unit. Otherwise set to
+      --  first character (upper case) of policy name. Not set if 'P' appears
+      --  in Ignore_Lines.
 
       Compile_Errors : Boolean;
-      --  Set to True if compile errors for unit. Note that No_Object
-      --  will always be set as well in this case.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Set to True if compile errors for unit. Note that No_Object will
+      --  always be set as well in this case. Not set if 'P' appears in
+      --  Ignore_Lines.
 
       Float_Format : Character;
-      --  Set to float format (set to I if no float-format given).
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Set to float format (set to I if no float-format given). Not set if
+      --  'P' appears in Ignore_Lines.
 
       No_Object : Boolean;
-      --  Set to True if no object file generated.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Set to True if no object file generated. Not set if 'P' appears in
+      --  Ignore_Lines.
 
       Normalize_Scalars : Boolean;
-      --  Set to True if file was compiled with Normalize_Scalars.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Set to True if file was compiled with Normalize_Scalars. Not set if
+      --  'P' appears in Ignore_Lines.
 
       Unit_Exception_Table : Boolean;
-      --  Set to True if unit exception table pointer generated.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Set to True if unit exception table pointer generated. Not set if 'P'
+      --  appears in Ignore_Lines.
 
       Zero_Cost_Exceptions : Boolean;
-      --  Set to True if file was compiled with zero cost exceptions.
-      --  Not set if 'P' appears in Ignore_Lines.
+      --  Set to True if file was compiled with zero cost exceptions. Not set
+      --  if 'P' appears in Ignore_Lines.
 
       Restrictions : Restrictions_Info;
       --  Restrictions information reconstructed from R lines
 
       First_Interrupt_State : Interrupt_State_Id;
       Last_Interrupt_State  : Interrupt_State_Id'Base;
-      --  These point to the first and last entries in the interrupt
-      --  state table for this unit. If there are no entries, then
-      --  Last_Interrupt_State = First_Interrupt_State - 1 (that's
-      --  why the 'Base reference is there, it can be one less than
-      --  the lower bound of the subtype).
-      --  Not set if 'I' appears in Ignore_Lines
+      --  These point to the first and last entries in the interrupt state
+      --  table for this unit. If no entries, then Last_Interrupt_State =
+      --  First_Interrupt_State - 1 (that's why the 'Base reference is there,
+      --  it can be one less than the lower bound of the subtype). Not set if
+      --  'I' appears in Ignore_Lines
 
       First_Specific_Dispatching : Priority_Specific_Dispatching_Id;
       Last_Specific_Dispatching  : Priority_Specific_Dispatching_Id'Base;
@@ -260,16 +256,16 @@ package ALI is
       --  have an elaboration routine (since it has no elaboration code).
 
       Pure : Boolean;
-      --  Indicates presence of PU parameter for a pure package
+      --  Indicates presence of PU parameter for a package having pragma Pure
 
       Dynamic_Elab : Boolean;
-      --  Set to True if the unit was compiled with dynamic elaboration
-      --  checks (i.e. either -gnatE or pragma Elaboration_Checks (RM)
-      --  was used to compile the unit).
+      --  Set to True if the unit was compiled with dynamic elaboration checks
+      --  (i.e. either -gnatE or pragma Elaboration_Checks (RM) was used to
+      --  compile the unit).
 
       Elaborate_Body : Boolean;
-      --  Indicates presence of EB parameter for a package which has a
-      --  pragma Preelaborate_Body.
+      --  Indicates presence of EB parameter for a package which has a pragma
+      --  Elaborate_Body, and also for generic package instantiations.
 
       Set_Elab_Entity : Boolean;
       --  Indicates presence of EE parameter for a unit which has an
@@ -277,20 +273,20 @@ package ALI is
       --  elaboration of the entity.
 
       Has_RACW : Boolean;
-      --  Indicates presence of RA parameter for a package that declares
-      --  at least one Remote Access to Class_Wide (RACW) object.
+      --  Indicates presence of RA parameter for a package that declares at
+      --  least one Remote Access to Class_Wide (RACW) object.
 
       Remote_Types : Boolean;
       --  Indicates presence of RT parameter for a package which has a
       --  pragma Remote_Types.
 
       Shared_Passive : Boolean;
-      --  Indicates presence of SP parameter for a package which has a
-      --  pragma Shared_Passive.
+      --  Indicates presence of SP parameter for a package which has a pragma
+      --  Shared_Passive.
 
       RCI : Boolean;
-      --  Indicates presence of RC parameter for a package which has a
-      --  pragma Remote_Call_Interface.
+      --  Indicates presence of RC parameter for a package which has a pragma
+      --  Remote_Call_Interface.
 
       Predefined : Boolean;
       --  Indicates if unit is language predefined (or a child of such a unit)
@@ -326,13 +322,13 @@ package ALI is
 
       Icasing : Casing_Type;
       --  Indicates casing of identifiers in source file for this unit. This
-      --  is used for informational output, and also for constructing the
-      --  main unit if it is being built in Ada.
+      --  is used for informational output, and also for constructing the main
+      --  unit if it is being built in Ada.
 
       Kcasing : Casing_Type;
-      --  Indicates casing of keyowords in source file for this unit. This
-      --  is used for informational output, and also for constructing the
-      --  main unit if it is being built in Ada.
+      --  Indicates casing of keywords in source file for this unit. This is
+      --  used for informational output, and also for constructing the main
+      --  unit if it is being built in Ada.
 
       Elab_Position : aliased Natural;
       --  Initialized to zero. Set non-zero when a unit is chosen and
@@ -357,6 +353,9 @@ package ALI is
       --  for the body right after the call for the spec, or at least as close
       --  together as possible.
 
+      Optimize_Alignment : Character;
+      --  Optimize_Alignment setting. Set to L/S/T/O for OL/OS/OT/OO present
+
    end record;
 
    package Units is new Table.Table (
@@ -445,7 +444,7 @@ package ALI is
 
    Float_Format_Specified : Character := ' ';
    --  Set to blank by Initialize_ALI. Set to appropriate float format
-   --  character (V or I, see Opt.Float_Format) if an an ali file that
+   --  character (V or I, see Opt.Float_Format) if an ali file that
    --  is read contains an F line setting the floating point format.
 
    Initialize_Scalars_Used : Boolean := False;
@@ -476,6 +475,10 @@ package ALI is
    --  ali files, showing whether a restriction pragma exists anywhere, and
    --  accumulating the aggregate knowledge of violations.
 
+   Stack_Check_Switch_Set : Boolean := False;
+   --  Set to True if at least one ALI file contains '-fstack-check' in its
+   --  argument list.
+
    Static_Elaboration_Model_Used : Boolean := False;
    --  Set to False by Initialize_ALI. Set to True if any ALI file for a
    --  non-internal unit compiled with the static elaboration model is
@@ -534,6 +537,8 @@ package ALI is
       SAL_Interface : Boolean := False;
       --  True if the Unit is an Interface of a Stand-Alone Library
 
+      Limited_With : Boolean := False;
+      --  True if unit is named in a limited_with_clause
    end record;
 
    package Withs is new Table.Table (
@@ -664,8 +669,8 @@ package ALI is
    -- Sdep (Source Dependency) Table --
    ------------------------------------
 
-   --  Each source dependency (D line) in an ALI file generates an
-   --  entry in the Sdep table.
+   --  Each source dependency (D line) in an ALI file generates an entry in the
+   --  Sdep table.
 
    --  Note: there will be no entries in this table if 'D' lines are ignored
 
@@ -673,9 +678,9 @@ package ALI is
    --  Special value indicating no Sdep table entry
 
    First_Sdep_Entry : Sdep_Id := No_Sdep_Id + 1;
-   --  Id of first Sdep entry for current ali file. This is initialized to
-   --  the first Sdep entry in the table, and then incremented appropriately
-   --  as successive ALI files are scanned.
+   --  Id of first Sdep entry for current ali file. This is initialized to the
+   --  first Sdep entry in the table, and then incremented appropriately as
+   --  successive ALI files are scanned.
 
    type Sdep_Record is record
 
@@ -683,24 +688,23 @@ package ALI is
       --  Name of source file
 
       Stamp : Time_Stamp_Type;
-      --  Time stamp value. Note that this will be all zero characters
-      --  for the dummy entries for missing or non-dependent files.
+      --  Time stamp value. Note that this will be all zero characters for the
+      --  dummy entries for missing or non-dependent files.
 
       Checksum : Word;
-      --  Checksum value. Note that this will be all zero characters
-      --  for the dummy entries for missing or non-dependent files
+      --  Checksum value. Note that this will be all zero characters for the
+      --  dummy entries for missing or non-dependent files
 
       Dummy_Entry : Boolean;
-      --  Set True for dummy entries that correspond to missing files
-      --  or files where no dependency relationship exists.
+      --  Set True for dummy entries that correspond to missing files or files
+      --  where no dependency relationship exists.
 
       Subunit_Name : Name_Id;
       --  Name_Id for subunit name if present, else No_Name
 
       Rfile : File_Name_Type;
-      --  Reference file name. Same as Sfile unless a Source_Reference
-      --  pragma was used, in which case it reflects the name used in
-      --  the pragma.
+      --  Reference file name. Same as Sfile unless a Source_Reference pragma
+      --  was used, in which case it reflects the name used in the pragma.
 
       Start_Line : Nat;
       --  Starting line number in file. Always 1, unless a Source_Reference
@@ -721,8 +725,8 @@ package ALI is
    -- Use of Name Table Info --
    ----------------------------
 
-   --  All unit names and file names are entered into the Names table. The
-   --  Info fields of these entries are used as follows:
+   --  All unit names and file names are entered into the Names table. The Info
+   --  fields of these entries are used as follows:
 
    --    Unit name           Info field has Unit_Id of unit table entry
    --    ALI file name       Info field has ALI_Id of ALI table entry
@@ -732,8 +736,8 @@ package ALI is
    -- Cross-Reference Data --
    --------------------------
 
-   --  The following table records cross-reference sections, there is one
-   --  entry for each X header line in the ALI file for an xref section.
+   --  The following table records cross-reference sections, there is one entry
+   --  for each X header line in the ALI file for an xref section.
 
    --  Note: there will be no entries in this table if 'X' lines are ignored
 
@@ -741,7 +745,7 @@ package ALI is
       File_Num : Sdep_Id;
       --  Dependency number for file (entry in Sdep.Table)
 
-      File_Name : Name_Id;
+      File_Name : File_Name_Type;
       --  Name of file
 
       First_Entity : Nat;
@@ -840,12 +844,12 @@ package ALI is
 
       Oref_File_Num : Sdep_Id;
       --  This field is set to No_Sdep_Id if the entity doesn't override any
-      --  other entity, or to the dependency reference for the overriden
+      --  other entity, or to the dependency reference for the overridden
       --  entity.
 
       Oref_Line : Nat;
       Oref_Col  : Nat;
-      --  These two fields are set to the line and column of the overriden
+      --  These two fields are set to the line and column of the overridden
       --  entity.
 
       First_Xref : Nat;
@@ -865,6 +869,13 @@ package ALI is
      Table_Increment      => 300,
      Table_Name           => "Xref_Entity");
 
+   Array_Index_Reference : constant Character := '*';
+   Interface_Reference   : constant Character := 'I';
+   --  Some special types of references. In the ALI file itself, these
+   --  are output as attributes of the entity, not as references, but
+   --  there is no provision in Xref_Entity_Record for storing multiple
+   --  such references.
+
    --  The following table records actual cross-references
 
    type Xref_Record is record
@@ -873,8 +884,9 @@ package ALI is
       --  that if no file entry is present explicitly, this is just a copy
       --  of the reference for the current cross-reference section.
 
-      Line : Pos;
-      --  Line number for the reference
+      Line : Nat;
+      --  Line number for the reference. This is zero when referencing a
+      --  predefined entity, but in this case Name is set.
 
       Rtype : Character;
       --  Indicates type of reference, using code used in ALI file:
@@ -884,11 +896,18 @@ package ALI is
       --    c = completion of private or incomplete type
       --    x = type extension
       --    i = implicit reference
+      --    Array_Index_Reference = reference to the index of an array
+      --    Interface_Reference   = reference to an interface implemented
+      --                            by the type
       --  See description in lib-xref.ads for further details
 
       Col : Nat;
       --  Column number for the reference
 
+      Name : Name_Id := No_Name;
+      --  This is only used when referencing a predefined entity. Currently,
+      --  this only occurs for array indexes.
+
       --  Note: for instantiation references, Rtype is set to ' ', and Col is
       --  set to zero. One or more such entries can follow any other reference.
       --  When there is more than one such entry, this is to be read as:
@@ -940,7 +959,7 @@ package ALI is
    --    Ignore_Lines requests that Scan_ALI ignore any lines that start
    --    with any given key character. The default value of X causes all
    --    Xref lines to be ignored. The corresponding data in the ALI
-   --    tables will not be filled in in this case. It is not possible
+   --    tables will not be filled in this case. It is not possible
    --    to ignore U (unit) lines, they are always read.
    --
    --    Read_Lines requests that Scan_ALI process only lines that start