annotate gcc/ada/errout.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- E R R O U T --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 -- This package contains the routines to output error messages. They are
kono
parents:
diff changeset
27 -- basically system independent, however in some environments, e.g. when the
kono
parents:
diff changeset
28 -- parser is embedded into an editor, it may be appropriate to replace the
kono
parents:
diff changeset
29 -- implementation of this package.
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 with Err_Vars;
kono
parents:
diff changeset
32 with Erroutc;
kono
parents:
diff changeset
33 with Namet; use Namet;
kono
parents:
diff changeset
34 with Table;
kono
parents:
diff changeset
35 with Types; use Types;
kono
parents:
diff changeset
36 with Uintp; use Uintp;
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 with System;
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 package Errout is
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 Current_Error_Source_File : Source_File_Index
kono
parents:
diff changeset
43 renames Err_Vars.Current_Error_Source_File;
kono
parents:
diff changeset
44 -- Id of current messages. Used to post file name when unit changes. This
kono
parents:
diff changeset
45 -- is initialized to Main_Source_File at the start of a compilation, which
kono
parents:
diff changeset
46 -- means that no file names will be output unless there are errors in
kono
parents:
diff changeset
47 -- units other than the main unit. However, if the main unit has a pragma
kono
parents:
diff changeset
48 -- Source_Reference line, then this is initialized to No_Source_File, to
kono
parents:
diff changeset
49 -- force an initial reference to the real source file name.
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 Raise_Exception_On_Error : Nat renames Err_Vars.Raise_Exception_On_Error;
kono
parents:
diff changeset
52 -- If this value is non-zero, then any attempt to generate an error
kono
parents:
diff changeset
53 -- message raises the exception Error_Msg_Exception, and the error message
kono
parents:
diff changeset
54 -- is not output. This is used for defending against junk resulting from
kono
parents:
diff changeset
55 -- illegalities, and also for substitution of more appropriate error
kono
parents:
diff changeset
56 -- messages from higher semantic levels. It is a counter so that the
kono
parents:
diff changeset
57 -- increment/decrement protocol nests neatly.
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 Error_Msg_Exception : exception renames Err_Vars.Error_Msg_Exception;
kono
parents:
diff changeset
60 -- Exception raised if Raise_Exception_On_Error is true
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 Warning_Doc_Switch : Boolean renames Err_Vars.Warning_Doc_Switch;
kono
parents:
diff changeset
63 -- If this is set True, then the ??/?*?/?$?/?x?/?X? insertion sequences in
kono
parents:
diff changeset
64 -- error messages generate appropriate tags for the output error messages.
kono
parents:
diff changeset
65 -- If this switch is False, then these sequences are still recognized (for
kono
parents:
diff changeset
66 -- the purposes of implementing the pattern matching in pragmas Warnings
kono
parents:
diff changeset
67 -- (Off,..) and Warning_As_Pragma(...) but do not result in adding the
kono
parents:
diff changeset
68 -- error message tag. The -gnatw.d switch sets this flag True, -gnatw.D
kono
parents:
diff changeset
69 -- sets this flag False.
kono
parents:
diff changeset
70
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
71 Current_Node : Node_Id := Empty;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
72 -- Used by Error_Msg as a default Node_Id.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
73 -- Relevant only when Opt.Include_Subprogram_In_Messages is set.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
74
111
kono
parents:
diff changeset
75 -----------------------------------
kono
parents:
diff changeset
76 -- Suppression of Error Messages --
kono
parents:
diff changeset
77 -----------------------------------
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 -- In an effort to reduce the impact of redundant error messages, the
kono
parents:
diff changeset
80 -- error output routines in this package normally suppress certain
kono
parents:
diff changeset
81 -- classes of messages as follows:
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 -- 1. Identical messages placed at the same point in the text. Such
kono
parents:
diff changeset
84 -- duplicate error message result for example from rescanning
kono
parents:
diff changeset
85 -- sections of the text that contain lexical errors. Only one of
kono
parents:
diff changeset
86 -- such a set of duplicate messages is output, and the rest are
kono
parents:
diff changeset
87 -- suppressed.
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 -- 2. If more than one parser message is generated for a single source
kono
parents:
diff changeset
90 -- line, then only the first message is output, the remaining
kono
parents:
diff changeset
91 -- messages on the same line are suppressed.
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 -- 3. If a message is posted on a node for which a message has been
kono
parents:
diff changeset
94 -- previously posted, then only the first message is retained. The
kono
parents:
diff changeset
95 -- Error_Posted flag is used to detect such multiple postings. Note
kono
parents:
diff changeset
96 -- that this only applies to semantic messages, since otherwise
kono
parents:
diff changeset
97 -- for parser messages, this would be a special case of case 2.
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 -- 4. If a message is posted on a node whose Etype or Entity
kono
parents:
diff changeset
100 -- fields reference entities on which an error message has
kono
parents:
diff changeset
101 -- already been placed, as indicated by the Error_Posted flag
kono
parents:
diff changeset
102 -- being set on these entities, then the message is suppressed.
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 -- 5. If a message attempts to insert an Error node, or a direct
kono
parents:
diff changeset
105 -- reference to the Any_Type node, then the message is suppressed.
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 -- 6. Note that cases 2-5 only apply to error messages, not warning
kono
parents:
diff changeset
108 -- messages. Warning messages are only suppressed for case 1, and
kono
parents:
diff changeset
109 -- when they come from other than the main extended unit.
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 -- 7. If an error or warning references an internal name, and we have
kono
parents:
diff changeset
112 -- already placed an error (not warning) message at that location,
kono
parents:
diff changeset
113 -- then we assume this is cascaded junk and delete the message.
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 -- This normal suppression action may be overridden in cases 2-5 (but not
kono
parents:
diff changeset
116 -- in case 1 or 7 by setting All_Errors mode, or by setting the special
kono
parents:
diff changeset
117 -- unconditional message insertion character (!) as described below.
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 ---------------------------------------------------------
kono
parents:
diff changeset
120 -- Error Message Text and Message Insertion Characters --
kono
parents:
diff changeset
121 ---------------------------------------------------------
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 -- Error message text strings are composed of lower case letters, digits
kono
parents:
diff changeset
124 -- and the special characters space, comma, period, colon and semicolon,
kono
parents:
diff changeset
125 -- apostrophe and parentheses. Special insertion characters can also
kono
parents:
diff changeset
126 -- appear which cause the error message circuit to modify the given
kono
parents:
diff changeset
127 -- string as follows:
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 -- Insertion character % (Percent: insert name from Names table)
kono
parents:
diff changeset
130 -- The character % is replaced by the text for the name specified by
kono
parents:
diff changeset
131 -- the Name_Id value stored in Error_Msg_Name_1. A blank precedes the
kono
parents:
diff changeset
132 -- name if it is preceded by a non-blank character other than left
kono
parents:
diff changeset
133 -- parenthesis. The name is enclosed in quotes unless manual quotation
kono
parents:
diff changeset
134 -- mode is set. If the Name_Id is set to No_Name, then no insertion
kono
parents:
diff changeset
135 -- occurs; if the Name_Id is set to Error_Name, then the string
kono
parents:
diff changeset
136 -- <error> is inserted. A second and third % may appear in a single
kono
parents:
diff changeset
137 -- message, similarly replaced by the names which are specified by the
kono
parents:
diff changeset
138 -- Name_Id values stored in Error_Msg_Name_2 and Error_Msg_Name_3. The
kono
parents:
diff changeset
139 -- names are decoded and cased according to the current identifier
kono
parents:
diff changeset
140 -- casing mode. Note: if a unit name ending with %b or %s is passed
kono
parents:
diff changeset
141 -- for this kind of insertion, this suffix is simply stripped. Use a
kono
parents:
diff changeset
142 -- unit name insertion ($) to process the suffix.
kono
parents:
diff changeset
143 --
kono
parents:
diff changeset
144 -- Note: the special names _xxx (xxx = Pre/Post/Invariant) are changed
kono
parents:
diff changeset
145 -- to insert the string xxx'Class into the message.
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 -- Insertion character %% (Double percent: insert literal name)
kono
parents:
diff changeset
148 -- The character sequence %% acts as described above for %, except
kono
parents:
diff changeset
149 -- that the name is simply obtained with Get_Name_String and is not
kono
parents:
diff changeset
150 -- decoded or cased, it is inserted literally from the names table.
kono
parents:
diff changeset
151 -- A trailing %b or %s is not treated specially.
kono
parents:
diff changeset
152 --
kono
parents:
diff changeset
153 -- Note: the special names _xxx (xxx = Pre/Post/Invariant) are changed
kono
parents:
diff changeset
154 -- to insert the string xxx'Class into the message.
kono
parents:
diff changeset
155
kono
parents:
diff changeset
156 -- Insertion character $ (Dollar: insert unit name from Names table)
kono
parents:
diff changeset
157 -- The character $ is treated similarly to %, except that the name is
kono
parents:
diff changeset
158 -- obtained from the Unit_Name_Type value in Error_Msg_Unit_1 and
kono
parents:
diff changeset
159 -- Error_Msg_Unit_2, as provided by Get_Unit_Name_String in package
kono
parents:
diff changeset
160 -- Uname. Note that this name includes the postfix (spec) or (body)
kono
parents:
diff changeset
161 -- strings. If this postfix is not required, use the normal % insertion
kono
parents:
diff changeset
162 -- for the unit name.
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 -- Insertion character { (Left brace: insert file name from names table)
kono
parents:
diff changeset
165 -- The character { is treated similarly to %, except that the input
kono
parents:
diff changeset
166 -- value is a File_Name_Type value stored in Error_Msg_File_1 or
kono
parents:
diff changeset
167 -- Error_Msg_File_2 or Error_Msg_File_3. The value is output literally,
kono
parents:
diff changeset
168 -- enclosed in quotes as for %, but the case is not modified, the
kono
parents:
diff changeset
169 -- insertion is the exact string stored in the names table without
kono
parents:
diff changeset
170 -- adjusting the casing.
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 -- Insertion character * (Asterisk: insert reserved word name)
kono
parents:
diff changeset
173 -- The insertion character * is treated exactly like % except that the
kono
parents:
diff changeset
174 -- resulting name is cased according to the default conventions for
kono
parents:
diff changeset
175 -- reserved words (see package Scans).
kono
parents:
diff changeset
176
kono
parents:
diff changeset
177 -- Insertion character & (Ampersand: insert name from node)
kono
parents:
diff changeset
178 -- The insertion character & is treated similarly to %, except that
kono
parents:
diff changeset
179 -- the name is taken from the Chars field of the given node, and may
kono
parents:
diff changeset
180 -- refer to a child unit name, or a selected component. The casing is,
kono
parents:
diff changeset
181 -- if possible, taken from the original source reference, which is
kono
parents:
diff changeset
182 -- obtained from the Sloc field of the given node or nodes. If no Sloc
kono
parents:
diff changeset
183 -- is available (happens e.g. for nodes in package Standard), then the
kono
parents:
diff changeset
184 -- default case (see Scans spec) is used. The nodes to be used are
kono
parents:
diff changeset
185 -- stored in Error_Msg_Node_1, Error_Msg_Node_2. No insertion occurs
kono
parents:
diff changeset
186 -- for the Empty node, and the Error node results in the insertion of
kono
parents:
diff changeset
187 -- the characters <error>. In addition, if the special global variable
kono
parents:
diff changeset
188 -- Error_Msg_Qual_Level is non-zero, then the reference will include
kono
parents:
diff changeset
189 -- up to the given number of levels of qualification, using the scope
kono
parents:
diff changeset
190 -- chain.
kono
parents:
diff changeset
191 --
kono
parents:
diff changeset
192 -- Note: the special names _xxx (xxx = Pre/Post/Invariant) are changed
kono
parents:
diff changeset
193 -- to insert the string xxx'Class into the message.
kono
parents:
diff changeset
194
kono
parents:
diff changeset
195 -- Insertion character # (Pound: insert line number reference)
kono
parents:
diff changeset
196 -- The character # is replaced by the string indicating the source
kono
parents:
diff changeset
197 -- position stored in Error_Msg_Sloc. There are three cases:
kono
parents:
diff changeset
198 --
kono
parents:
diff changeset
199 -- for package Standard: in package Standard
kono
parents:
diff changeset
200 -- for locations in current file: at line nnn:ccc
kono
parents:
diff changeset
201 -- for locations in other files: at filename:nnn:ccc
kono
parents:
diff changeset
202 --
kono
parents:
diff changeset
203 -- By convention, the # insertion character is only used at the end of
kono
parents:
diff changeset
204 -- an error message, so the above strings only appear as the last
kono
parents:
diff changeset
205 -- characters of an error message. The only exceptions to this rule
kono
parents:
diff changeset
206 -- are that an RM reference may follow in the form (RM .....) and a
kono
parents:
diff changeset
207 -- right parenthesis may immediately follow the #. In the case of
kono
parents:
diff changeset
208 -- continued messages, # can only appear at the end of a group of
kono
parents:
diff changeset
209 -- continuation messages, except that \\ messages which always start
kono
parents:
diff changeset
210 -- a new line end the sequence from the point of view of this rule.
kono
parents:
diff changeset
211 -- The idea is that for any use of -gnatj, it will still be the case
kono
parents:
diff changeset
212 -- that a location reference appears only at the end of a line.
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 -- Note: the output of the string "at " is suppressed if the string
kono
parents:
diff changeset
215 -- " from" or " from " immediately precedes the insertion character #.
kono
parents:
diff changeset
216 -- Certain messages read better with from than at.
kono
parents:
diff changeset
217
kono
parents:
diff changeset
218 -- Insertion character } (Right brace: insert type reference)
kono
parents:
diff changeset
219 -- The character } is replaced by a string describing the type
kono
parents:
diff changeset
220 -- referenced by the entity whose Id is stored in Error_Msg_Node_1.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
221 -- The string gives the name or description of the type, and also
111
kono
parents:
diff changeset
222 -- where appropriate the location of its declaration. Special cases
kono
parents:
diff changeset
223 -- like "some integer type" are handled appropriately. Only one } is
kono
parents:
diff changeset
224 -- allowed in a message, since there is not enough room for two (the
kono
parents:
diff changeset
225 -- insertion can be quite long, including a file name). In addition, if
kono
parents:
diff changeset
226 -- the special global variable Error_Msg_Qual_Level is non-zero, then
kono
parents:
diff changeset
227 -- the reference will include up to the given number of levels of
kono
parents:
diff changeset
228 -- qualification, using the scope chain.
kono
parents:
diff changeset
229
kono
parents:
diff changeset
230 -- Insertion character @ (At: insert column number reference)
kono
parents:
diff changeset
231 -- The character @ is replaced by null if the RM_Column_Check mode is
kono
parents:
diff changeset
232 -- off (False). If the switch is on (True), then @ is replaced by the
kono
parents:
diff changeset
233 -- text string " in column nnn" where nnn is the decimal
kono
parents:
diff changeset
234 -- representation of the column number stored in Error_Msg_Col plus
kono
parents:
diff changeset
235 -- one (the plus one is because the number is stored 0-origin and
kono
parents:
diff changeset
236 -- displayed 1-origin).
kono
parents:
diff changeset
237
kono
parents:
diff changeset
238 -- Insertion character ^ (Caret: insert integer value)
kono
parents:
diff changeset
239 -- The character ^ is replaced by the decimal conversion of the Uint
kono
parents:
diff changeset
240 -- value stored in Error_Msg_Uint_1, with a possible leading minus.
kono
parents:
diff changeset
241 -- A second ^ may occur in the message, in which case it is replaced
kono
parents:
diff changeset
242 -- by the decimal conversion of the Uint value in Error_Msg_Uint_2.
kono
parents:
diff changeset
243
kono
parents:
diff changeset
244 -- Insertion character > (Greater Than: run time name)
kono
parents:
diff changeset
245 -- The character > is replaced by a string of the form (name) if
kono
parents:
diff changeset
246 -- Targparm scanned out a Run_Time_Name (see package Targparm for
kono
parents:
diff changeset
247 -- details). The name is enclosed in parentheses and output in mixed
kono
parents:
diff changeset
248 -- case mode (upper case after any space in the name). If no run time
kono
parents:
diff changeset
249 -- name is defined, this insertion character has no effect.
kono
parents:
diff changeset
250
kono
parents:
diff changeset
251 -- Insertion character ! (Exclamation: unconditional message)
kono
parents:
diff changeset
252 -- The character ! appearing anywhere in the text of a message makes
kono
parents:
diff changeset
253 -- the message unconditional which means that it is output even if it
kono
parents:
diff changeset
254 -- would normally be suppressed. See section above for a description
kono
parents:
diff changeset
255 -- of the cases in which messages are normally suppressed. Note that
kono
parents:
diff changeset
256 -- in the case of warnings, the meaning is that the warning should not
kono
parents:
diff changeset
257 -- be removed in dead code (that's the only time that the use of !
kono
parents:
diff changeset
258 -- has any effect for a warning).
kono
parents:
diff changeset
259 --
kono
parents:
diff changeset
260 -- Note: the presence of ! is ignored in continuation messages (i.e.
kono
parents:
diff changeset
261 -- messages starting with the \ insertion character). The effect of the
kono
parents:
diff changeset
262 -- use of ! in a parent message automatically applies to all of its
kono
parents:
diff changeset
263 -- continuation messages (since we clearly don't want any case in which
kono
parents:
diff changeset
264 -- continuations are separated from the main message). It is allowable
kono
parents:
diff changeset
265 -- to put ! in continuation messages, and the usual style is to include
kono
parents:
diff changeset
266 -- it, since it makes it clear that the continuation is part of an
kono
parents:
diff changeset
267 -- unconditional message.
kono
parents:
diff changeset
268
kono
parents:
diff changeset
269 -- Insertion character !! (Double exclamation: unconditional warning)
kono
parents:
diff changeset
270 -- Normally warning messages issued in other than the main unit are
kono
parents:
diff changeset
271 -- suppressed. If the message contains !! then this suppression is
kono
parents:
diff changeset
272 -- avoided. This is currently used by the Compile_Time_Warning pragma
kono
parents:
diff changeset
273 -- to ensure the message for a with'ed unit is output, and for warnings
kono
parents:
diff changeset
274 -- on ineffective back-end inlining, which is detected in units that
kono
parents:
diff changeset
275 -- contain subprograms to be inlined in the main program. It is also
kono
parents:
diff changeset
276 -- used by the Compiler_Unit_Warning pragma for similar reasons.
kono
parents:
diff changeset
277
kono
parents:
diff changeset
278 -- Insertion character ? (Question: warning message)
kono
parents:
diff changeset
279 -- The character ? appearing anywhere in a message makes the message
kono
parents:
diff changeset
280 -- warning instead of a normal error message, and the text of the
kono
parents:
diff changeset
281 -- message will be preceded by "warning:" in the normal case. The
kono
parents:
diff changeset
282 -- handling of warnings if further controlled by the Warning_Mode
kono
parents:
diff changeset
283 -- option (-w switch), see package Opt for further details, and also by
kono
parents:
diff changeset
284 -- the current setting from pragma Warnings. This pragma applies only
kono
parents:
diff changeset
285 -- to warnings issued from the semantic phase (not the parser), but
kono
parents:
diff changeset
286 -- currently all relevant warnings are posted by the semantic phase
kono
parents:
diff changeset
287 -- anyway. Messages starting with (style) are also treated as warning
kono
parents:
diff changeset
288 -- messages.
kono
parents:
diff changeset
289 --
kono
parents:
diff changeset
290 -- Note: when a warning message is output, the text of the message is
kono
parents:
diff changeset
291 -- preceded by "warning: " in the normal case. An exception to this
kono
parents:
diff changeset
292 -- rule occurs when the text of the message starts with "info: " in
kono
parents:
diff changeset
293 -- which case this string is not prepended. This allows callers to
kono
parents:
diff changeset
294 -- label certain warnings as informational messages, rather than as
kono
parents:
diff changeset
295 -- warning messages requiring some action.
kono
parents:
diff changeset
296 --
kono
parents:
diff changeset
297 -- Note: the presence of ? is ignored in continuation messages (i.e.
kono
parents:
diff changeset
298 -- messages starting with the \ insertion character). The warning
kono
parents:
diff changeset
299 -- status of continuations is determined only by the parent message
kono
parents:
diff changeset
300 -- which is being continued. It is allowable to put ? in continuation
kono
parents:
diff changeset
301 -- messages, and the usual style is to include it, since it makes it
kono
parents:
diff changeset
302 -- clear that the continuation is part of a warning message, but it is
kono
parents:
diff changeset
303 -- not necessary to go through any computational effort to include it.
kono
parents:
diff changeset
304 --
kono
parents:
diff changeset
305 -- Note: this usage is obsolete, use ?? ?*? ?$? ?x? ?X? to specify
kono
parents:
diff changeset
306 -- the string to be added when Warn_Doc_Switch is set to True. If this
kono
parents:
diff changeset
307 -- switch is True, then for simple ? messages it has no effect. This
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
308 -- simple form is to ease transition and may be removed later except
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
309 -- for GNATprove-specific messages (info and warnings) which are not
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
310 -- subject to the same GNAT warning switches.
111
kono
parents:
diff changeset
311
kono
parents:
diff changeset
312 -- Insertion character ?? (Two question marks: default warning)
kono
parents:
diff changeset
313 -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
kono
parents:
diff changeset
314 -- "[enabled by default]" at the end of the warning message. For
kono
parents:
diff changeset
315 -- continuations, use this in each continuation message.
kono
parents:
diff changeset
316
kono
parents:
diff changeset
317 -- Insertion character ?x? (warning with switch)
kono
parents:
diff changeset
318 -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
kono
parents:
diff changeset
319 -- "[-gnatwx]" at the end of the warning message. x is a lower case
kono
parents:
diff changeset
320 -- letter. For continuations, use this on each continuation message.
kono
parents:
diff changeset
321
kono
parents:
diff changeset
322 -- Insertion character ?X? (warning with dot switch)
kono
parents:
diff changeset
323 -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
kono
parents:
diff changeset
324 -- "[-gnatw.x]" at the end of the warning message. X is an upper case
kono
parents:
diff changeset
325 -- letter corresponding to the lower case letter x in the message.
kono
parents:
diff changeset
326 -- For continuations, use this on each continuation message.
kono
parents:
diff changeset
327
kono
parents:
diff changeset
328 -- Insertion character ?*? (restriction warning)
kono
parents:
diff changeset
329 -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
kono
parents:
diff changeset
330 -- "[restriction warning]" at the end of the warning message. For
kono
parents:
diff changeset
331 -- continuations, use this on each continuation message.
kono
parents:
diff changeset
332
kono
parents:
diff changeset
333 -- Insertion character ?$? (elaboration informational messages)
kono
parents:
diff changeset
334 -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
kono
parents:
diff changeset
335 -- "[-gnatel]" at the end of the info message. This is used for the
kono
parents:
diff changeset
336 -- messages generated by the switch -gnatel. For continuations, use
kono
parents:
diff changeset
337 -- this on each continuation message.
kono
parents:
diff changeset
338
kono
parents:
diff changeset
339 -- Insertion character < (Less Than: conditional warning message)
kono
parents:
diff changeset
340 -- The character < appearing anywhere in a message is used for a
kono
parents:
diff changeset
341 -- conditional error message. If Error_Msg_Warn is True, then the
kono
parents:
diff changeset
342 -- effect is the same as ? described above, and in particular << <X<
kono
parents:
diff changeset
343 -- <x< <$< <*< have the effect of ?? ?X? ?x? ?$? ?*? respectively. If
kono
parents:
diff changeset
344 -- Error_Msg_Warn is False, then the < << or <X< sequence is ignored
kono
parents:
diff changeset
345 -- and the message is treated as a error rather than a warning.
kono
parents:
diff changeset
346
kono
parents:
diff changeset
347 -- Insertion character A-Z (Upper case letter: Ada reserved word)
kono
parents:
diff changeset
348 -- If two or more upper case letters appear in the message, they are
kono
parents:
diff changeset
349 -- taken as an Ada reserved word, and are converted to the default
kono
parents:
diff changeset
350 -- case for reserved words (see Scans package spec). Surrounding
kono
parents:
diff changeset
351 -- quotes are added unless manual quotation mode is currently set.
kono
parents:
diff changeset
352 -- RM and SPARK are special exceptions, they are never treated as
kono
parents:
diff changeset
353 -- keywords, and just appear verbatim, with no surrounding quotes.
kono
parents:
diff changeset
354 -- As a special case, 'R'M is used instead of RM (which is not treated
kono
parents:
diff changeset
355 -- as a keyword) to indicate when the reference to the RM is possibly
kono
parents:
diff changeset
356 -- not useful anymore, and could possibly be replaced by a comment
kono
parents:
diff changeset
357 -- in the source.
kono
parents:
diff changeset
358
kono
parents:
diff changeset
359 -- Insertion character ` (Backquote: set manual quotation mode)
kono
parents:
diff changeset
360 -- The backquote character always appears in pairs. Each backquote of
kono
parents:
diff changeset
361 -- the pair is replaced by a double quote character. In addition, any
kono
parents:
diff changeset
362 -- reserved keywords, or name insertions between these backquotes are
kono
parents:
diff changeset
363 -- not surrounded by the usual automatic double quotes. See the
kono
parents:
diff changeset
364 -- section below on manual quotation mode for further details.
kono
parents:
diff changeset
365
kono
parents:
diff changeset
366 -- Insertion character ' (Quote: literal character)
kono
parents:
diff changeset
367 -- Precedes a character which is placed literally into the message.
kono
parents:
diff changeset
368 -- Used to insert characters into messages that are one of the
kono
parents:
diff changeset
369 -- insertion characters defined here. Also used for insertion of
kono
parents:
diff changeset
370 -- upper case letter sequences not to be treated as keywords.
kono
parents:
diff changeset
371
kono
parents:
diff changeset
372 -- Insertion character \ (Backslash: continuation message)
kono
parents:
diff changeset
373 -- Indicates that the message is a continuation of a message
kono
parents:
diff changeset
374 -- previously posted. This is used to ensure that such groups of
kono
parents:
diff changeset
375 -- messages are treated as a unit. The \ character must be the first
kono
parents:
diff changeset
376 -- character of the message text.
kono
parents:
diff changeset
377
kono
parents:
diff changeset
378 -- Insertion character \\ (Two backslashes: continuation with new line)
kono
parents:
diff changeset
379 -- This differs from \ only in -gnatjnn mode (Error_Message_Line_Length
kono
parents:
diff changeset
380 -- set non-zero). This sequence forces a new line to start even when
kono
parents:
diff changeset
381 -- continuations are being gathered into a single message.
kono
parents:
diff changeset
382
kono
parents:
diff changeset
383 -- Insertion character | (Vertical bar: non-serious error)
kono
parents:
diff changeset
384 -- By default, error messages (other than warning messages) are
kono
parents:
diff changeset
385 -- considered to be fatal error messages which prevent expansion or
kono
parents:
diff changeset
386 -- generation of code in the presence of the -gnatQ switch. If the
kono
parents:
diff changeset
387 -- insertion character | appears, the message is considered to be
kono
parents:
diff changeset
388 -- non-serious, and does not cause Serious_Errors_Detected to be
kono
parents:
diff changeset
389 -- incremented (so expansion is not prevented by such a msg). This
kono
parents:
diff changeset
390 -- insertion character is ignored in continuation messages.
kono
parents:
diff changeset
391
kono
parents:
diff changeset
392 -- Insertion character ~ (Tilde: insert string)
kono
parents:
diff changeset
393 -- Indicates that Error_Msg_String (1 .. Error_Msg_Strlen) is to be
kono
parents:
diff changeset
394 -- inserted to replace the ~ character. The string is inserted in the
kono
parents:
diff changeset
395 -- literal form it appears, without any action on special characters.
kono
parents:
diff changeset
396
kono
parents:
diff changeset
397 -- Insertion character [ (Left bracket: will/would be raised at run time)
kono
parents:
diff changeset
398 -- This is used in messages about exceptions being raised at run-time.
kono
parents:
diff changeset
399 -- If the current message is a warning message, then if the code is
kono
parents:
diff changeset
400 -- executed, the exception will be raised, and [ inserts:
kono
parents:
diff changeset
401 --
kono
parents:
diff changeset
402 -- will be raised at run time
kono
parents:
diff changeset
403 --
kono
parents:
diff changeset
404 -- If the current message is an error message, then it is an error
kono
parents:
diff changeset
405 -- because the exception would have been raised and [ inserts:
kono
parents:
diff changeset
406 --
kono
parents:
diff changeset
407 -- would have been raised at run time
kono
parents:
diff changeset
408 --
kono
parents:
diff changeset
409 -- Typically the message contains a < insertion which means that the
kono
parents:
diff changeset
410 -- message is a warning or error depending on Error_Msg_Warn. This is
kono
parents:
diff changeset
411 -- most typically used in the context of messages which are normally
kono
parents:
diff changeset
412 -- warnings, but are errors in GNATprove mode, corresponding to the
kono
parents:
diff changeset
413 -- permission in the definition of SPARK that allows an implementation
kono
parents:
diff changeset
414 -- to reject a program as illegal if a situation arises in which the
kono
parents:
diff changeset
415 -- compiler can determine that it is certain that a run-time check
kono
parents:
diff changeset
416 -- would have fail if the statement was executed.
kono
parents:
diff changeset
417
kono
parents:
diff changeset
418 -- Insertion character ] (Right bracket: may/might be raised at run time)
kono
parents:
diff changeset
419 -- This is like [ except that the insertion messages say may/might,
kono
parents:
diff changeset
420 -- instead of will/would.
kono
parents:
diff changeset
421
kono
parents:
diff changeset
422 -- Insertion sequence "(style)" (style message)
kono
parents:
diff changeset
423 -- This appears only at the start of the message (and not any of its
kono
parents:
diff changeset
424 -- continuations, if any), and indicates that the message is a style
kono
parents:
diff changeset
425 -- message. Style messages are also considered to be warnings, but
kono
parents:
diff changeset
426 -- they do not get a tag.
kono
parents:
diff changeset
427
kono
parents:
diff changeset
428 -- Insertion sequence "info: " (informational message)
kono
parents:
diff changeset
429 -- This appears only at the start of the message (and not any of its
kono
parents:
diff changeset
430 -- continuations, if any), and indicates that the message is an info
kono
parents:
diff changeset
431 -- message. The message will be output with this prefix, and if there
kono
parents:
diff changeset
432 -- are continuations that are not printed using the -gnatj switch they
kono
parents:
diff changeset
433 -- will also have this prefix. Informational messages are usually also
kono
parents:
diff changeset
434 -- warnings, but they don't have to be.
kono
parents:
diff changeset
435
kono
parents:
diff changeset
436 -- Insertion sequence "low: " or "medium: " or "high: " (check message)
kono
parents:
diff changeset
437 -- This appears only at the start of the message (and not any of its
kono
parents:
diff changeset
438 -- continuations, if any), and indicates that the message is a check
kono
parents:
diff changeset
439 -- message. The message will be output with this prefix. Check
kono
parents:
diff changeset
440 -- messages are not fatal (so are like info messages in that respect)
kono
parents:
diff changeset
441 -- and are not controlled by pragma Warnings.
kono
parents:
diff changeset
442
kono
parents:
diff changeset
443 -----------------------------------------------------
kono
parents:
diff changeset
444 -- Global Values Used for Error Message Insertions --
kono
parents:
diff changeset
445 -----------------------------------------------------
kono
parents:
diff changeset
446
kono
parents:
diff changeset
447 -- The following global variables are essentially additional parameters
kono
parents:
diff changeset
448 -- passed to the error message routine for insertion sequences described
kono
parents:
diff changeset
449 -- above. The reason these are passed globally is that the insertion
kono
parents:
diff changeset
450 -- mechanism is essentially an untyped one in which the appropriate
kono
parents:
diff changeset
451 -- variables are set depending on the specific insertion characters used.
kono
parents:
diff changeset
452
kono
parents:
diff changeset
453 -- Note that is mandatory that the caller ensure that global variables
kono
parents:
diff changeset
454 -- are set before the Error_Msg call, otherwise the result is undefined.
kono
parents:
diff changeset
455
kono
parents:
diff changeset
456 Error_Msg_Col : Column_Number renames Err_Vars.Error_Msg_Col;
kono
parents:
diff changeset
457 -- Column for @ insertion character in message
kono
parents:
diff changeset
458
kono
parents:
diff changeset
459 Error_Msg_Uint_1 : Uint renames Err_Vars.Error_Msg_Uint_1;
kono
parents:
diff changeset
460 Error_Msg_Uint_2 : Uint renames Err_Vars.Error_Msg_Uint_2;
kono
parents:
diff changeset
461 -- Uint values for ^ insertion characters in message
kono
parents:
diff changeset
462
kono
parents:
diff changeset
463 Error_Msg_Sloc : Source_Ptr renames Err_Vars.Error_Msg_Sloc;
kono
parents:
diff changeset
464 -- Source location for # insertion character in message
kono
parents:
diff changeset
465
kono
parents:
diff changeset
466 Error_Msg_Name_1 : Name_Id renames Err_Vars.Error_Msg_Name_1;
kono
parents:
diff changeset
467 Error_Msg_Name_2 : Name_Id renames Err_Vars.Error_Msg_Name_2;
kono
parents:
diff changeset
468 Error_Msg_Name_3 : Name_Id renames Err_Vars.Error_Msg_Name_3;
kono
parents:
diff changeset
469 -- Name_Id values for % insertion characters in message
kono
parents:
diff changeset
470
kono
parents:
diff changeset
471 Error_Msg_File_1 : File_Name_Type renames Err_Vars.Error_Msg_File_1;
kono
parents:
diff changeset
472 Error_Msg_File_2 : File_Name_Type renames Err_Vars.Error_Msg_File_2;
kono
parents:
diff changeset
473 Error_Msg_File_3 : File_Name_Type renames Err_Vars.Error_Msg_File_3;
kono
parents:
diff changeset
474 -- File_Name_Type values for { insertion characters in message
kono
parents:
diff changeset
475
kono
parents:
diff changeset
476 Error_Msg_Unit_1 : Unit_Name_Type renames Err_Vars.Error_Msg_Unit_1;
kono
parents:
diff changeset
477 Error_Msg_Unit_2 : Unit_Name_Type renames Err_Vars.Error_Msg_Unit_2;
kono
parents:
diff changeset
478 -- Unit_Name_Type values for $ insertion characters in message
kono
parents:
diff changeset
479
kono
parents:
diff changeset
480 Error_Msg_Node_1 : Node_Id renames Err_Vars.Error_Msg_Node_1;
kono
parents:
diff changeset
481 Error_Msg_Node_2 : Node_Id renames Err_Vars.Error_Msg_Node_2;
kono
parents:
diff changeset
482 -- Node_Id values for & insertion characters in message
kono
parents:
diff changeset
483
kono
parents:
diff changeset
484 Error_Msg_Qual_Level : Nat renames Err_Vars.Error_Msg_Qual_Level;
kono
parents:
diff changeset
485 -- Number of levels of qualification required for type name (see the
kono
parents:
diff changeset
486 -- description of the } insertion character). Note that this value does
kono
parents:
diff changeset
487 -- not get reset by any Error_Msg call, so the caller is responsible
kono
parents:
diff changeset
488 -- for resetting it.
kono
parents:
diff changeset
489
kono
parents:
diff changeset
490 Error_Msg_Warn : Boolean renames Err_Vars.Error_Msg_Warn;
kono
parents:
diff changeset
491 -- Used if current message contains a < insertion character to indicate
kono
parents:
diff changeset
492 -- if the current message is a warning message. Must be set appropriately
kono
parents:
diff changeset
493 -- before any call to Error_Msg_xxx with a < insertion character present.
kono
parents:
diff changeset
494 -- Setting is irrelevant if no < insertion character is present.
kono
parents:
diff changeset
495
kono
parents:
diff changeset
496 Error_Msg_String : String renames Err_Vars.Error_Msg_String;
kono
parents:
diff changeset
497 Error_Msg_Strlen : Natural renames Err_Vars.Error_Msg_Strlen;
kono
parents:
diff changeset
498 -- Used if current message contains a ~ insertion character to indicate
kono
parents:
diff changeset
499 -- insertion of the string Error_Msg_String (1 .. Error_Msg_Strlen).
kono
parents:
diff changeset
500
kono
parents:
diff changeset
501 -----------------------------------------------------
kono
parents:
diff changeset
502 -- Format of Messages and Manual Quotation Control --
kono
parents:
diff changeset
503 -----------------------------------------------------
kono
parents:
diff changeset
504
kono
parents:
diff changeset
505 -- Messages are generally all in lower case, except for inserted names
kono
parents:
diff changeset
506 -- and appear in one of the following three forms:
kono
parents:
diff changeset
507
kono
parents:
diff changeset
508 -- error: text
kono
parents:
diff changeset
509 -- warning: text
kono
parents:
diff changeset
510
kono
parents:
diff changeset
511 -- The prefixes error and warning are supplied automatically (depending
kono
parents:
diff changeset
512 -- on the use of the ? insertion character), and the call to the error
kono
parents:
diff changeset
513 -- message routine supplies the text. The "error: " prefix is omitted
kono
parents:
diff changeset
514 -- in brief error message formats.
kono
parents:
diff changeset
515
kono
parents:
diff changeset
516 -- Reserved Ada keywords in the message are in the default keyword case
kono
parents:
diff changeset
517 -- (determined from the given source program), surrounded by quotation
kono
parents:
diff changeset
518 -- marks. This is achieved by spelling the reserved word in upper case
kono
parents:
diff changeset
519 -- letters, which is recognized as a request for insertion of quotation
kono
parents:
diff changeset
520 -- marks by the error text processor. Thus for example:
kono
parents:
diff changeset
521
kono
parents:
diff changeset
522 -- Error_Msg_AP ("IS expected");
kono
parents:
diff changeset
523
kono
parents:
diff changeset
524 -- would result in the output of one of the following:
kono
parents:
diff changeset
525
kono
parents:
diff changeset
526 -- error: "is" expected
kono
parents:
diff changeset
527 -- error: "IS" expected
kono
parents:
diff changeset
528 -- error: "Is" expected
kono
parents:
diff changeset
529
kono
parents:
diff changeset
530 -- the choice between these being made by looking at the casing convention
kono
parents:
diff changeset
531 -- used for keywords (actually the first compilation unit keyword) in the
kono
parents:
diff changeset
532 -- source file.
kono
parents:
diff changeset
533
kono
parents:
diff changeset
534 -- Note: a special exception is that RM is never treated as a keyword
kono
parents:
diff changeset
535 -- but instead is copied literally into the message, this avoids the
kono
parents:
diff changeset
536 -- need for writing 'R'M for all reference manual quotes. A similar
kono
parents:
diff changeset
537 -- exception is applied to the occurrence of the string SPARK used in
kono
parents:
diff changeset
538 -- error messages about the SPARK subset of Ada.
kono
parents:
diff changeset
539
kono
parents:
diff changeset
540 -- In the case of names, the default mode for the error text processor
kono
parents:
diff changeset
541 -- is to surround the name by quotation marks automatically. The case
kono
parents:
diff changeset
542 -- used for the identifier names is taken from the source program where
kono
parents:
diff changeset
543 -- possible, and otherwise is the default casing convention taken from
kono
parents:
diff changeset
544 -- the source file usage.
kono
parents:
diff changeset
545
kono
parents:
diff changeset
546 -- In some cases, better control over the placement of quote marks is
kono
parents:
diff changeset
547 -- required. This is achieved using manual quotation mode. In this mode,
kono
parents:
diff changeset
548 -- one or more insertion sequences is surrounded by backquote characters.
kono
parents:
diff changeset
549 -- The backquote characters are output as double quote marks, and normal
kono
parents:
diff changeset
550 -- automatic insertion of quotes is suppressed between the double quotes.
kono
parents:
diff changeset
551 -- For example:
kono
parents:
diff changeset
552
kono
parents:
diff changeset
553 -- Error_Msg_AP ("`END &;` expected");
kono
parents:
diff changeset
554
kono
parents:
diff changeset
555 -- generates a message like
kono
parents:
diff changeset
556
kono
parents:
diff changeset
557 -- error: "end Open_Scope;" expected
kono
parents:
diff changeset
558
kono
parents:
diff changeset
559 -- where the node specifying the name Open_Scope has been stored in
kono
parents:
diff changeset
560 -- Error_Msg_Node_1 prior to the call. The great majority of error
kono
parents:
diff changeset
561 -- messages operates in normal quotation mode.
kono
parents:
diff changeset
562
kono
parents:
diff changeset
563 -- Note: the normal automatic insertion of spaces before insertion
kono
parents:
diff changeset
564 -- sequences (such as those that come from & and %) is suppressed in
kono
parents:
diff changeset
565 -- manual quotation mode, so blanks, if needed as in the above example,
kono
parents:
diff changeset
566 -- must be explicitly present.
kono
parents:
diff changeset
567
kono
parents:
diff changeset
568 ----------------------------
kono
parents:
diff changeset
569 -- Message ID Definitions --
kono
parents:
diff changeset
570 ----------------------------
kono
parents:
diff changeset
571
kono
parents:
diff changeset
572 subtype Error_Msg_Id is Erroutc.Error_Msg_Id;
kono
parents:
diff changeset
573 function "=" (Left, Right : Error_Msg_Id) return Boolean
kono
parents:
diff changeset
574 renames Erroutc."=";
kono
parents:
diff changeset
575 -- A type used to represent specific error messages. Used by the clients
kono
parents:
diff changeset
576 -- of this package only in the context of the Get_Error_Id and
kono
parents:
diff changeset
577 -- Change_Error_Text subprograms.
kono
parents:
diff changeset
578
kono
parents:
diff changeset
579 No_Error_Msg : constant Error_Msg_Id := Erroutc.No_Error_Msg;
kono
parents:
diff changeset
580 -- A constant which is different from any value returned by Get_Error_Id.
kono
parents:
diff changeset
581 -- Typically used by a client to indicate absense of a saved Id value.
kono
parents:
diff changeset
582
kono
parents:
diff changeset
583 Warning_Msg : Error_Msg_Id := No_Error_Msg;
kono
parents:
diff changeset
584 -- This is set if a warning message is generated to the ID of the resulting
kono
parents:
diff changeset
585 -- message. Continuation messages have no effect. It is legitimate for the
kono
parents:
diff changeset
586 -- client to set this to No_Error_Msg and then test it to see if a warning
kono
parents:
diff changeset
587 -- message has been issued.
kono
parents:
diff changeset
588
kono
parents:
diff changeset
589 procedure Delete_Warning_And_Continuations (Msg : Error_Msg_Id);
kono
parents:
diff changeset
590 -- Deletes the given warning message and all its continuations. This is
kono
parents:
diff changeset
591 -- typically used in conjunction with reading the value of Warning_Msg.
kono
parents:
diff changeset
592
kono
parents:
diff changeset
593 function Get_Msg_Id return Error_Msg_Id renames Erroutc.Get_Msg_Id;
kono
parents:
diff changeset
594 -- Returns the Id of the message most recently posted using one of the
kono
parents:
diff changeset
595 -- Error_Msg routines.
kono
parents:
diff changeset
596
kono
parents:
diff changeset
597 function Get_Location (E : Error_Msg_Id) return Source_Ptr
kono
parents:
diff changeset
598 renames Erroutc.Get_Location;
kono
parents:
diff changeset
599 -- Returns the flag location of the error message with the given id E
kono
parents:
diff changeset
600
kono
parents:
diff changeset
601 ------------------------
kono
parents:
diff changeset
602 -- List Pragmas Table --
kono
parents:
diff changeset
603 ------------------------
kono
parents:
diff changeset
604
kono
parents:
diff changeset
605 -- When a pragma Page or pragma List is encountered by the parser, an
kono
parents:
diff changeset
606 -- entry is made in the following table. This table is then used to
kono
parents:
diff changeset
607 -- control the full listing if one is being generated. Note that the
kono
parents:
diff changeset
608 -- reason we do the processing in the parser is so that we get proper
kono
parents:
diff changeset
609 -- listing control even in syntax check only mode.
kono
parents:
diff changeset
610
kono
parents:
diff changeset
611 type List_Pragma_Type is (List_On, List_Off, Page);
kono
parents:
diff changeset
612
kono
parents:
diff changeset
613 type List_Pragma_Record is record
kono
parents:
diff changeset
614 Ptyp : List_Pragma_Type;
kono
parents:
diff changeset
615 Ploc : Source_Ptr;
kono
parents:
diff changeset
616 end record;
kono
parents:
diff changeset
617
kono
parents:
diff changeset
618 -- Note: Ploc points to the terminating semicolon in the List_Off and Page
kono
parents:
diff changeset
619 -- cases, and to the pragma keyword for List_On. In the case of a pragma
kono
parents:
diff changeset
620 -- List_Off, a List_On entry is also made in the table, pointing to the
kono
parents:
diff changeset
621 -- pragma keyword. This ensures that, as required, a List (Off) pragma is
kono
parents:
diff changeset
622 -- listed even in list off mode.
kono
parents:
diff changeset
623
kono
parents:
diff changeset
624 package List_Pragmas is new Table.Table (
kono
parents:
diff changeset
625 Table_Component_Type => List_Pragma_Record,
kono
parents:
diff changeset
626 Table_Index_Type => Int,
kono
parents:
diff changeset
627 Table_Low_Bound => 1,
kono
parents:
diff changeset
628 Table_Initial => 50,
kono
parents:
diff changeset
629 Table_Increment => 200,
kono
parents:
diff changeset
630 Table_Name => "List_Pragmas");
kono
parents:
diff changeset
631
kono
parents:
diff changeset
632 ---------------------------
kono
parents:
diff changeset
633 -- Ignore_Errors Feature --
kono
parents:
diff changeset
634 ---------------------------
kono
parents:
diff changeset
635
kono
parents:
diff changeset
636 -- In certain cases, notably for optional subunits, the compiler operates
kono
parents:
diff changeset
637 -- in a mode where errors are to be ignored, and the whole unit is to be
kono
parents:
diff changeset
638 -- considered as not present. To implement this we provide the following
kono
parents:
diff changeset
639 -- flag to enable special handling, where error messages are suppressed,
kono
parents:
diff changeset
640 -- but the Fatal_Error flag will still be set in the normal manner.
kono
parents:
diff changeset
641
kono
parents:
diff changeset
642 Ignore_Errors_Enable : Nat := 0;
kono
parents:
diff changeset
643 -- Triggering switch. If non-zero, then ignore errors mode is activated.
kono
parents:
diff changeset
644 -- This is a counter to allow convenient nesting of enable/disable.
kono
parents:
diff changeset
645
kono
parents:
diff changeset
646 -----------------------
kono
parents:
diff changeset
647 -- CODEFIX Facility --
kono
parents:
diff changeset
648 -----------------------
kono
parents:
diff changeset
649
kono
parents:
diff changeset
650 -- The GPS and GNATBench IDE's have a codefix facility that allows for
kono
parents:
diff changeset
651 -- automatic correction of a subset of the errors and warnings issued
kono
parents:
diff changeset
652 -- by the compiler. This is done by recognizing the text of specific
kono
parents:
diff changeset
653 -- messages using appropriate matching patterns.
kono
parents:
diff changeset
654
kono
parents:
diff changeset
655 -- The text of such messages should not be altered without coordinating
kono
parents:
diff changeset
656 -- with the codefix code. All such messages are marked by a specific
kono
parents:
diff changeset
657 -- style of comments, as shown by the following example:
kono
parents:
diff changeset
658
kono
parents:
diff changeset
659 -- Error_Msg_N -- CODEFIX
kono
parents:
diff changeset
660 -- (parameters ....)
kono
parents:
diff changeset
661
kono
parents:
diff changeset
662 -- Any message marked with this -- CODEFIX comment should not be modified
kono
parents:
diff changeset
663 -- without appropriate coordination.
kono
parents:
diff changeset
664
kono
parents:
diff changeset
665 ------------------------------
kono
parents:
diff changeset
666 -- Error Output Subprograms --
kono
parents:
diff changeset
667 ------------------------------
kono
parents:
diff changeset
668
kono
parents:
diff changeset
669 procedure Initialize;
kono
parents:
diff changeset
670 -- Initializes for output of error messages. Must be called for each
kono
parents:
diff changeset
671 -- source file before using any of the other routines in the package.
kono
parents:
diff changeset
672
kono
parents:
diff changeset
673 procedure Finalize (Last_Call : Boolean);
kono
parents:
diff changeset
674 -- Finalize processing of error message list. Includes processing for
kono
parents:
diff changeset
675 -- duplicated error messages, and other similar final adjustment of the
kono
parents:
diff changeset
676 -- list of error messages. Note that this procedure must be called before
kono
parents:
diff changeset
677 -- calling Compilation_Errors to determine if there were any errors. It
kono
parents:
diff changeset
678 -- is perfectly fine to call Finalize more than once, providing that the
kono
parents:
diff changeset
679 -- parameter Last_Call is set False for every call except the last call.
kono
parents:
diff changeset
680
kono
parents:
diff changeset
681 -- This multiple call capability is used to do some processing that may
kono
parents:
diff changeset
682 -- generate messages. Call Finalize to eliminate duplicates and remove
kono
parents:
diff changeset
683 -- deleted warnings. Test for compilation errors using Compilation_Errors,
kono
parents:
diff changeset
684 -- then generate some more errors/warnings, call Finalize again to make
kono
parents:
diff changeset
685 -- sure that all duplicates in these new messages are dealt with, then
kono
parents:
diff changeset
686 -- finally call Output_Messages to output the final list of messages. The
kono
parents:
diff changeset
687 -- argument Last_Call must be set False on all calls except the last call,
kono
parents:
diff changeset
688 -- and must be set True on the last call (a value of True activates some
kono
parents:
diff changeset
689 -- processing that must only be done after all messages are posted).
kono
parents:
diff changeset
690
kono
parents:
diff changeset
691 procedure Output_Messages;
kono
parents:
diff changeset
692 -- Output list of messages, including messages giving number of detected
kono
parents:
diff changeset
693 -- errors and warnings.
kono
parents:
diff changeset
694
kono
parents:
diff changeset
695 procedure Error_Msg
kono
parents:
diff changeset
696 (Msg : String; Flag_Location : Source_Ptr);
kono
parents:
diff changeset
697 procedure Error_Msg
kono
parents:
diff changeset
698 (Msg : String; Flag_Location : Source_Ptr; N : Node_Id);
kono
parents:
diff changeset
699 -- Output a message at specified location. Can be called from the parser
kono
parents:
diff changeset
700 -- or the semantic analyzer. If N is set, points to the relevant node for
kono
parents:
diff changeset
701 -- this message.
kono
parents:
diff changeset
702
kono
parents:
diff changeset
703 procedure Error_Msg_S (Msg : String);
kono
parents:
diff changeset
704 -- Output a message at current scan pointer location. This routine can be
kono
parents:
diff changeset
705 -- called only from the parser, since it references Scan_Ptr.
kono
parents:
diff changeset
706
kono
parents:
diff changeset
707 procedure Error_Msg_AP (Msg : String);
kono
parents:
diff changeset
708 -- Output a message just after the previous token. This routine can be
kono
parents:
diff changeset
709 -- called only from the parser, since it references Prev_Token_Ptr.
kono
parents:
diff changeset
710
kono
parents:
diff changeset
711 procedure Error_Msg_BC (Msg : String);
kono
parents:
diff changeset
712 -- Output a message just before the current token. Note that the important
kono
parents:
diff changeset
713 -- difference between this and the previous routine is that the BC case
kono
parents:
diff changeset
714 -- posts a flag on the current line, whereas AP can post a flag at the
kono
parents:
diff changeset
715 -- end of the preceding line. This routine can be called only from the
kono
parents:
diff changeset
716 -- parser, since it references Token_Ptr.
kono
parents:
diff changeset
717
kono
parents:
diff changeset
718 procedure Error_Msg_SC (Msg : String);
kono
parents:
diff changeset
719 -- Output a message at the start of the current token, unless we are at
kono
parents:
diff changeset
720 -- the end of file, in which case we always output the message after the
kono
parents:
diff changeset
721 -- last real token in the file. This routine can be called only from the
kono
parents:
diff changeset
722 -- parser, since it references Token_Ptr.
kono
parents:
diff changeset
723
kono
parents:
diff changeset
724 procedure Error_Msg_SP (Msg : String);
kono
parents:
diff changeset
725 -- Output a message at the start of the previous token. This routine can
kono
parents:
diff changeset
726 -- be called only from the parser, since it references Prev_Token_Ptr.
kono
parents:
diff changeset
727
kono
parents:
diff changeset
728 procedure Error_Msg_N (Msg : String; N : Node_Or_Entity_Id);
kono
parents:
diff changeset
729 -- Output a message at the Sloc of the given node. This routine can be
kono
parents:
diff changeset
730 -- called from the parser or the semantic analyzer, although the call from
kono
parents:
diff changeset
731 -- the latter is much more common (and is the most usual way of generating
kono
parents:
diff changeset
732 -- error messages from the analyzer). The message text may contain a
kono
parents:
diff changeset
733 -- single & insertion, which will reference the given node. The message is
kono
parents:
diff changeset
734 -- suppressed if the node N already has a message posted, or if it is a
kono
parents:
diff changeset
735 -- warning and N is an entity node for which warnings are suppressed.
kono
parents:
diff changeset
736
kono
parents:
diff changeset
737 procedure Error_Msg_F (Msg : String; N : Node_Id);
kono
parents:
diff changeset
738 -- Similar to Error_Msg_N except that the message is placed on the first
kono
parents:
diff changeset
739 -- node of the construct N (First_Node (N)). Note that this procedure uses
kono
parents:
diff changeset
740 -- Original_Node to look at the original source tree, since that's what we
kono
parents:
diff changeset
741 -- want for placing an error message flag in the right place.
kono
parents:
diff changeset
742
kono
parents:
diff changeset
743 procedure Error_Msg_NE
kono
parents:
diff changeset
744 (Msg : String;
kono
parents:
diff changeset
745 N : Node_Or_Entity_Id;
kono
parents:
diff changeset
746 E : Node_Or_Entity_Id);
kono
parents:
diff changeset
747 -- Output a message at the Sloc of the given node N, with an insertion of
kono
parents:
diff changeset
748 -- the name from the given entity node E. This is used by the semantic
kono
parents:
diff changeset
749 -- routines, where this is a common error message situation. The Msg text
kono
parents:
diff changeset
750 -- will contain a & or } as usual to mark the insertion point. This
kono
parents:
diff changeset
751 -- routine can be called from the parser or the analyzer.
kono
parents:
diff changeset
752
kono
parents:
diff changeset
753 procedure Error_Msg_FE
kono
parents:
diff changeset
754 (Msg : String;
kono
parents:
diff changeset
755 N : Node_Id;
kono
parents:
diff changeset
756 E : Node_Or_Entity_Id);
kono
parents:
diff changeset
757 -- Same as Error_Msg_NE, except that the message is placed on the first
kono
parents:
diff changeset
758 -- node of the construct N (First_Node (N)).
kono
parents:
diff changeset
759
kono
parents:
diff changeset
760 procedure Error_Msg_NEL
kono
parents:
diff changeset
761 (Msg : String;
kono
parents:
diff changeset
762 N : Node_Or_Entity_Id;
kono
parents:
diff changeset
763 E : Node_Or_Entity_Id;
kono
parents:
diff changeset
764 Flag_Location : Source_Ptr);
kono
parents:
diff changeset
765 -- Exactly the same as Error_Msg_NE, except that the flag is placed at
kono
parents:
diff changeset
766 -- the specified Flag_Location instead of at Sloc (N).
kono
parents:
diff changeset
767
kono
parents:
diff changeset
768 procedure Error_Msg_NW
kono
parents:
diff changeset
769 (Eflag : Boolean;
kono
parents:
diff changeset
770 Msg : String;
kono
parents:
diff changeset
771 N : Node_Or_Entity_Id);
kono
parents:
diff changeset
772 -- This routine is used for posting a message conditionally. The message
kono
parents:
diff changeset
773 -- is posted (with the same effect as Error_Msg_N (Msg, N) if and only
kono
parents:
diff changeset
774 -- if Eflag is True and if the node N is within the main extended source
kono
parents:
diff changeset
775 -- unit and comes from source. Typically this is a warning mode flag.
kono
parents:
diff changeset
776 -- This routine can only be called during semantic analysis. It may not
kono
parents:
diff changeset
777 -- be called during parsing.
kono
parents:
diff changeset
778
kono
parents:
diff changeset
779 procedure Change_Error_Text (Error_Id : Error_Msg_Id; New_Msg : String);
kono
parents:
diff changeset
780 -- The error message text of the message identified by Id is replaced by
kono
parents:
diff changeset
781 -- the given text. This text may contain insertion characters in the
kono
parents:
diff changeset
782 -- usual manner, and need not be the same length as the original text.
kono
parents:
diff changeset
783
kono
parents:
diff changeset
784 function First_Node (C : Node_Id) return Node_Id;
kono
parents:
diff changeset
785 -- Given a construct C, finds the first node in the construct, i.e. the one
kono
parents:
diff changeset
786 -- with the lowest Sloc value. This is useful in placing error msgs. Note
kono
parents:
diff changeset
787 -- that this procedure uses Original_Node to look at the original source
kono
parents:
diff changeset
788 -- tree, since that's what we want for placing an error message flag in
kono
parents:
diff changeset
789 -- the right place.
kono
parents:
diff changeset
790
kono
parents:
diff changeset
791 function First_Sloc (N : Node_Id) return Source_Ptr;
kono
parents:
diff changeset
792 -- Given the node for an expression, return a source pointer value that
kono
parents:
diff changeset
793 -- points to the start of the first token in the expression. In the case
kono
parents:
diff changeset
794 -- where the expression is parenthesized, an attempt is made to include
kono
parents:
diff changeset
795 -- the parentheses (i.e. to return the location of the initial paren).
kono
parents:
diff changeset
796
kono
parents:
diff changeset
797 function Get_Ignore_Errors return Boolean;
kono
parents:
diff changeset
798 -- Return True if all error calls are ignored.
kono
parents:
diff changeset
799
kono
parents:
diff changeset
800 procedure Purge_Messages (From : Source_Ptr; To : Source_Ptr)
kono
parents:
diff changeset
801 renames Erroutc.Purge_Messages;
kono
parents:
diff changeset
802 -- All error messages whose location is in the range From .. To (not
kono
parents:
diff changeset
803 -- including the end points) will be deleted from the error listing.
kono
parents:
diff changeset
804
kono
parents:
diff changeset
805 procedure Remove_Warning_Messages (N : Node_Id);
kono
parents:
diff changeset
806 -- Remove any warning messages corresponding to the Sloc of N or any
kono
parents:
diff changeset
807 -- of its descendant nodes. No effect if no such warnings. Note that
kono
parents:
diff changeset
808 -- style messages (identified by the fact that they start with "(style)")
kono
parents:
diff changeset
809 -- are not removed by this call. Basically the idea behind this procedure
kono
parents:
diff changeset
810 -- is to remove warnings about execution conditions from known dead code.
kono
parents:
diff changeset
811
kono
parents:
diff changeset
812 procedure Remove_Warning_Messages (L : List_Id);
kono
parents:
diff changeset
813 -- Remove warnings on all elements of a list (Calls Remove_Warning_Messages
kono
parents:
diff changeset
814 -- on each element of the list, see above).
kono
parents:
diff changeset
815
kono
parents:
diff changeset
816 procedure Reset_Warnings;
kono
parents:
diff changeset
817 -- Reset the counts related to warnings. This is used both to initialize
kono
parents:
diff changeset
818 -- these counts and to reset them after each phase of analysis for a given
kono
parents:
diff changeset
819 -- value of Opt.Warning_Mode in gnat2why.
kono
parents:
diff changeset
820
kono
parents:
diff changeset
821 procedure Set_Ignore_Errors (To : Boolean);
kono
parents:
diff changeset
822 -- Following a call to this procedure with To=True, all error calls are
kono
parents:
diff changeset
823 -- ignored. A call with To=False restores the default treatment in which
kono
parents:
diff changeset
824 -- error calls are treated as usual (and as described in this spec).
kono
parents:
diff changeset
825
kono
parents:
diff changeset
826 procedure Set_Warnings_Mode_Off (Loc : Source_Ptr; Reason : String_Id)
kono
parents:
diff changeset
827 renames Erroutc.Set_Warnings_Mode_Off;
kono
parents:
diff changeset
828 -- Called in response to a pragma Warnings (Off) to record the source
kono
parents:
diff changeset
829 -- location from which warnings are to be turned off. Reason is the
kono
parents:
diff changeset
830 -- Reason from the pragma, or the null string if none is given.
kono
parents:
diff changeset
831
kono
parents:
diff changeset
832 procedure Set_Warnings_Mode_On (Loc : Source_Ptr)
kono
parents:
diff changeset
833 renames Erroutc.Set_Warnings_Mode_On;
kono
parents:
diff changeset
834 -- Called in response to a pragma Warnings (On) to record the source
kono
parents:
diff changeset
835 -- location from which warnings are to be turned back on.
kono
parents:
diff changeset
836
kono
parents:
diff changeset
837 procedure Set_Specific_Warning_Off
kono
parents:
diff changeset
838 (Loc : Source_Ptr;
kono
parents:
diff changeset
839 Msg : String;
kono
parents:
diff changeset
840 Reason : String_Id;
kono
parents:
diff changeset
841 Config : Boolean;
kono
parents:
diff changeset
842 Used : Boolean := False)
kono
parents:
diff changeset
843 renames Erroutc.Set_Specific_Warning_Off;
kono
parents:
diff changeset
844 -- This is called in response to the two argument form of pragma Warnings
kono
parents:
diff changeset
845 -- where the first argument is OFF, and the second argument is a string
kono
parents:
diff changeset
846 -- which identifies a specific warning to be suppressed. The first argument
kono
parents:
diff changeset
847 -- is the start of the suppression range, and the second argument is the
kono
parents:
diff changeset
848 -- string from the pragma. Loc is the location of the pragma (which is the
kono
parents:
diff changeset
849 -- start of the range to suppress). Reason is the reason string from the
kono
parents:
diff changeset
850 -- pragma, or the null string if no reason is given. Config is True for the
kono
parents:
diff changeset
851 -- configuration pragma case (where there is no requirement for a matching
kono
parents:
diff changeset
852 -- OFF pragma). Used is set True to disable the check that the warning
kono
parents:
diff changeset
853 -- actually has the effect of suppressing a warning.
kono
parents:
diff changeset
854
kono
parents:
diff changeset
855 procedure Set_Specific_Warning_On
kono
parents:
diff changeset
856 (Loc : Source_Ptr;
kono
parents:
diff changeset
857 Msg : String;
kono
parents:
diff changeset
858 Err : out Boolean)
kono
parents:
diff changeset
859 renames Erroutc.Set_Specific_Warning_On;
kono
parents:
diff changeset
860 -- This is called in response to the two argument form of pragma Warnings
kono
parents:
diff changeset
861 -- where the first argument is ON, and the second argument is the prefix
kono
parents:
diff changeset
862 -- of a specific warning to be suppressed. The first argument is the end
kono
parents:
diff changeset
863 -- of the suppression range, and the second argument is the string from
kono
parents:
diff changeset
864 -- the pragma. Err is set to True on return to report the error of no
kono
parents:
diff changeset
865 -- matching Warnings Off pragma preceding this one.
kono
parents:
diff changeset
866
kono
parents:
diff changeset
867 function Compilation_Errors return Boolean;
kono
parents:
diff changeset
868 -- Returns True if errors have been detected, or warnings in -gnatwe (treat
kono
parents:
diff changeset
869 -- warnings as errors) mode. Note that it is mandatory to call Finalize
kono
parents:
diff changeset
870 -- before calling this routine. To account for changes to Warning_Mode in
kono
parents:
diff changeset
871 -- gnat2why between phases, the past or current presence of an error is
kono
parents:
diff changeset
872 -- recorded in a global variable at each call.
kono
parents:
diff changeset
873
kono
parents:
diff changeset
874 procedure Error_Msg_CRT (Feature : String; N : Node_Id);
kono
parents:
diff changeset
875 -- Posts a non-fatal message on node N saying that the feature identified
kono
parents:
diff changeset
876 -- by the Feature argument is not supported in either configurable
kono
parents:
diff changeset
877 -- run-time mode or no run-time mode (as appropriate). In the former case,
kono
parents:
diff changeset
878 -- the name of the library is output if available.
kono
parents:
diff changeset
879
kono
parents:
diff changeset
880 procedure Error_Msg_PT (E : Entity_Id; Iface_Prim : Entity_Id);
kono
parents:
diff changeset
881 -- Posts an error on protected type entry or subprogram E (referencing its
kono
parents:
diff changeset
882 -- overridden interface primitive Iface_Prim) indicating wrong mode of the
kono
parents:
diff changeset
883 -- first formal (RM 9.4(11.9/3)).
kono
parents:
diff changeset
884
kono
parents:
diff changeset
885 procedure Error_Msg_Ada_2012_Feature (Feature : String; Loc : Source_Ptr);
kono
parents:
diff changeset
886 -- If not operating in Ada 2012 mode, posts errors complaining that Feature
kono
parents:
diff changeset
887 -- is only supported in Ada 2012, with appropriate suggestions to fix this.
kono
parents:
diff changeset
888 -- Loc is the location at which the flag is to be posted. Feature, which
kono
parents:
diff changeset
889 -- appears at the start of the first generated message, may contain error
kono
parents:
diff changeset
890 -- message insertion characters in the normal manner, and in particular
kono
parents:
diff changeset
891 -- may start with | to flag a non-serious error.
kono
parents:
diff changeset
892
kono
parents:
diff changeset
893 procedure dmsg (Id : Error_Msg_Id) renames Erroutc.dmsg;
kono
parents:
diff changeset
894 -- Debugging routine to dump an error message
kono
parents:
diff changeset
895
kono
parents:
diff changeset
896 ------------------------------------
kono
parents:
diff changeset
897 -- SPARK Error Output Subprograms --
kono
parents:
diff changeset
898 ------------------------------------
kono
parents:
diff changeset
899
kono
parents:
diff changeset
900 -- The following routines are intended to report semantic errors in SPARK
kono
parents:
diff changeset
901 -- constructs subject to aspect/pragma SPARK_Mode. Note that syntax errors
kono
parents:
diff changeset
902 -- must be reported using the Error_Msg_XXX routines. This allows for the
kono
parents:
diff changeset
903 -- partial analysis of SPARK features when they are disabled via SPARK_Mode
kono
parents:
diff changeset
904 -- set to "off".
kono
parents:
diff changeset
905
kono
parents:
diff changeset
906 procedure SPARK_Msg_N (Msg : String; N : Node_Or_Entity_Id);
kono
parents:
diff changeset
907 pragma Inline (SPARK_Msg_N);
kono
parents:
diff changeset
908 -- Same as Error_Msg_N, but the error is suppressed if SPARK_Mode is Off.
kono
parents:
diff changeset
909 -- The routine is inlined because it acts as a simple wrapper.
kono
parents:
diff changeset
910
kono
parents:
diff changeset
911 procedure SPARK_Msg_NE
kono
parents:
diff changeset
912 (Msg : String;
kono
parents:
diff changeset
913 N : Node_Or_Entity_Id;
kono
parents:
diff changeset
914 E : Node_Or_Entity_Id);
kono
parents:
diff changeset
915 pragma Inline (SPARK_Msg_NE);
kono
parents:
diff changeset
916 -- Same as Error_Msg_NE, but the error is suppressed if SPARK_Mode is Off.
kono
parents:
diff changeset
917 -- The routine is inlined because it acts as a simple wrapper.
kono
parents:
diff changeset
918
kono
parents:
diff changeset
919 ------------------------------------------
kono
parents:
diff changeset
920 -- Utility Interface for Casing Control --
kono
parents:
diff changeset
921 ------------------------------------------
kono
parents:
diff changeset
922
kono
parents:
diff changeset
923 procedure Adjust_Name_Case
kono
parents:
diff changeset
924 (Buf : in out Bounded_String;
kono
parents:
diff changeset
925 Loc : Source_Ptr);
kono
parents:
diff changeset
926 -- Given a name stored in Buf, set proper casing. Loc is an associated
kono
parents:
diff changeset
927 -- source position, and if we can find a match between the name in Buf and
kono
parents:
diff changeset
928 -- the name at that source location, we copy the casing from the source,
kono
parents:
diff changeset
929 -- otherwise we set appropriate default casing.
kono
parents:
diff changeset
930
kono
parents:
diff changeset
931 procedure Adjust_Name_Case (Loc : Source_Ptr);
kono
parents:
diff changeset
932 -- Uses Buf => Global_Name_Buffer. There are no calls to this in the
kono
parents:
diff changeset
933 -- compiler, but it is called in SPARK 2014.
kono
parents:
diff changeset
934
kono
parents:
diff changeset
935 procedure Set_Identifier_Casing
kono
parents:
diff changeset
936 (Identifier_Name : System.Address;
kono
parents:
diff changeset
937 File_Name : System.Address);
kono
parents:
diff changeset
938 -- This subprogram can be used by the back end for the purposes of
kono
parents:
diff changeset
939 -- concocting error messages that are not output via Errout, e.g.
kono
parents:
diff changeset
940 -- the messages generated by the gcc back end.
kono
parents:
diff changeset
941 --
kono
parents:
diff changeset
942 -- The identifier is a null terminated string that represents the name of
kono
parents:
diff changeset
943 -- an identifier appearing in the source program. File_Name is a null
kono
parents:
diff changeset
944 -- terminated string giving the corresponding file name for the identifier
kono
parents:
diff changeset
945 -- as obtained from the front end by the use of Full_Debug_Name to the
kono
parents:
diff changeset
946 -- source file referenced by the corresponding source location value. On
kono
parents:
diff changeset
947 -- return, the name is in Name_Buffer, null terminated with Name_Len set.
kono
parents:
diff changeset
948 -- This name is the identifier name as passed, cased according to the
kono
parents:
diff changeset
949 -- default identifier casing for the given file.
kono
parents:
diff changeset
950
kono
parents:
diff changeset
951 end Errout;