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