1*e4b17023SJohn Marino /* Compilation switch flag type definitions for GCC. 2*e4b17023SJohn Marino Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 3*e4b17023SJohn Marino 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 4*e4b17023SJohn Marino Free Software Foundation, Inc. 5*e4b17023SJohn Marino 6*e4b17023SJohn Marino This file is part of GCC. 7*e4b17023SJohn Marino 8*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under 9*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free 10*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later 11*e4b17023SJohn Marino version. 12*e4b17023SJohn Marino 13*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY 14*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or 15*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16*e4b17023SJohn Marino for more details. 17*e4b17023SJohn Marino 18*e4b17023SJohn Marino You should have received a copy of the GNU General Public License 19*e4b17023SJohn Marino along with GCC; see the file COPYING3. If not see 20*e4b17023SJohn Marino <http://www.gnu.org/licenses/>. */ 21*e4b17023SJohn Marino 22*e4b17023SJohn Marino #ifndef GCC_FLAG_TYPES_H 23*e4b17023SJohn Marino #define GCC_FLAG_TYPES_H 24*e4b17023SJohn Marino 25*e4b17023SJohn Marino enum debug_info_type 26*e4b17023SJohn Marino { 27*e4b17023SJohn Marino NO_DEBUG, /* Write no debug info. */ 28*e4b17023SJohn Marino DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */ 29*e4b17023SJohn Marino SDB_DEBUG, /* Write COFF for (old) SDB (using sdbout.c). */ 30*e4b17023SJohn Marino DWARF2_DEBUG, /* Write Dwarf v2 debug info (using dwarf2out.c). */ 31*e4b17023SJohn Marino XCOFF_DEBUG, /* Write IBM/Xcoff debug info (using dbxout.c). */ 32*e4b17023SJohn Marino VMS_DEBUG, /* Write VMS debug info (using vmsdbgout.c). */ 33*e4b17023SJohn Marino VMS_AND_DWARF2_DEBUG /* Write VMS debug info (using vmsdbgout.c). 34*e4b17023SJohn Marino and DWARF v2 debug info (using dwarf2out.c). */ 35*e4b17023SJohn Marino }; 36*e4b17023SJohn Marino 37*e4b17023SJohn Marino enum debug_info_levels 38*e4b17023SJohn Marino { 39*e4b17023SJohn Marino DINFO_LEVEL_NONE, /* Write no debugging info. */ 40*e4b17023SJohn Marino DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */ 41*e4b17023SJohn Marino DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */ 42*e4b17023SJohn Marino DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */ 43*e4b17023SJohn Marino }; 44*e4b17023SJohn Marino 45*e4b17023SJohn Marino /* A major contribution to object and executable size is debug 46*e4b17023SJohn Marino information size. A major contribution to debug information 47*e4b17023SJohn Marino size is struct descriptions replicated in several object files. 48*e4b17023SJohn Marino The following function determines whether or not debug information 49*e4b17023SJohn Marino should be generated for a given struct. The indirect parameter 50*e4b17023SJohn Marino indicates that the struct is being handled indirectly, via 51*e4b17023SJohn Marino a pointer. See opts.c for the implementation. */ 52*e4b17023SJohn Marino 53*e4b17023SJohn Marino enum debug_info_usage 54*e4b17023SJohn Marino { 55*e4b17023SJohn Marino DINFO_USAGE_DFN, /* A struct definition. */ 56*e4b17023SJohn Marino DINFO_USAGE_DIR_USE, /* A direct use, such as the type of a variable. */ 57*e4b17023SJohn Marino DINFO_USAGE_IND_USE, /* An indirect use, such as through a pointer. */ 58*e4b17023SJohn Marino DINFO_USAGE_NUM_ENUMS /* The number of enumerators. */ 59*e4b17023SJohn Marino }; 60*e4b17023SJohn Marino 61*e4b17023SJohn Marino /* A major contribution to object and executable size is debug 62*e4b17023SJohn Marino information size. A major contribution to debug information size 63*e4b17023SJohn Marino is struct descriptions replicated in several object files. The 64*e4b17023SJohn Marino following flags attempt to reduce this information. The basic 65*e4b17023SJohn Marino idea is to not emit struct debugging information in the current 66*e4b17023SJohn Marino compilation unit when that information will be generated by 67*e4b17023SJohn Marino another compilation unit. 68*e4b17023SJohn Marino 69*e4b17023SJohn Marino Debug information for a struct defined in the current source 70*e4b17023SJohn Marino file should be generated in the object file. Likewise the 71*e4b17023SJohn Marino debug information for a struct defined in a header should be 72*e4b17023SJohn Marino generated in the object file of the corresponding source file. 73*e4b17023SJohn Marino Both of these case are handled when the base name of the file of 74*e4b17023SJohn Marino the struct definition matches the base name of the source file 75*e4b17023SJohn Marino of the current compilation unit. This matching emits minimal 76*e4b17023SJohn Marino struct debugging information. 77*e4b17023SJohn Marino 78*e4b17023SJohn Marino The base file name matching rule above will fail to emit debug 79*e4b17023SJohn Marino information for structs defined in system headers. So a second 80*e4b17023SJohn Marino category of files includes system headers in addition to files 81*e4b17023SJohn Marino with matching bases. 82*e4b17023SJohn Marino 83*e4b17023SJohn Marino The remaining types of files are library headers and application 84*e4b17023SJohn Marino headers. We cannot currently distinguish these two types. */ 85*e4b17023SJohn Marino 86*e4b17023SJohn Marino enum debug_struct_file 87*e4b17023SJohn Marino { 88*e4b17023SJohn Marino DINFO_STRUCT_FILE_NONE, /* Debug no structs. */ 89*e4b17023SJohn Marino DINFO_STRUCT_FILE_BASE, /* Debug structs defined in files with the 90*e4b17023SJohn Marino same base name as the compilation unit. */ 91*e4b17023SJohn Marino DINFO_STRUCT_FILE_SYS, /* Also debug structs defined in system 92*e4b17023SJohn Marino header files. */ 93*e4b17023SJohn Marino DINFO_STRUCT_FILE_ANY /* Debug structs defined in all files. */ 94*e4b17023SJohn Marino }; 95*e4b17023SJohn Marino 96*e4b17023SJohn Marino /* Enumerate visibility settings. This is deliberately ordered from most 97*e4b17023SJohn Marino to least visibility. */ 98*e4b17023SJohn Marino #ifndef SYMBOL_VISIBILITY_DEFINED 99*e4b17023SJohn Marino #define SYMBOL_VISIBILITY_DEFINED 100*e4b17023SJohn Marino enum symbol_visibility 101*e4b17023SJohn Marino { 102*e4b17023SJohn Marino VISIBILITY_DEFAULT, 103*e4b17023SJohn Marino VISIBILITY_PROTECTED, 104*e4b17023SJohn Marino VISIBILITY_HIDDEN, 105*e4b17023SJohn Marino VISIBILITY_INTERNAL 106*e4b17023SJohn Marino }; 107*e4b17023SJohn Marino #endif 108*e4b17023SJohn Marino 109*e4b17023SJohn Marino /* The algorithm used for the integrated register allocator (IRA). */ 110*e4b17023SJohn Marino enum ira_algorithm 111*e4b17023SJohn Marino { 112*e4b17023SJohn Marino IRA_ALGORITHM_CB, 113*e4b17023SJohn Marino IRA_ALGORITHM_PRIORITY 114*e4b17023SJohn Marino }; 115*e4b17023SJohn Marino 116*e4b17023SJohn Marino /* The regions used for the integrated register allocator (IRA). */ 117*e4b17023SJohn Marino enum ira_region 118*e4b17023SJohn Marino { 119*e4b17023SJohn Marino IRA_REGION_ONE, 120*e4b17023SJohn Marino IRA_REGION_ALL, 121*e4b17023SJohn Marino IRA_REGION_MIXED, 122*e4b17023SJohn Marino /* This value means that there were no options -fira-region on the 123*e4b17023SJohn Marino command line and that we should choose a value depending on the 124*e4b17023SJohn Marino used -O option. */ 125*e4b17023SJohn Marino IRA_REGION_AUTODETECT 126*e4b17023SJohn Marino }; 127*e4b17023SJohn Marino 128*e4b17023SJohn Marino /* The options for excess precision. */ 129*e4b17023SJohn Marino enum excess_precision 130*e4b17023SJohn Marino { 131*e4b17023SJohn Marino EXCESS_PRECISION_DEFAULT, 132*e4b17023SJohn Marino EXCESS_PRECISION_FAST, 133*e4b17023SJohn Marino EXCESS_PRECISION_STANDARD 134*e4b17023SJohn Marino }; 135*e4b17023SJohn Marino 136*e4b17023SJohn Marino /* Selection of the graph form. */ 137*e4b17023SJohn Marino enum graph_dump_types 138*e4b17023SJohn Marino { 139*e4b17023SJohn Marino no_graph = 0, 140*e4b17023SJohn Marino vcg 141*e4b17023SJohn Marino }; 142*e4b17023SJohn Marino 143*e4b17023SJohn Marino /* Type of stack check. */ 144*e4b17023SJohn Marino enum stack_check_type 145*e4b17023SJohn Marino { 146*e4b17023SJohn Marino /* Do not check the stack. */ 147*e4b17023SJohn Marino NO_STACK_CHECK = 0, 148*e4b17023SJohn Marino 149*e4b17023SJohn Marino /* Check the stack generically, i.e. assume no specific support 150*e4b17023SJohn Marino from the target configuration files. */ 151*e4b17023SJohn Marino GENERIC_STACK_CHECK, 152*e4b17023SJohn Marino 153*e4b17023SJohn Marino /* Check the stack and rely on the target configuration files to 154*e4b17023SJohn Marino check the static frame of functions, i.e. use the generic 155*e4b17023SJohn Marino mechanism only for dynamic stack allocations. */ 156*e4b17023SJohn Marino STATIC_BUILTIN_STACK_CHECK, 157*e4b17023SJohn Marino 158*e4b17023SJohn Marino /* Check the stack and entirely rely on the target configuration 159*e4b17023SJohn Marino files, i.e. do not use the generic mechanism at all. */ 160*e4b17023SJohn Marino FULL_BUILTIN_STACK_CHECK 161*e4b17023SJohn Marino }; 162*e4b17023SJohn Marino 163*e4b17023SJohn Marino /* Names for the different levels of -Wstrict-overflow=N. The numeric 164*e4b17023SJohn Marino values here correspond to N. */ 165*e4b17023SJohn Marino 166*e4b17023SJohn Marino enum warn_strict_overflow_code 167*e4b17023SJohn Marino { 168*e4b17023SJohn Marino /* Overflow warning that should be issued with -Wall: a questionable 169*e4b17023SJohn Marino construct that is easy to avoid even when using macros. Example: 170*e4b17023SJohn Marino folding (x + CONSTANT > x) to 1. */ 171*e4b17023SJohn Marino WARN_STRICT_OVERFLOW_ALL = 1, 172*e4b17023SJohn Marino /* Overflow warning about folding a comparison to a constant because 173*e4b17023SJohn Marino of undefined signed overflow, other than cases covered by 174*e4b17023SJohn Marino WARN_STRICT_OVERFLOW_ALL. Example: folding (abs (x) >= 0) to 1 175*e4b17023SJohn Marino (this is false when x == INT_MIN). */ 176*e4b17023SJohn Marino WARN_STRICT_OVERFLOW_CONDITIONAL = 2, 177*e4b17023SJohn Marino /* Overflow warning about changes to comparisons other than folding 178*e4b17023SJohn Marino them to a constant. Example: folding (x + 1 > 1) to (x > 0). */ 179*e4b17023SJohn Marino WARN_STRICT_OVERFLOW_COMPARISON = 3, 180*e4b17023SJohn Marino /* Overflow warnings not covered by the above cases. Example: 181*e4b17023SJohn Marino folding ((x * 10) / 5) to (x * 2). */ 182*e4b17023SJohn Marino WARN_STRICT_OVERFLOW_MISC = 4, 183*e4b17023SJohn Marino /* Overflow warnings about reducing magnitude of constants in 184*e4b17023SJohn Marino comparison. Example: folding (x + 2 > y) to (x + 1 >= y). */ 185*e4b17023SJohn Marino WARN_STRICT_OVERFLOW_MAGNITUDE = 5 186*e4b17023SJohn Marino }; 187*e4b17023SJohn Marino 188*e4b17023SJohn Marino /* Floating-point contraction mode. */ 189*e4b17023SJohn Marino enum fp_contract_mode { 190*e4b17023SJohn Marino FP_CONTRACT_OFF = 0, 191*e4b17023SJohn Marino FP_CONTRACT_ON = 1, 192*e4b17023SJohn Marino FP_CONTRACT_FAST = 2 193*e4b17023SJohn Marino }; 194*e4b17023SJohn Marino 195*e4b17023SJohn Marino /* Vectorizer verbosity levels. */ 196*e4b17023SJohn Marino enum vect_verbosity_levels { 197*e4b17023SJohn Marino REPORT_NONE, 198*e4b17023SJohn Marino REPORT_VECTORIZED_LOCATIONS, 199*e4b17023SJohn Marino REPORT_UNVECTORIZED_LOCATIONS, 200*e4b17023SJohn Marino REPORT_COST, 201*e4b17023SJohn Marino REPORT_ALIGNMENT, 202*e4b17023SJohn Marino REPORT_DR_DETAILS, 203*e4b17023SJohn Marino REPORT_BAD_FORM_LOOPS, 204*e4b17023SJohn Marino REPORT_OUTER_LOOPS, 205*e4b17023SJohn Marino REPORT_SLP, 206*e4b17023SJohn Marino REPORT_DETAILS, 207*e4b17023SJohn Marino /* New verbosity levels should be added before this one. */ 208*e4b17023SJohn Marino MAX_VERBOSITY_LEVEL 209*e4b17023SJohn Marino }; 210*e4b17023SJohn Marino 211*e4b17023SJohn Marino #endif /* ! GCC_FLAG_TYPES_H */ 212