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