]> gcc.gnu.org Git - gcc.git/blob - gcc/flag-types.h
Merge remote-tracking branch 'origin/releases/gcc-11' into devel/omp/gcc-11
[gcc.git] / gcc / flag-types.h
1 /* Compilation switch flag type definitions for GCC.
2 Copyright (C) 1987-2021 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19
20 #ifndef GCC_FLAG_TYPES_H
21 #define GCC_FLAG_TYPES_H
22
23 #if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
24
25 enum debug_info_type
26 {
27 NO_DEBUG, /* Write no debug info. */
28 DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */
29 DWARF2_DEBUG, /* Write Dwarf v2 debug info (using dwarf2out.c). */
30 XCOFF_DEBUG, /* Write IBM/Xcoff debug info (using dbxout.c). */
31 VMS_DEBUG, /* Write VMS debug info (using vmsdbgout.c). */
32 VMS_AND_DWARF2_DEBUG /* Write VMS debug info (using vmsdbgout.c).
33 and DWARF v2 debug info (using dwarf2out.c). */
34 };
35
36 enum debug_info_levels
37 {
38 DINFO_LEVEL_NONE, /* Write no debugging info. */
39 DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */
40 DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */
41 DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */
42 };
43
44 /* A major contribution to object and executable size is debug
45 information size. A major contribution to debug information
46 size is struct descriptions replicated in several object files.
47 The following function determines whether or not debug information
48 should be generated for a given struct. The indirect parameter
49 indicates that the struct is being handled indirectly, via
50 a pointer. See opts.c for the implementation. */
51
52 enum debug_info_usage
53 {
54 DINFO_USAGE_DFN, /* A struct definition. */
55 DINFO_USAGE_DIR_USE, /* A direct use, such as the type of a variable. */
56 DINFO_USAGE_IND_USE, /* An indirect use, such as through a pointer. */
57 DINFO_USAGE_NUM_ENUMS /* The number of enumerators. */
58 };
59
60 /* A major contribution to object and executable size is debug
61 information size. A major contribution to debug information size
62 is struct descriptions replicated in several object files. The
63 following flags attempt to reduce this information. The basic
64 idea is to not emit struct debugging information in the current
65 compilation unit when that information will be generated by
66 another compilation unit.
67
68 Debug information for a struct defined in the current source
69 file should be generated in the object file. Likewise the
70 debug information for a struct defined in a header should be
71 generated in the object file of the corresponding source file.
72 Both of these case are handled when the base name of the file of
73 the struct definition matches the base name of the source file
74 of the current compilation unit. This matching emits minimal
75 struct debugging information.
76
77 The base file name matching rule above will fail to emit debug
78 information for structs defined in system headers. So a second
79 category of files includes system headers in addition to files
80 with matching bases.
81
82 The remaining types of files are library headers and application
83 headers. We cannot currently distinguish these two types. */
84
85 enum debug_struct_file
86 {
87 DINFO_STRUCT_FILE_NONE, /* Debug no structs. */
88 DINFO_STRUCT_FILE_BASE, /* Debug structs defined in files with the
89 same base name as the compilation unit. */
90 DINFO_STRUCT_FILE_SYS, /* Also debug structs defined in system
91 header files. */
92 DINFO_STRUCT_FILE_ANY /* Debug structs defined in all files. */
93 };
94
95 /* Balance between GNAT encodings and standard DWARF to emit. */
96
97 enum dwarf_gnat_encodings
98 {
99 DWARF_GNAT_ENCODINGS_ALL = 0, /* Emit all GNAT encodings, then emit as
100 much standard DWARF as possible so it
101 does not conflict with GNAT
102 encodings. */
103 DWARF_GNAT_ENCODINGS_GDB = 1, /* Emit as much standard DWARF as possible
104 as long as GDB handles them. Emit GNAT
105 encodings for the rest. */
106 DWARF_GNAT_ENCODINGS_MINIMAL = 2 /* Emit all the standard DWARF we can.
107 Emit GNAT encodings for the rest. */
108 };
109
110 /* Enumerate Objective-c instance variable visibility settings. */
111
112 enum ivar_visibility
113 {
114 IVAR_VISIBILITY_PRIVATE,
115 IVAR_VISIBILITY_PROTECTED,
116 IVAR_VISIBILITY_PUBLIC,
117 IVAR_VISIBILITY_PACKAGE
118 };
119
120 /* The stack reuse level. */
121 enum stack_reuse_level
122 {
123 SR_NONE,
124 SR_NAMED_VARS,
125 SR_ALL
126 };
127
128 /* The live patching level. */
129 enum live_patching_level
130 {
131 LIVE_PATCHING_NONE = 0,
132 LIVE_PATCHING_INLINE_ONLY_STATIC,
133 LIVE_PATCHING_INLINE_CLONE
134 };
135
136 /* The algorithm used for basic block reordering. */
137 enum reorder_blocks_algorithm
138 {
139 REORDER_BLOCKS_ALGORITHM_SIMPLE,
140 REORDER_BLOCKS_ALGORITHM_STC
141 };
142
143 /* The algorithm used for the integrated register allocator (IRA). */
144 enum ira_algorithm
145 {
146 IRA_ALGORITHM_CB,
147 IRA_ALGORITHM_PRIORITY
148 };
149
150 /* The regions used for the integrated register allocator (IRA). */
151 enum ira_region
152 {
153 IRA_REGION_ONE,
154 IRA_REGION_ALL,
155 IRA_REGION_MIXED,
156 /* This value means that there were no options -fira-region on the
157 command line and that we should choose a value depending on the
158 used -O option. */
159 IRA_REGION_AUTODETECT
160 };
161
162 /* The options for excess precision. */
163 enum excess_precision
164 {
165 EXCESS_PRECISION_DEFAULT,
166 EXCESS_PRECISION_FAST,
167 EXCESS_PRECISION_STANDARD
168 };
169
170 /* The options for which values of FLT_EVAL_METHOD are permissible. */
171 enum permitted_flt_eval_methods
172 {
173 PERMITTED_FLT_EVAL_METHODS_DEFAULT,
174 PERMITTED_FLT_EVAL_METHODS_TS_18661,
175 PERMITTED_FLT_EVAL_METHODS_C11
176 };
177
178 /* Type of stack check.
179
180 Stack checking is designed to detect infinite recursion and stack
181 overflows for Ada programs. Furthermore stack checking tries to ensure
182 in that scenario that enough stack space is left to run a signal handler.
183
184 -fstack-check= does not prevent stack-clash style attacks. For that
185 you want -fstack-clash-protection. */
186 enum stack_check_type
187 {
188 /* Do not check the stack. */
189 NO_STACK_CHECK = 0,
190
191 /* Check the stack generically, i.e. assume no specific support
192 from the target configuration files. */
193 GENERIC_STACK_CHECK,
194
195 /* Check the stack and rely on the target configuration files to
196 check the static frame of functions, i.e. use the generic
197 mechanism only for dynamic stack allocations. */
198 STATIC_BUILTIN_STACK_CHECK,
199
200 /* Check the stack and entirely rely on the target configuration
201 files, i.e. do not use the generic mechanism at all. */
202 FULL_BUILTIN_STACK_CHECK
203 };
204
205 /* Type of callgraph information. */
206 enum callgraph_info_type
207 {
208 /* No information. */
209 NO_CALLGRAPH_INFO = 0,
210
211 /* Naked callgraph. */
212 CALLGRAPH_INFO_NAKED = 1,
213
214 /* Callgraph decorated with stack usage information. */
215 CALLGRAPH_INFO_STACK_USAGE = 2,
216
217 /* Callgraph decoration with dynamic allocation information. */
218 CALLGRAPH_INFO_DYNAMIC_ALLOC = 4
219 };
220
221 /* Floating-point contraction mode. */
222 enum fp_contract_mode {
223 FP_CONTRACT_OFF = 0,
224 FP_CONTRACT_ON = 1,
225 FP_CONTRACT_FAST = 2
226 };
227
228 /* Scalar storage order kind. */
229 enum scalar_storage_order_kind {
230 SSO_NATIVE = 0,
231 SSO_BIG_ENDIAN,
232 SSO_LITTLE_ENDIAN
233 };
234
235 /* Vectorizer cost-model. Except for DEFAULT, the values are ordered from
236 the most conservative to the least conservative. */
237 enum vect_cost_model {
238 VECT_COST_MODEL_VERY_CHEAP = -3,
239 VECT_COST_MODEL_CHEAP = -2,
240 VECT_COST_MODEL_DYNAMIC = -1,
241 VECT_COST_MODEL_UNLIMITED = 0,
242 VECT_COST_MODEL_DEFAULT = 1
243 };
244
245 /* Different instrumentation modes. */
246 enum sanitize_code {
247 /* AddressSanitizer. */
248 SANITIZE_ADDRESS = 1UL << 0,
249 SANITIZE_USER_ADDRESS = 1UL << 1,
250 SANITIZE_KERNEL_ADDRESS = 1UL << 2,
251 /* ThreadSanitizer. */
252 SANITIZE_THREAD = 1UL << 3,
253 /* LeakSanitizer. */
254 SANITIZE_LEAK = 1UL << 4,
255 /* UndefinedBehaviorSanitizer. */
256 SANITIZE_SHIFT_BASE = 1UL << 5,
257 SANITIZE_SHIFT_EXPONENT = 1UL << 6,
258 SANITIZE_DIVIDE = 1UL << 7,
259 SANITIZE_UNREACHABLE = 1UL << 8,
260 SANITIZE_VLA = 1UL << 9,
261 SANITIZE_NULL = 1UL << 10,
262 SANITIZE_RETURN = 1UL << 11,
263 SANITIZE_SI_OVERFLOW = 1UL << 12,
264 SANITIZE_BOOL = 1UL << 13,
265 SANITIZE_ENUM = 1UL << 14,
266 SANITIZE_FLOAT_DIVIDE = 1UL << 15,
267 SANITIZE_FLOAT_CAST = 1UL << 16,
268 SANITIZE_BOUNDS = 1UL << 17,
269 SANITIZE_ALIGNMENT = 1UL << 18,
270 SANITIZE_NONNULL_ATTRIBUTE = 1UL << 19,
271 SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1UL << 20,
272 SANITIZE_OBJECT_SIZE = 1UL << 21,
273 SANITIZE_VPTR = 1UL << 22,
274 SANITIZE_BOUNDS_STRICT = 1UL << 23,
275 SANITIZE_POINTER_OVERFLOW = 1UL << 24,
276 SANITIZE_BUILTIN = 1UL << 25,
277 SANITIZE_POINTER_COMPARE = 1UL << 26,
278 SANITIZE_POINTER_SUBTRACT = 1UL << 27,
279 SANITIZE_HWADDRESS = 1UL << 28,
280 SANITIZE_USER_HWADDRESS = 1UL << 29,
281 SANITIZE_KERNEL_HWADDRESS = 1UL << 30,
282 SANITIZE_SHIFT = SANITIZE_SHIFT_BASE | SANITIZE_SHIFT_EXPONENT,
283 SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE
284 | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN
285 | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM
286 | SANITIZE_BOUNDS | SANITIZE_ALIGNMENT
287 | SANITIZE_NONNULL_ATTRIBUTE
288 | SANITIZE_RETURNS_NONNULL_ATTRIBUTE
289 | SANITIZE_OBJECT_SIZE | SANITIZE_VPTR
290 | SANITIZE_POINTER_OVERFLOW | SANITIZE_BUILTIN,
291 SANITIZE_UNDEFINED_NONDEFAULT = SANITIZE_FLOAT_DIVIDE | SANITIZE_FLOAT_CAST
292 | SANITIZE_BOUNDS_STRICT
293 };
294
295 /* Different settings for zeroing subset of registers. */
296 namespace zero_regs_flags {
297 const unsigned int UNSET = 0;
298 const unsigned int SKIP = 1UL << 0;
299 const unsigned int ONLY_USED = 1UL << 1;
300 const unsigned int ONLY_GPR = 1UL << 2;
301 const unsigned int ONLY_ARG = 1UL << 3;
302 const unsigned int ENABLED = 1UL << 4;
303 const unsigned int USED_GPR_ARG = ENABLED | ONLY_USED | ONLY_GPR | ONLY_ARG;
304 const unsigned int USED_GPR = ENABLED | ONLY_USED | ONLY_GPR;
305 const unsigned int USED_ARG = ENABLED | ONLY_USED | ONLY_ARG;
306 const unsigned int USED = ENABLED | ONLY_USED;
307 const unsigned int ALL_GPR_ARG = ENABLED | ONLY_GPR | ONLY_ARG;
308 const unsigned int ALL_GPR = ENABLED | ONLY_GPR;
309 const unsigned int ALL_ARG = ENABLED | ONLY_ARG;
310 const unsigned int ALL = ENABLED;
311 }
312
313 /* Settings of flag_incremental_link. */
314 enum incremental_link {
315 INCREMENTAL_LINK_NONE,
316 /* Do incremental linking and produce binary. */
317 INCREMENTAL_LINK_NOLTO,
318 /* Do incremental linking and produce IL. */
319 INCREMENTAL_LINK_LTO
320 };
321
322 /* Different trace modes. */
323 enum sanitize_coverage_code {
324 /* Trace PC. */
325 SANITIZE_COV_TRACE_PC = 1 << 0,
326 /* Trace Comparison. */
327 SANITIZE_COV_TRACE_CMP = 1 << 1
328 };
329
330 /* flag_vtable_verify initialization levels. */
331 enum vtv_priority {
332 VTV_NO_PRIORITY = 0, /* i.E. Do NOT do vtable verification. */
333 VTV_STANDARD_PRIORITY = 1,
334 VTV_PREINIT_PRIORITY = 2
335 };
336
337 /* flag_lto_partition initialization values. */
338 enum lto_partition_model {
339 LTO_PARTITION_NONE = 0,
340 LTO_PARTITION_ONE = 1,
341 LTO_PARTITION_BALANCED = 2,
342 LTO_PARTITION_1TO1 = 3,
343 LTO_PARTITION_MAX = 4
344 };
345
346 /* flag_lto_linker_output initialization values. */
347 enum lto_linker_output {
348 LTO_LINKER_OUTPUT_UNKNOWN,
349 LTO_LINKER_OUTPUT_REL,
350 LTO_LINKER_OUTPUT_NOLTOREL,
351 LTO_LINKER_OUTPUT_DYN,
352 LTO_LINKER_OUTPUT_PIE,
353 LTO_LINKER_OUTPUT_EXEC
354 };
355
356 /* gfortran -finit-real= values. */
357
358 enum gfc_init_local_real
359 {
360 GFC_INIT_REAL_OFF = 0,
361 GFC_INIT_REAL_ZERO,
362 GFC_INIT_REAL_NAN,
363 GFC_INIT_REAL_SNAN,
364 GFC_INIT_REAL_INF,
365 GFC_INIT_REAL_NEG_INF
366 };
367
368 /* gfortran -fcoarray= values. */
369
370 enum gfc_fcoarray
371 {
372 GFC_FCOARRAY_NONE = 0,
373 GFC_FCOARRAY_SINGLE,
374 GFC_FCOARRAY_LIB
375 };
376
377
378 /* gfortran -fconvert= values; used for unformatted I/O.
379 Keep in sync with GFC_CONVERT_* in gcc/fortran/libgfortran.h. */
380 enum gfc_convert
381 {
382 GFC_FLAG_CONVERT_NATIVE = 0,
383 GFC_FLAG_CONVERT_SWAP,
384 GFC_FLAG_CONVERT_BIG,
385 GFC_FLAG_CONVERT_LITTLE
386 };
387
388
389 /* Control-Flow Protection values. */
390 enum cf_protection_level
391 {
392 CF_NONE = 0,
393 CF_BRANCH = 1 << 0,
394 CF_RETURN = 1 << 1,
395 CF_FULL = CF_BRANCH | CF_RETURN,
396 CF_SET = 1 << 2,
397 CF_CHECK = 1 << 3
398 };
399
400 /* Parloops schedule type. */
401 enum parloops_schedule_type
402 {
403 PARLOOPS_SCHEDULE_STATIC = 0,
404 PARLOOPS_SCHEDULE_DYNAMIC,
405 PARLOOPS_SCHEDULE_GUIDED,
406 PARLOOPS_SCHEDULE_AUTO,
407 PARLOOPS_SCHEDULE_RUNTIME
408 };
409
410 /* EVRP mode. */
411 enum evrp_mode
412 {
413 EVRP_MODE_EVRP_FIRST = 0,
414 EVRP_MODE_EVRP_ONLY = 1,
415 EVRP_MODE_RVRP_ONLY = 2,
416 EVRP_MODE_RVRP_FIRST = 3,
417 EVRP_MODE_TRACE = 4,
418 EVRP_MODE_DEBUG = 8 | EVRP_MODE_TRACE,
419 EVRP_MODE_RVRP_TRACE = EVRP_MODE_RVRP_ONLY | EVRP_MODE_TRACE,
420 EVRP_MODE_RVRP_DEBUG = EVRP_MODE_RVRP_ONLY | EVRP_MODE_DEBUG
421 };
422
423 /* Modes of OpenACC 'kernels' constructs handling. */
424 enum openacc_kernels
425 {
426 OPENACC_KERNELS_DECOMPOSE,
427 OPENACC_KERNELS_PARLOOPS
428 };
429
430 #endif
431
432 #endif /* ! GCC_FLAG_TYPES_H */
This page took 0.058103 seconds and 5 git commands to generate.