annotate gcc/ada/err_vars.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 _ V A R S --
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 variables common to error reporting packages
kono
parents:
diff changeset
27 -- including Errout and Prj.Err.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 with Namet; use Namet;
kono
parents:
diff changeset
30 with Types; use Types;
kono
parents:
diff changeset
31 with Uintp; use Uintp;
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 package Err_Vars is
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 -- All of these variables are set when needed, so they do not need to be
kono
parents:
diff changeset
36 -- initialized. However, there is code that saves and restores existing
kono
parents:
diff changeset
37 -- values, which may malfunction in -gnatVa mode if the variable has never
kono
parents:
diff changeset
38 -- been initialized, so we initialize some variables to avoid exceptions
kono
parents:
diff changeset
39 -- from invalid values in such cases.
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 -- Note on error counts (Serious_Errors_Detected, Total_Errors_Detected,
kono
parents:
diff changeset
42 -- Warnings_Detected, Warning_Info_Messages, Report_Info_Messages). These
kono
parents:
diff changeset
43 -- counts might more logically appear in this unit, but we place them
kono
parents:
diff changeset
44 -- instead in atree.ads, because of licensing issues. We need to be able
kono
parents:
diff changeset
45 -- to access these counts from units that have the more general licensing
kono
parents:
diff changeset
46 -- conditions.
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 ----------------------------------
kono
parents:
diff changeset
49 -- Error Message Mode Variables --
kono
parents:
diff changeset
50 ----------------------------------
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 -- These variables control special error message modes. The initialized
kono
parents:
diff changeset
53 -- values below give the normal default behavior, but they can be reset
kono
parents:
diff changeset
54 -- by the caller to get different behavior as noted in the comments. These
kono
parents:
diff changeset
55 -- variables are not reset by calls to the error message routines, so the
kono
parents:
diff changeset
56 -- caller is responsible for resetting the default behavior after use.
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 Error_Msg_Qual_Level : Nat := 0;
kono
parents:
diff changeset
59 -- Number of levels of qualification required for type name (see the
kono
parents:
diff changeset
60 -- description of the } insertion character. Note that this value does
kono
parents:
diff changeset
61 -- not get reset by any Error_Msg call, so the caller is responsible
kono
parents:
diff changeset
62 -- for resetting it.
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 Warn_On_Instance : Boolean := False;
kono
parents:
diff changeset
65 -- Normally if a warning is generated in a generic template from the
kono
parents:
diff changeset
66 -- analysis of the template, then the warning really belongs in the
kono
parents:
diff changeset
67 -- template, and the default value of False for this Boolean achieves
kono
parents:
diff changeset
68 -- that effect. If Warn_On_Instance is set True, then the warnings are
kono
parents:
diff changeset
69 -- generated on the instantiation (referring to the template) rather
kono
parents:
diff changeset
70 -- than on the template itself.
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 Raise_Exception_On_Error : Nat := 0;
kono
parents:
diff changeset
73 -- If this value is non-zero, then any attempt to generate an error
kono
parents:
diff changeset
74 -- message raises the exception Error_Msg_Exception, and the error
kono
parents:
diff changeset
75 -- message is not output. This is used for defending against junk
kono
parents:
diff changeset
76 -- resulting from illegalities, and also for substitution of more
kono
parents:
diff changeset
77 -- appropriate error messages from higher semantic levels. It is
kono
parents:
diff changeset
78 -- a counter so that the increment/decrement protocol nests neatly.
kono
parents:
diff changeset
79 -- Initialized for -gnatVa use, see comment above.
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 Error_Msg_Exception : exception;
kono
parents:
diff changeset
82 -- Exception raised if Raise_Exception_On_Error is true
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 Current_Error_Source_File : Source_File_Index := No_Source_File;
kono
parents:
diff changeset
85 -- Id of current messages. Used to post file name when unit changes. This
kono
parents:
diff changeset
86 -- is initialized to Main_Source_File at the start of a compilation, which
kono
parents:
diff changeset
87 -- means that no file names will be output unless there are errors in units
kono
parents:
diff changeset
88 -- other than the main unit. However, if the main unit has a pragma
kono
parents:
diff changeset
89 -- Source_Reference line, then this is initialized to No_Source_File,
kono
parents:
diff changeset
90 -- to force an initial reference to the real source file name.
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 Warning_Doc_Switch : Boolean := False;
kono
parents:
diff changeset
93 -- If this is set True, then the ??/?x?/?x? sequences in error messages
kono
parents:
diff changeset
94 -- are active (see errout.ads for details). If this switch is False, then
kono
parents:
diff changeset
95 -- these sequences are ignored (i.e. simply equivalent to a single ?). The
kono
parents:
diff changeset
96 -- -gnatw.d switch sets this flag True, -gnatw.D sets this flag False.
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 ----------------------------------------
kono
parents:
diff changeset
99 -- Error Message Insertion Parameters --
kono
parents:
diff changeset
100 ----------------------------------------
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 -- The error message routines work with strings that contain insertion
kono
parents:
diff changeset
103 -- sequences that result in the insertion of variable data. The following
kono
parents:
diff changeset
104 -- variables contain the required data. The procedure is to set one or more
kono
parents:
diff changeset
105 -- of the following global variables to appropriate values before making a
kono
parents:
diff changeset
106 -- call to one of the error message routines with a string containing the
kono
parents:
diff changeset
107 -- insertion character to get the value inserted in an appropriate format.
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 Error_Msg_Col : Column_Number;
kono
parents:
diff changeset
110 -- Column for @ insertion character in message
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 Error_Msg_Uint_1 : Uint;
kono
parents:
diff changeset
113 Error_Msg_Uint_2 : Uint;
kono
parents:
diff changeset
114 -- Uint values for ^ insertion characters in message
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 Error_Msg_Sloc : Source_Ptr;
kono
parents:
diff changeset
117 -- Source location for # insertion character in message
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 Error_Msg_Name_1 : Name_Id;
kono
parents:
diff changeset
120 Error_Msg_Name_2 : Name_Id;
kono
parents:
diff changeset
121 Error_Msg_Name_3 : Name_Id;
kono
parents:
diff changeset
122 -- Name_Id values for % insertion characters in message
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 Error_Msg_File_1 : File_Name_Type;
kono
parents:
diff changeset
125 Error_Msg_File_2 : File_Name_Type;
kono
parents:
diff changeset
126 Error_Msg_File_3 : File_Name_Type;
kono
parents:
diff changeset
127 -- File_Name_Type values for { insertion characters in message
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 Error_Msg_Unit_1 : Unit_Name_Type;
kono
parents:
diff changeset
130 Error_Msg_Unit_2 : Unit_Name_Type;
kono
parents:
diff changeset
131 -- Unit_Name_Type values for $ insertion characters in message
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133 Error_Msg_Node_1 : Node_Id;
kono
parents:
diff changeset
134 Error_Msg_Node_2 : Node_Id;
kono
parents:
diff changeset
135 -- Node_Id values for & insertion characters in message
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 Error_Msg_Warn : Boolean;
kono
parents:
diff changeset
138 -- Used if current message contains a < insertion character to indicate
kono
parents:
diff changeset
139 -- if the current message is a warning message. Must be set appropriately
kono
parents:
diff changeset
140 -- before any call to Error_Msg_xxx with a < insertion character present.
kono
parents:
diff changeset
141 -- Setting is irrelevant if no < insertion character is present. Note
kono
parents:
diff changeset
142 -- that it is not necessary to reset this after using it, since the proper
kono
parents:
diff changeset
143 -- procedure is always to set it before issuing such a message. Note that
kono
parents:
diff changeset
144 -- the warning documentation tag is always [enabled by default] in the
kono
parents:
diff changeset
145 -- case where this flag is True.
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 Error_Msg_String : String (1 .. 4096);
kono
parents:
diff changeset
148 Error_Msg_Strlen : Natural;
kono
parents:
diff changeset
149 -- Used if current message contains a ~ insertion character to indicate
kono
parents:
diff changeset
150 -- insertion of the string Error_Msg_String (1 .. Error_Msg_Strlen).
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 end Err_Vars;