Merge form mainline (hopefully)
[official-gcc.git] / gcc / ada / err_vars.ads
blob04ef8b200189e3b8ff4ecf901ca9847abb20b7ed
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- E R R _ V A R S --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 -- --
25 ------------------------------------------------------------------------------
27 -- This package contains variables common to error reporting packages
28 -- including Errout and Prj.Err.
30 with Types; use Types;
31 with Uintp; use Uintp;
33 package Err_Vars is
35 Serious_Errors_Detected : Nat;
36 -- This is a count of errors that are serious enough to stop expansion,
37 -- and hence to prevent generation of an object file even if the
38 -- switch -gnatQ is set.
40 Total_Errors_Detected : Nat;
41 -- Number of errors detected so far. Includes count of serious errors
42 -- and non-serious errors, so this value is always greater than or
43 -- equal to the Serious_Errors_Detected value.
45 Warnings_Detected : Nat;
46 -- Number of warnings detected
48 Current_Error_Source_File : Source_File_Index;
49 -- Id of current messages. Used to post file name when unit changes. This
50 -- is initialized to Main_Source_File at the start of a compilation, which
51 -- means that no file names will be output unless there are errors in units
52 -- other than the main unit. However, if the main unit has a pragma
53 -- Source_Reference line, then this is initialized to No_Source_File,
54 -- to force an initial reference to the real source file name.
56 Raise_Exception_On_Error : Nat := 0;
57 -- If this value is non-zero, then any attempt to generate an error
58 -- message raises the exception Error_Msg_Exception, and the error
59 -- message is not output. This is used for defending against junk
60 -- resulting from illegalities, and also for substitution of more
61 -- appropriate error messages from higher semantic levels. It is
62 -- a counter so that the increment/decrement protocol nests neatly.
64 Error_Msg_Exception : exception;
65 -- Exception raised if Raise_Exception_On_Error is true
67 -----------------------------------------------------
68 -- Global Values Used for Error Message Insertions --
69 -----------------------------------------------------
71 -- The following global variables are essentially additional parameters
72 -- passed to the error message routine for insertion sequences described
73 -- above. The reason these are passed globally is that the insertion
74 -- mechanism is essentially an untyped one in which the appropriate
75 -- variables are set dependingon the specific insertion characters used.
77 Error_Msg_Col : Column_Number;
78 -- Column for @ insertion character in message
80 Error_Msg_Uint_1 : Uint;
81 Error_Msg_Uint_2 : Uint;
82 -- Uint values for ^ insertion characters in message
84 Error_Msg_Sloc : Source_Ptr;
85 -- Source location for # insertion character in message
87 Error_Msg_Name_1 : Name_Id;
88 Error_Msg_Name_2 : Name_Id;
89 Error_Msg_Name_3 : Name_Id;
90 -- Name_Id values for % insertion characters in message
92 Error_Msg_Unit_1 : Name_Id;
93 Error_Msg_Unit_2 : Name_Id;
94 -- Name_Id values for $ insertion characters in message
96 Error_Msg_Node_1 : Node_Id;
97 Error_Msg_Node_2 : Node_Id;
98 -- Node_Id values for & insertion characters in message
100 Error_Msg_Qual_Level : Int := 0;
101 -- Number of levels of qualification required for type name (see the
102 -- description of the } insertion character. Note that this value does
103 -- note get reset by any Error_Msg call, so the caller is responsible
104 -- for resetting it.
106 Error_Msg_Warn : Boolean;
107 -- Used if current message contains a < insertion character to indicate
108 -- if the current message is a warning message.
110 Warn_On_Instance : Boolean := False;
111 -- Normally if a warning is generated in a generic template from the
112 -- analysis of the template, then the warning really belongs in the
113 -- template, and the default value of False for this Boolean achieves
114 -- that effect. If Warn_On_Instance is set True, then the warnings are
115 -- generated on the instantiation (referring to the template) rather
116 -- than on the template itself.
118 end Err_Vars;