1 /* Compilation switch flag type definitions for GCC.
2 Copyright (C) 1987-2021 Free Software Foundation, Inc.
4 This file is part of GCC.
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
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
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/>. */
20 #ifndef GCC_FLAG_TYPES_H
21 #define GCC_FLAG_TYPES_H
23 #if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
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. */
32 DINFO_TYPE_CTF
= 5, /* CTF debug info. */
33 DINFO_TYPE_BTF
= 6, /* BTF debug info. */
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. */
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)
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)
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)
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
59 #define VMS_AND_DWARF2_DEBUG ((VMS_DEBUG | DWARF2_DEBUG))
61 enum debug_info_levels
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. */
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. */
72 enum ctf_debug_info_levels
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. */
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. */
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. */
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.
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.
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
120 The remaining types of files are library headers and application
121 headers. We cannot currently distinguish these two types. */
123 enum debug_struct_file
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
130 DINFO_STRUCT_FILE_ANY
/* Debug structs defined in all files. */
133 /* Balance between GNAT encodings and standard DWARF to emit. */
135 enum dwarf_gnat_encodings
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
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. */
148 /* Enumerate Objective-c instance variable visibility settings. */
152 IVAR_VISIBILITY_PRIVATE
,
153 IVAR_VISIBILITY_PROTECTED
,
154 IVAR_VISIBILITY_PUBLIC
,
155 IVAR_VISIBILITY_PACKAGE
158 /* The stack reuse level. */
159 enum stack_reuse_level
166 /* The live patching level. */
167 enum live_patching_level
169 LIVE_PATCHING_NONE
= 0,
170 LIVE_PATCHING_INLINE_ONLY_STATIC
,
171 LIVE_PATCHING_INLINE_CLONE
174 /* The algorithm used for basic block reordering. */
175 enum reorder_blocks_algorithm
177 REORDER_BLOCKS_ALGORITHM_SIMPLE
,
178 REORDER_BLOCKS_ALGORITHM_STC
181 /* The algorithm used for the integrated register allocator (IRA). */
185 IRA_ALGORITHM_PRIORITY
188 /* The regions used for the integrated register allocator (IRA). */
194 /* This value means that there were no options -fira-region on the
195 command line and that we should choose a value depending on the
197 IRA_REGION_AUTODETECT
200 /* The options for excess precision. */
201 enum excess_precision
203 EXCESS_PRECISION_DEFAULT
,
204 EXCESS_PRECISION_FAST
,
205 EXCESS_PRECISION_STANDARD
208 /* The options for which values of FLT_EVAL_METHOD are permissible. */
209 enum permitted_flt_eval_methods
211 PERMITTED_FLT_EVAL_METHODS_DEFAULT
,
212 PERMITTED_FLT_EVAL_METHODS_TS_18661
,
213 PERMITTED_FLT_EVAL_METHODS_C11
216 /* Type of stack check.
218 Stack checking is designed to detect infinite recursion and stack
219 overflows for Ada programs. Furthermore stack checking tries to ensure
220 in that scenario that enough stack space is left to run a signal handler.
222 -fstack-check= does not prevent stack-clash style attacks. For that
223 you want -fstack-clash-protection. */
224 enum stack_check_type
226 /* Do not check the stack. */
229 /* Check the stack generically, i.e. assume no specific support
230 from the target configuration files. */
233 /* Check the stack and rely on the target configuration files to
234 check the static frame of functions, i.e. use the generic
235 mechanism only for dynamic stack allocations. */
236 STATIC_BUILTIN_STACK_CHECK
,
238 /* Check the stack and entirely rely on the target configuration
239 files, i.e. do not use the generic mechanism at all. */
240 FULL_BUILTIN_STACK_CHECK
243 /* Type of callgraph information. */
244 enum callgraph_info_type
246 /* No information. */
247 NO_CALLGRAPH_INFO
= 0,
249 /* Naked callgraph. */
250 CALLGRAPH_INFO_NAKED
= 1,
252 /* Callgraph decorated with stack usage information. */
253 CALLGRAPH_INFO_STACK_USAGE
= 2,
255 /* Callgraph decoration with dynamic allocation information. */
256 CALLGRAPH_INFO_DYNAMIC_ALLOC
= 4
259 /* Floating-point contraction mode. */
260 enum fp_contract_mode
{
266 /* Scalar storage order kind. */
267 enum scalar_storage_order_kind
{
273 /* Vectorizer cost-model. Except for DEFAULT, the values are ordered from
274 the most conservative to the least conservative. */
275 enum vect_cost_model
{
276 VECT_COST_MODEL_VERY_CHEAP
= -3,
277 VECT_COST_MODEL_CHEAP
= -2,
278 VECT_COST_MODEL_DYNAMIC
= -1,
279 VECT_COST_MODEL_UNLIMITED
= 0,
280 VECT_COST_MODEL_DEFAULT
= 1
283 /* Different instrumentation modes. */
285 /* AddressSanitizer. */
286 SANITIZE_ADDRESS
= 1UL << 0,
287 SANITIZE_USER_ADDRESS
= 1UL << 1,
288 SANITIZE_KERNEL_ADDRESS
= 1UL << 2,
289 /* ThreadSanitizer. */
290 SANITIZE_THREAD
= 1UL << 3,
292 SANITIZE_LEAK
= 1UL << 4,
293 /* UndefinedBehaviorSanitizer. */
294 SANITIZE_SHIFT_BASE
= 1UL << 5,
295 SANITIZE_SHIFT_EXPONENT
= 1UL << 6,
296 SANITIZE_DIVIDE
= 1UL << 7,
297 SANITIZE_UNREACHABLE
= 1UL << 8,
298 SANITIZE_VLA
= 1UL << 9,
299 SANITIZE_NULL
= 1UL << 10,
300 SANITIZE_RETURN
= 1UL << 11,
301 SANITIZE_SI_OVERFLOW
= 1UL << 12,
302 SANITIZE_BOOL
= 1UL << 13,
303 SANITIZE_ENUM
= 1UL << 14,
304 SANITIZE_FLOAT_DIVIDE
= 1UL << 15,
305 SANITIZE_FLOAT_CAST
= 1UL << 16,
306 SANITIZE_BOUNDS
= 1UL << 17,
307 SANITIZE_ALIGNMENT
= 1UL << 18,
308 SANITIZE_NONNULL_ATTRIBUTE
= 1UL << 19,
309 SANITIZE_RETURNS_NONNULL_ATTRIBUTE
= 1UL << 20,
310 SANITIZE_OBJECT_SIZE
= 1UL << 21,
311 SANITIZE_VPTR
= 1UL << 22,
312 SANITIZE_BOUNDS_STRICT
= 1UL << 23,
313 SANITIZE_POINTER_OVERFLOW
= 1UL << 24,
314 SANITIZE_BUILTIN
= 1UL << 25,
315 SANITIZE_POINTER_COMPARE
= 1UL << 26,
316 SANITIZE_POINTER_SUBTRACT
= 1UL << 27,
317 SANITIZE_HWADDRESS
= 1UL << 28,
318 SANITIZE_USER_HWADDRESS
= 1UL << 29,
319 SANITIZE_KERNEL_HWADDRESS
= 1UL << 30,
320 SANITIZE_SHIFT
= SANITIZE_SHIFT_BASE
| SANITIZE_SHIFT_EXPONENT
,
321 SANITIZE_UNDEFINED
= SANITIZE_SHIFT
| SANITIZE_DIVIDE
| SANITIZE_UNREACHABLE
322 | SANITIZE_VLA
| SANITIZE_NULL
| SANITIZE_RETURN
323 | SANITIZE_SI_OVERFLOW
| SANITIZE_BOOL
| SANITIZE_ENUM
324 | SANITIZE_BOUNDS
| SANITIZE_ALIGNMENT
325 | SANITIZE_NONNULL_ATTRIBUTE
326 | SANITIZE_RETURNS_NONNULL_ATTRIBUTE
327 | SANITIZE_OBJECT_SIZE
| SANITIZE_VPTR
328 | SANITIZE_POINTER_OVERFLOW
| SANITIZE_BUILTIN
,
329 SANITIZE_UNDEFINED_NONDEFAULT
= SANITIZE_FLOAT_DIVIDE
| SANITIZE_FLOAT_CAST
330 | SANITIZE_BOUNDS_STRICT
333 /* Different settings for zeroing subset of registers. */
334 namespace 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;
341 const unsigned int USED_GPR_ARG
= ENABLED
| ONLY_USED
| ONLY_GPR
| ONLY_ARG
;
342 const unsigned int USED_GPR
= ENABLED
| ONLY_USED
| ONLY_GPR
;
343 const unsigned int USED_ARG
= ENABLED
| ONLY_USED
| ONLY_ARG
;
344 const unsigned int USED
= ENABLED
| ONLY_USED
;
345 const unsigned int ALL_GPR_ARG
= ENABLED
| ONLY_GPR
| ONLY_ARG
;
346 const unsigned int ALL_GPR
= ENABLED
| ONLY_GPR
;
347 const unsigned int ALL_ARG
= ENABLED
| ONLY_ARG
;
348 const unsigned int ALL
= ENABLED
;
351 /* Settings of flag_incremental_link. */
352 enum incremental_link
{
353 INCREMENTAL_LINK_NONE
,
354 /* Do incremental linking and produce binary. */
355 INCREMENTAL_LINK_NOLTO
,
356 /* Do incremental linking and produce IL. */
360 /* Different trace modes. */
361 enum sanitize_coverage_code
{
363 SANITIZE_COV_TRACE_PC
= 1 << 0,
364 /* Trace Comparison. */
365 SANITIZE_COV_TRACE_CMP
= 1 << 1
368 /* flag_vtable_verify initialization levels. */
370 VTV_NO_PRIORITY
= 0, /* i.E. Do NOT do vtable verification. */
371 VTV_STANDARD_PRIORITY
= 1,
372 VTV_PREINIT_PRIORITY
= 2
375 /* flag_lto_partition initialization values. */
376 enum lto_partition_model
{
377 LTO_PARTITION_NONE
= 0,
378 LTO_PARTITION_ONE
= 1,
379 LTO_PARTITION_BALANCED
= 2,
380 LTO_PARTITION_1TO1
= 3,
381 LTO_PARTITION_MAX
= 4
384 /* flag_lto_linker_output initialization values. */
385 enum lto_linker_output
{
386 LTO_LINKER_OUTPUT_UNKNOWN
,
387 LTO_LINKER_OUTPUT_REL
,
388 LTO_LINKER_OUTPUT_NOLTOREL
,
389 LTO_LINKER_OUTPUT_DYN
,
390 LTO_LINKER_OUTPUT_PIE
,
391 LTO_LINKER_OUTPUT_EXEC
394 /* gfortran -finit-real= values. */
396 enum gfc_init_local_real
398 GFC_INIT_REAL_OFF
= 0,
403 GFC_INIT_REAL_NEG_INF
406 /* gfortran -fcoarray= values. */
410 GFC_FCOARRAY_NONE
= 0,
416 /* gfortran -fconvert= values; used for unformatted I/O.
417 Keep in sync with GFC_CONVERT_* in gcc/fortran/libgfortran.h. */
420 GFC_FLAG_CONVERT_NATIVE
= 0,
421 GFC_FLAG_CONVERT_SWAP
,
422 GFC_FLAG_CONVERT_BIG
,
423 GFC_FLAG_CONVERT_LITTLE
427 /* Control-Flow Protection values. */
428 enum cf_protection_level
433 CF_FULL
= CF_BRANCH
| CF_RETURN
,
438 /* Parloops schedule type. */
439 enum parloops_schedule_type
441 PARLOOPS_SCHEDULE_STATIC
= 0,
442 PARLOOPS_SCHEDULE_DYNAMIC
,
443 PARLOOPS_SCHEDULE_GUIDED
,
444 PARLOOPS_SCHEDULE_AUTO
,
445 PARLOOPS_SCHEDULE_RUNTIME
451 EVRP_MODE_RVRP_ONLY
= 0,
452 EVRP_MODE_EVRP_ONLY
= 1,
453 EVRP_MODE_EVRP_FIRST
= 2,
454 EVRP_MODE_RVRP_FIRST
= 3,
456 EVRP_MODE_CACHE
= (8 | EVRP_MODE_TRACE
),
458 EVRP_MODE_TRACE_GORI
= (EVRP_MODE_TRACE
| EVRP_MODE_GORI
),
459 EVRP_MODE_DEBUG
= (EVRP_MODE_GORI
| EVRP_MODE_CACHE
)
462 /* Modes of OpenACC 'kernels' constructs handling. */
465 OPENACC_KERNELS_DECOMPOSE
,
466 OPENACC_KERNELS_PARLOOPS
469 /* Modes of OpenACC privatization diagnostics. */
470 enum openacc_privatization
472 OPENACC_PRIVATIZATION_QUIET
,
473 OPENACC_PRIVATIZATION_NOISY
478 #endif /* ! GCC_FLAG_TYPES_H */