]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/flag-types.h
x86: Remove "%!" before ret
[thirdparty/gcc.git] / gcc / flag-types.h
CommitLineData
f938f60c 1/* Compilation switch flag type definitions for GCC.
99dee823 2 Copyright (C) 1987-2021 Free Software Foundation, Inc.
f938f60c
JM
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along 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
d10f3e90 23#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
24
f938f60c
JM
25enum debug_info_type
26{
459d84e9
IB
27 DINFO_TYPE_NONE = 0, /* No debug info. */
28 DINFO_TYPE_DBX = 1, /* BSD .stabs for DBX. */
29 DINFO_TYPE_DWARF2 = 2, /* Dwarf v2 debug info. */
30 DINFO_TYPE_XCOFF = 3, /* IBM/Xcoff debug info. */
31 DINFO_TYPE_VMS = 4, /* VMS debug info. */
b7e215a8
IB
32 DINFO_TYPE_CTF = 5, /* CTF debug info. */
33 DINFO_TYPE_BTF = 6, /* BTF debug info. */
053db9a4
IB
34 DINFO_TYPE_BTF_WITH_CORE = 7, /* BTF debug info with CO-RE relocations. */
35 DINFO_TYPE_MAX = DINFO_TYPE_BTF_WITH_CORE /* Marker only. */
f938f60c
JM
36};
37
459d84e9
IB
38#define NO_DEBUG (0U)
39/* Write DBX debug info (using dbxout.c). */
40#define DBX_DEBUG (1U << DINFO_TYPE_DBX)
41/* Write DWARF2 debug info (using dwarf2out.c). */
42#define DWARF2_DEBUG (1U << DINFO_TYPE_DWARF2)
43/* Write IBM/XCOFF debug info (using dbxout.c). */
44#define XCOFF_DEBUG (1U << DINFO_TYPE_XCOFF)
45/* Write VMS debug info (using vmsdbgout.c). */
46#define VMS_DEBUG (1U << DINFO_TYPE_VMS)
b7e215a8
IB
47/* Write CTF debug info (using ctfout.c). */
48#define CTF_DEBUG (1U << DINFO_TYPE_CTF)
49/* Write BTF debug info (using btfout.c). */
50#define BTF_DEBUG (1U << DINFO_TYPE_BTF)
053db9a4
IB
51/* Write BTF debug info for BPF CO-RE usecase (using btfout.c). */
52#define BTF_WITH_CORE_DEBUG (1U << DINFO_TYPE_BTF_WITH_CORE)
53
459d84e9
IB
54/* Note: Adding new definitions to handle -combination- of debug formats,
55 like VMS_AND_DWARF2_DEBUG is not recommended. This definition remains
56 here for historical reasons. */
57/* Write VMS debug info (using vmsdbgout.c) and DWARF v2 debug info (using
58 dwarf2out.c). */
59#define VMS_AND_DWARF2_DEBUG ((VMS_DEBUG | DWARF2_DEBUG))
60
0576d21f 61enum debug_info_levels
f938f60c
JM
62{
63 DINFO_LEVEL_NONE, /* Write no debugging info. */
64 DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */
65 DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */
66 DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */
67};
68
b7e215a8
IB
69/* CTF debug info levels.
70 CTF debug info levels are untied with DWARF debug info levels because CTF
71 may co-exist with DWARF. */
72enum ctf_debug_info_levels
73{
74 CTFINFO_LEVEL_NONE = 0, /* Write no CTF debug info. */
75 CTFINFO_LEVEL_TERSE = 1, /* Write CTF information to support tracebacks
76 only. Not Implemented. */
77 CTFINFO_LEVEL_NORMAL = 2 /* Write CTF type information for all entities
78 (functions, data objects, variables etc.)
79 at file-scope or global-scope only. */
80};
81
f938f60c
JM
82/* A major contribution to object and executable size is debug
83 information size. A major contribution to debug information
84 size is struct descriptions replicated in several object files.
85 The following function determines whether or not debug information
86 should be generated for a given struct. The indirect parameter
87 indicates that the struct is being handled indirectly, via
88 a pointer. See opts.c for the implementation. */
89
90enum debug_info_usage
91{
92 DINFO_USAGE_DFN, /* A struct definition. */
93 DINFO_USAGE_DIR_USE, /* A direct use, such as the type of a variable. */
94 DINFO_USAGE_IND_USE, /* An indirect use, such as through a pointer. */
95 DINFO_USAGE_NUM_ENUMS /* The number of enumerators. */
96};
97
69ccdddb
JM
98/* A major contribution to object and executable size is debug
99 information size. A major contribution to debug information size
100 is struct descriptions replicated in several object files. The
101 following flags attempt to reduce this information. The basic
102 idea is to not emit struct debugging information in the current
103 compilation unit when that information will be generated by
104 another compilation unit.
105
106 Debug information for a struct defined in the current source
107 file should be generated in the object file. Likewise the
108 debug information for a struct defined in a header should be
109 generated in the object file of the corresponding source file.
110 Both of these case are handled when the base name of the file of
111 the struct definition matches the base name of the source file
112 of the current compilation unit. This matching emits minimal
113 struct debugging information.
114
115 The base file name matching rule above will fail to emit debug
116 information for structs defined in system headers. So a second
117 category of files includes system headers in addition to files
118 with matching bases.
119
120 The remaining types of files are library headers and application
121 headers. We cannot currently distinguish these two types. */
122
123enum debug_struct_file
124{
125 DINFO_STRUCT_FILE_NONE, /* Debug no structs. */
126 DINFO_STRUCT_FILE_BASE, /* Debug structs defined in files with the
127 same base name as the compilation unit. */
128 DINFO_STRUCT_FILE_SYS, /* Also debug structs defined in system
129 header files. */
130 DINFO_STRUCT_FILE_ANY /* Debug structs defined in all files. */
131};
132
6592d14b
PMR
133/* Balance between GNAT encodings and standard DWARF to emit. */
134
135enum dwarf_gnat_encodings
136{
137 DWARF_GNAT_ENCODINGS_ALL = 0, /* Emit all GNAT encodings, then emit as
138 much standard DWARF as possible so it
139 does not conflict with GNAT
140 encodings. */
141 DWARF_GNAT_ENCODINGS_GDB = 1, /* Emit as much standard DWARF as possible
142 as long as GDB handles them. Emit GNAT
143 encodings for the rest. */
144 DWARF_GNAT_ENCODINGS_MINIMAL = 2 /* Emit all the standard DWARF we can.
145 Emit GNAT encodings for the rest. */
146};
147
dcaaa5a0
DP
148/* Enumerate Objective-c instance variable visibility settings. */
149
150enum ivar_visibility
151{
152 IVAR_VISIBILITY_PRIVATE,
153 IVAR_VISIBILITY_PROTECTED,
154 IVAR_VISIBILITY_PUBLIC,
155 IVAR_VISIBILITY_PACKAGE
156};
157
87e2a8fd
XDL
158/* The stack reuse level. */
159enum stack_reuse_level
160{
161 SR_NONE,
162 SR_NAMED_VARS,
163 SR_ALL
164};
165
6fd6a2ff
QZ
166/* The live patching level. */
167enum live_patching_level
168{
169 LIVE_PATCHING_NONE = 0,
170 LIVE_PATCHING_INLINE_ONLY_STATIC,
171 LIVE_PATCHING_INLINE_CLONE
172};
173
59faab7c
SB
174/* The algorithm used for basic block reordering. */
175enum reorder_blocks_algorithm
176{
177 REORDER_BLOCKS_ALGORITHM_SIMPLE,
178 REORDER_BLOCKS_ALGORITHM_STC
179};
180
f938f60c
JM
181/* The algorithm used for the integrated register allocator (IRA). */
182enum ira_algorithm
183{
184 IRA_ALGORITHM_CB,
185 IRA_ALGORITHM_PRIORITY
186};
187
188/* The regions used for the integrated register allocator (IRA). */
189enum ira_region
190{
191 IRA_REGION_ONE,
192 IRA_REGION_ALL,
ffe8727f 193 IRA_REGION_MIXED,
f938f60c
JM
194};
195
196/* The options for excess precision. */
197enum excess_precision
198{
199 EXCESS_PRECISION_DEFAULT,
200 EXCESS_PRECISION_FAST,
f19a3270 201 EXCESS_PRECISION_STANDARD,
202 EXCESS_PRECISION_FLOAT16
f938f60c
JM
203};
204
04f0fcf7
JG
205/* The options for which values of FLT_EVAL_METHOD are permissible. */
206enum permitted_flt_eval_methods
207{
208 PERMITTED_FLT_EVAL_METHODS_DEFAULT,
209 PERMITTED_FLT_EVAL_METHODS_TS_18661,
210 PERMITTED_FLT_EVAL_METHODS_C11
211};
212
ee8f15c6
JL
213/* Type of stack check.
214
215 Stack checking is designed to detect infinite recursion and stack
216 overflows for Ada programs. Furthermore stack checking tries to ensure
217 in that scenario that enough stack space is left to run a signal handler.
218
219 -fstack-check= does not prevent stack-clash style attacks. For that
220 you want -fstack-clash-protection. */
f938f60c
JM
221enum stack_check_type
222{
223 /* Do not check the stack. */
224 NO_STACK_CHECK = 0,
225
226 /* Check the stack generically, i.e. assume no specific support
227 from the target configuration files. */
228 GENERIC_STACK_CHECK,
229
230 /* Check the stack and rely on the target configuration files to
231 check the static frame of functions, i.e. use the generic
232 mechanism only for dynamic stack allocations. */
233 STATIC_BUILTIN_STACK_CHECK,
234
235 /* Check the stack and entirely rely on the target configuration
236 files, i.e. do not use the generic mechanism at all. */
237 FULL_BUILTIN_STACK_CHECK
238};
239
3cf3da88
EB
240/* Type of callgraph information. */
241enum callgraph_info_type
242{
243 /* No information. */
244 NO_CALLGRAPH_INFO = 0,
245
246 /* Naked callgraph. */
247 CALLGRAPH_INFO_NAKED = 1,
248
249 /* Callgraph decorated with stack usage information. */
250 CALLGRAPH_INFO_STACK_USAGE = 2,
251
252 /* Callgraph decoration with dynamic allocation information. */
253 CALLGRAPH_INFO_DYNAMIC_ALLOC = 4
254};
255
16949072
RG
256/* Floating-point contraction mode. */
257enum fp_contract_mode {
258 FP_CONTRACT_OFF = 0,
259 FP_CONTRACT_ON = 1,
260 FP_CONTRACT_FAST = 2
261};
262
ee45a32d
EB
263/* Scalar storage order kind. */
264enum scalar_storage_order_kind {
265 SSO_NATIVE = 0,
266 SSO_BIG_ENDIAN,
267 SSO_LITTLE_ENDIAN
268};
269
0b0061f4
RS
270/* Vectorizer cost-model. Except for DEFAULT, the values are ordered from
271 the most conservative to the least conservative. */
d6d11272 272enum vect_cost_model {
0b0061f4
RS
273 VECT_COST_MODEL_VERY_CHEAP = -3,
274 VECT_COST_MODEL_CHEAP = -2,
275 VECT_COST_MODEL_DYNAMIC = -1,
d6d11272 276 VECT_COST_MODEL_UNLIMITED = 0,
0b0061f4 277 VECT_COST_MODEL_DEFAULT = 1
d6d11272
XDL
278};
279
a25e0b5e 280/* Automatic variable initialization type. */
281enum auto_init_type {
282 AUTO_INIT_UNINITIALIZED = 0,
283 AUTO_INIT_PATTERN = 1,
284 AUTO_INIT_ZERO = 2
285};
286
de5a5fa1
MP
287/* Different instrumentation modes. */
288enum sanitize_code {
289 /* AddressSanitizer. */
5cc6c41c
ML
290 SANITIZE_ADDRESS = 1UL << 0,
291 SANITIZE_USER_ADDRESS = 1UL << 1,
292 SANITIZE_KERNEL_ADDRESS = 1UL << 2,
de5a5fa1 293 /* ThreadSanitizer. */
5cc6c41c 294 SANITIZE_THREAD = 1UL << 3,
9065ada9 295 /* LeakSanitizer. */
5cc6c41c 296 SANITIZE_LEAK = 1UL << 4,
de5a5fa1 297 /* UndefinedBehaviorSanitizer. */
2e955d50
JJ
298 SANITIZE_SHIFT_BASE = 1UL << 5,
299 SANITIZE_SHIFT_EXPONENT = 1UL << 6,
300 SANITIZE_DIVIDE = 1UL << 7,
301 SANITIZE_UNREACHABLE = 1UL << 8,
302 SANITIZE_VLA = 1UL << 9,
303 SANITIZE_NULL = 1UL << 10,
304 SANITIZE_RETURN = 1UL << 11,
305 SANITIZE_SI_OVERFLOW = 1UL << 12,
306 SANITIZE_BOOL = 1UL << 13,
307 SANITIZE_ENUM = 1UL << 14,
308 SANITIZE_FLOAT_DIVIDE = 1UL << 15,
309 SANITIZE_FLOAT_CAST = 1UL << 16,
310 SANITIZE_BOUNDS = 1UL << 17,
311 SANITIZE_ALIGNMENT = 1UL << 18,
312 SANITIZE_NONNULL_ATTRIBUTE = 1UL << 19,
313 SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1UL << 20,
314 SANITIZE_OBJECT_SIZE = 1UL << 21,
315 SANITIZE_VPTR = 1UL << 22,
316 SANITIZE_BOUNDS_STRICT = 1UL << 23,
c9b39a49 317 SANITIZE_POINTER_OVERFLOW = 1UL << 24,
07d7c611 318 SANITIZE_BUILTIN = 1UL << 25,
05abad4c
ML
319 SANITIZE_POINTER_COMPARE = 1UL << 26,
320 SANITIZE_POINTER_SUBTRACT = 1UL << 27,
3bd87832
MM
321 SANITIZE_HWADDRESS = 1UL << 28,
322 SANITIZE_USER_HWADDRESS = 1UL << 29,
323 SANITIZE_KERNEL_HWADDRESS = 1UL << 30,
2e955d50 324 SANITIZE_SHIFT = SANITIZE_SHIFT_BASE | SANITIZE_SHIFT_EXPONENT,
de5a5fa1 325 SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE
0a508bb6 326 | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN
0e37a2f3 327 | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM
126edc3f
JJ
328 | SANITIZE_BOUNDS | SANITIZE_ALIGNMENT
329 | SANITIZE_NONNULL_ATTRIBUTE
0e82f089 330 | SANITIZE_RETURNS_NONNULL_ATTRIBUTE
c9b39a49 331 | SANITIZE_OBJECT_SIZE | SANITIZE_VPTR
07d7c611 332 | SANITIZE_POINTER_OVERFLOW | SANITIZE_BUILTIN,
45b2222a
ML
333 SANITIZE_UNDEFINED_NONDEFAULT = SANITIZE_FLOAT_DIVIDE | SANITIZE_FLOAT_CAST
334 | SANITIZE_BOUNDS_STRICT
de5a5fa1
MP
335};
336
d10f3e90 337/* Different settings for zeroing subset of registers. */
338namespace zero_regs_flags {
339 const unsigned int UNSET = 0;
340 const unsigned int SKIP = 1UL << 0;
341 const unsigned int ONLY_USED = 1UL << 1;
342 const unsigned int ONLY_GPR = 1UL << 2;
343 const unsigned int ONLY_ARG = 1UL << 3;
344 const unsigned int ENABLED = 1UL << 4;
345 const unsigned int USED_GPR_ARG = ENABLED | ONLY_USED | ONLY_GPR | ONLY_ARG;
346 const unsigned int USED_GPR = ENABLED | ONLY_USED | ONLY_GPR;
347 const unsigned int USED_ARG = ENABLED | ONLY_USED | ONLY_ARG;
348 const unsigned int USED = ENABLED | ONLY_USED;
349 const unsigned int ALL_GPR_ARG = ENABLED | ONLY_GPR | ONLY_ARG;
350 const unsigned int ALL_GPR = ENABLED | ONLY_GPR;
351 const unsigned int ALL_ARG = ENABLED | ONLY_ARG;
352 const unsigned int ALL = ENABLED;
353}
354
5b42d196
JH
355/* Settings of flag_incremental_link. */
356enum incremental_link {
357 INCREMENTAL_LINK_NONE,
358 /* Do incremental linking and produce binary. */
359 INCREMENTAL_LINK_NOLTO,
360 /* Do incremental linking and produce IL. */
361 INCREMENTAL_LINK_LTO
362};
363
f6e50a7d
WW
364/* Different trace modes. */
365enum sanitize_coverage_code {
366 /* Trace PC. */
367 SANITIZE_COV_TRACE_PC = 1 << 0,
368 /* Trace Comparison. */
369 SANITIZE_COV_TRACE_CMP = 1 << 1
370};
371
2077db1b
CT
372/* flag_vtable_verify initialization levels. */
373enum vtv_priority {
374 VTV_NO_PRIORITY = 0, /* i.E. Do NOT do vtable verification. */
375 VTV_STANDARD_PRIORITY = 1,
376 VTV_PREINIT_PRIORITY = 2
377};
783dab6b
RB
378
379/* flag_lto_partition initialization values. */
380enum lto_partition_model {
381 LTO_PARTITION_NONE = 0,
382 LTO_PARTITION_ONE = 1,
383 LTO_PARTITION_BALANCED = 2,
384 LTO_PARTITION_1TO1 = 3,
385 LTO_PARTITION_MAX = 4
386};
387
1ff9ed6f
JH
388/* flag_lto_linker_output initialization values. */
389enum lto_linker_output {
390 LTO_LINKER_OUTPUT_UNKNOWN,
391 LTO_LINKER_OUTPUT_REL,
5b42d196 392 LTO_LINKER_OUTPUT_NOLTOREL,
1ff9ed6f
JH
393 LTO_LINKER_OUTPUT_DYN,
394 LTO_LINKER_OUTPUT_PIE,
395 LTO_LINKER_OUTPUT_EXEC
396};
f19626cf
TB
397
398/* gfortran -finit-real= values. */
399
400enum gfc_init_local_real
401{
402 GFC_INIT_REAL_OFF = 0,
403 GFC_INIT_REAL_ZERO,
404 GFC_INIT_REAL_NAN,
405 GFC_INIT_REAL_SNAN,
406 GFC_INIT_REAL_INF,
407 GFC_INIT_REAL_NEG_INF
408};
409
410/* gfortran -fcoarray= values. */
411
412enum gfc_fcoarray
413{
414 GFC_FCOARRAY_NONE = 0,
415 GFC_FCOARRAY_SINGLE,
416 GFC_FCOARRAY_LIB
417};
418
419
420/* gfortran -fconvert= values; used for unformatted I/O.
421 Keep in sync with GFC_CONVERT_* in gcc/fortran/libgfortran.h. */
422enum gfc_convert
423{
424 GFC_FLAG_CONVERT_NATIVE = 0,
425 GFC_FLAG_CONVERT_SWAP,
426 GFC_FLAG_CONVERT_BIG,
427 GFC_FLAG_CONVERT_LITTLE
428};
429
430
5c5f0b65
IT
431/* Control-Flow Protection values. */
432enum cf_protection_level
433{
434 CF_NONE = 0,
435 CF_BRANCH = 1 << 0,
436 CF_RETURN = 1 << 1,
437 CF_FULL = CF_BRANCH | CF_RETURN,
c4c22e83
L
438 CF_SET = 1 << 2,
439 CF_CHECK = 1 << 3
5c5f0b65 440};
7e1792c9
ML
441
442/* Parloops schedule type. */
443enum parloops_schedule_type
444{
445 PARLOOPS_SCHEDULE_STATIC = 0,
446 PARLOOPS_SCHEDULE_DYNAMIC,
447 PARLOOPS_SCHEDULE_GUIDED,
448 PARLOOPS_SCHEDULE_AUTO,
449 PARLOOPS_SCHEDULE_RUNTIME
450};
451
9cb114fd
AM
452/* Ranger debug mode. */
453enum ranger_debug
454{
455 RANGER_DEBUG_NONE = 0,
456 RANGER_DEBUG_TRACE = 1,
2bfb21bb 457 RANGER_DEBUG_CACHE = 2,
9cb114fd
AM
458 RANGER_DEBUG_GORI = 4,
459 RANGER_DEBUG_TRACE_GORI = (RANGER_DEBUG_TRACE | RANGER_DEBUG_GORI),
2bfb21bb 460 RANGER_DEBUG_TRACE_CACHE = (RANGER_DEBUG_TRACE | RANGER_DEBUG_CACHE),
309bb7ff
AM
461 RANGER_DEBUG_ALL = (RANGER_DEBUG_GORI | RANGER_DEBUG_CACHE
462 | RANGER_DEBUG_TRACE)
9cb114fd
AM
463};
464
47c2cf3a
AH
465/* Jump threader verbose dumps. */
466enum threader_debug
467{
468 THREADER_DEBUG_NONE = 0,
469 THREADER_DEBUG_ALL = 1
470};
471
fcae5121
AM
472/* EVRP mode. */
473enum evrp_mode
474{
9cb114fd
AM
475 EVRP_MODE_RVRP_ONLY,
476 EVRP_MODE_EVRP_ONLY,
477 EVRP_MODE_EVRP_FIRST,
478 EVRP_MODE_RVRP_FIRST
fcae5121
AM
479};
480
bd400db6
AM
481/* VRP modes. */
482enum vrp_mode
483{
484 VRP_MODE_VRP,
485 VRP_MODE_RANGER
486};
487
e898ce79
GB
488/* Modes of OpenACC 'kernels' constructs handling. */
489enum openacc_kernels
490{
491 OPENACC_KERNELS_DECOMPOSE,
492 OPENACC_KERNELS_PARLOOPS
493};
494
11b8286a
TS
495/* Modes of OpenACC privatization diagnostics. */
496enum openacc_privatization
497{
498 OPENACC_PRIVATIZATION_QUIET,
499 OPENACC_PRIVATIZATION_NOISY
500};
501
d10f3e90 502#endif
503
f938f60c 504#endif /* ! GCC_FLAG_TYPES_H */