[aarch64] Use op_mode instead of vmode in aarch64_vectorize_vec_perm_const.
[official-gcc.git] / gcc / ada / err_vars.ads
blob05329dc6f21195e82d88029117f90a4683901f7e
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-2022, 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 3, 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 COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 -- This package contains variables common to error reporting packages
27 -- including Errout and Prj.Err.
29 with Namet; use Namet;
30 with Types; use Types;
31 with Uintp; use Uintp;
33 package Err_Vars is
35 -- All of these variables are set when needed, so they do not need to be
36 -- initialized. However, there is code that saves and restores existing
37 -- values, which may malfunction in -gnatVa mode if the variable has never
38 -- been initialized, so we initialize some variables to avoid exceptions
39 -- from invalid values in such cases.
41 -- Note on error counts (Serious_Errors_Detected, Total_Errors_Detected,
42 -- Warnings_Detected, Warning_Info_Messages, Report_Info_Messages). These
43 -- counts might more logically appear in this unit, but we place them
44 -- instead in atree.ads, because of licensing issues. We need to be able
45 -- to access these counts from units that have the more general licensing
46 -- conditions.
48 ----------------------------------
49 -- Error Message Mode Variables --
50 ----------------------------------
52 -- These variables control special error message modes. The initialized
53 -- values below give the normal default behavior, but they can be reset
54 -- by the caller to get different behavior as noted in the comments. These
55 -- variables are not reset by calls to the error message routines, so the
56 -- caller is responsible for resetting the default behavior after use.
58 Error_Msg_Qual_Level : Nat := 0;
59 -- Number of levels of qualification required for type name (see the
60 -- description of the } insertion character. Note that this value does
61 -- not get reset by any Error_Msg call, so the caller is responsible
62 -- for resetting it.
64 Raise_Exception_On_Error : Nat := 0;
65 -- If this value is non-zero, then any attempt to generate an error
66 -- message raises the exception Error_Msg_Exception, and the error
67 -- message is not output. This is used for defending against junk
68 -- resulting from illegalities, and also for substitution of more
69 -- appropriate error messages from higher semantic levels. It is
70 -- a counter so that the increment/decrement protocol nests neatly.
71 -- Initialized for -gnatVa use, see comment above.
73 Error_Msg_Exception : exception;
74 -- Exception raised if Raise_Exception_On_Error is true
76 Current_Error_Source_File : Source_File_Index := No_Source_File;
77 -- Id of current messages. Used to post file name when unit changes. This
78 -- is initialized to Main_Source_File at the start of a compilation, which
79 -- means that no file names will be output unless there are errors in units
80 -- other than the main unit. However, if the main unit has a pragma
81 -- Source_Reference line, then this is initialized to No_Source_File,
82 -- to force an initial reference to the real source file name.
84 Warning_Doc_Switch : Boolean := True;
85 -- If this is set True, then the ??/?x?/?x? sequences in error messages
86 -- are active (see errout.ads for details). If this switch is False, then
87 -- these sequences are ignored (i.e. simply equivalent to a single ?). The
88 -- -gnatw.d switch sets this flag True, -gnatw.D sets this flag False.
90 ----------------------------------------
91 -- Error Message Insertion Parameters --
92 ----------------------------------------
94 -- The error message routines work with strings that contain insertion
95 -- sequences that result in the insertion of variable data. The following
96 -- variables contain the required data. The procedure is to set one or more
97 -- of the following global variables to appropriate values before making a
98 -- call to one of the error message routines with a string containing the
99 -- insertion character to get the value inserted in an appropriate format.
101 -- Some of these are initialized below, because they are read before being
102 -- set by clients.
104 -- Would it be desirable to use arrays (with element renamings) here
105 -- instead of individual variables, at least for the Error_Msg_Name_N and
106 -- Error_Msg_Node_N ??? This would allow simplifying existing code in some
107 -- cases (see errout.adb).
109 Error_Msg_Col : Column_Number;
110 -- Column for @ insertion character in message
112 Error_Msg_Uint_1 : Uint;
113 Error_Msg_Uint_2 : Uint := No_Uint;
114 -- Uint values for ^ insertion characters in message
116 -- WARNING: There is a matching C declaration of these variables in fe.h
118 Error_Msg_Sloc : Source_Ptr;
119 -- Source location for # insertion character in message
121 Error_Msg_Name_1 : Name_Id;
122 Error_Msg_Name_2 : Name_Id := No_Name;
123 Error_Msg_Name_3 : Name_Id := No_Name;
124 Error_Msg_Name_4 : Name_Id := No_Name;
125 Error_Msg_Name_5 : Name_Id := No_Name;
126 Error_Msg_Name_6 : Name_Id := No_Name;
127 -- Name_Id values for % insertion characters in message
129 Error_Msg_File_1 : File_Name_Type;
130 Error_Msg_File_2 : File_Name_Type := No_File;
131 Error_Msg_File_3 : File_Name_Type := No_File;
132 -- File_Name_Type values for { insertion characters in message
134 Error_Msg_Unit_1 : Unit_Name_Type;
135 Error_Msg_Unit_2 : Unit_Name_Type := No_Unit_Name;
136 -- Unit_Name_Type values for $ insertion characters in message
138 Error_Msg_Node_1 : Node_Id;
139 Error_Msg_Node_2 : Node_Id := Empty;
140 Error_Msg_Node_3 : Node_Id := Empty;
141 Error_Msg_Node_4 : Node_Id := Empty;
142 Error_Msg_Node_5 : Node_Id := Empty;
143 Error_Msg_Node_6 : Node_Id := Empty;
144 -- Node_Id values for & insertion characters in message
146 Error_Msg_Warn : Boolean;
147 -- Used if current message contains a < insertion character to indicate
148 -- if the current message is a warning message. Must be set appropriately
149 -- before any call to Error_Msg_xxx with a < insertion character present.
150 -- Setting is irrelevant if no < insertion character is present. Note
151 -- that it is not necessary to reset this after using it, since the proper
152 -- procedure is always to set it before issuing such a message. Note that
153 -- the warning documentation tag is always [enabled by default] in the
154 -- case where this flag is True.
156 Error_Msg_String : String (1 .. 4096);
157 Error_Msg_Strlen : Natural;
158 -- Used if current message contains a ~ insertion character to indicate
159 -- insertion of the string Error_Msg_String (1 .. Error_Msg_Strlen).
161 end Err_Vars;