flag-types.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. /* Compilation switch flag type definitions for GCC.
  2. Copyright (C) 1987-2015 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_FLAG_TYPES_H
  16. #define GCC_FLAG_TYPES_H
  17. enum debug_info_type
  18. {
  19. NO_DEBUG, /* Write no debug info. */
  20. DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */
  21. SDB_DEBUG, /* Write COFF for (old) SDB (using sdbout.c). */
  22. DWARF2_DEBUG, /* Write Dwarf v2 debug info (using dwarf2out.c). */
  23. XCOFF_DEBUG, /* Write IBM/Xcoff debug info (using dbxout.c). */
  24. VMS_DEBUG, /* Write VMS debug info (using vmsdbgout.c). */
  25. VMS_AND_DWARF2_DEBUG /* Write VMS debug info (using vmsdbgout.c).
  26. and DWARF v2 debug info (using dwarf2out.c). */
  27. };
  28. enum debug_info_levels
  29. {
  30. DINFO_LEVEL_NONE, /* Write no debugging info. */
  31. DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */
  32. DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */
  33. DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */
  34. };
  35. /* A major contribution to object and executable size is debug
  36. information size. A major contribution to debug information
  37. size is struct descriptions replicated in several object files.
  38. The following function determines whether or not debug information
  39. should be generated for a given struct. The indirect parameter
  40. indicates that the struct is being handled indirectly, via
  41. a pointer. See opts.c for the implementation. */
  42. enum debug_info_usage
  43. {
  44. DINFO_USAGE_DFN, /* A struct definition. */
  45. DINFO_USAGE_DIR_USE, /* A direct use, such as the type of a variable. */
  46. DINFO_USAGE_IND_USE, /* An indirect use, such as through a pointer. */
  47. DINFO_USAGE_NUM_ENUMS /* The number of enumerators. */
  48. };
  49. /* A major contribution to object and executable size is debug
  50. information size. A major contribution to debug information size
  51. is struct descriptions replicated in several object files. The
  52. following flags attempt to reduce this information. The basic
  53. idea is to not emit struct debugging information in the current
  54. compilation unit when that information will be generated by
  55. another compilation unit.
  56. Debug information for a struct defined in the current source
  57. file should be generated in the object file. Likewise the
  58. debug information for a struct defined in a header should be
  59. generated in the object file of the corresponding source file.
  60. Both of these case are handled when the base name of the file of
  61. the struct definition matches the base name of the source file
  62. of the current compilation unit. This matching emits minimal
  63. struct debugging information.
  64. The base file name matching rule above will fail to emit debug
  65. information for structs defined in system headers. So a second
  66. category of files includes system headers in addition to files
  67. with matching bases.
  68. The remaining types of files are library headers and application
  69. headers. We cannot currently distinguish these two types. */
  70. enum debug_struct_file
  71. {
  72. DINFO_STRUCT_FILE_NONE, /* Debug no structs. */
  73. DINFO_STRUCT_FILE_BASE, /* Debug structs defined in files with the
  74. same base name as the compilation unit. */
  75. DINFO_STRUCT_FILE_SYS, /* Also debug structs defined in system
  76. header files. */
  77. DINFO_STRUCT_FILE_ANY /* Debug structs defined in all files. */
  78. };
  79. /* Enumerate visibility settings. This is deliberately ordered from most
  80. to least visibility. */
  81. #ifndef SYMBOL_VISIBILITY_DEFINED
  82. #define SYMBOL_VISIBILITY_DEFINED
  83. enum symbol_visibility
  84. {
  85. VISIBILITY_DEFAULT,
  86. VISIBILITY_PROTECTED,
  87. VISIBILITY_HIDDEN,
  88. VISIBILITY_INTERNAL
  89. };
  90. #endif
  91. /* Enumerate Objective-c instance variable visibility settings. */
  92. enum ivar_visibility
  93. {
  94. IVAR_VISIBILITY_PRIVATE,
  95. IVAR_VISIBILITY_PROTECTED,
  96. IVAR_VISIBILITY_PUBLIC,
  97. IVAR_VISIBILITY_PACKAGE
  98. };
  99. /* The stack reuse level. */
  100. enum stack_reuse_level
  101. {
  102. SR_NONE,
  103. SR_NAMED_VARS,
  104. SR_ALL
  105. };
  106. /* The algorithm used for the integrated register allocator (IRA). */
  107. enum ira_algorithm
  108. {
  109. IRA_ALGORITHM_CB,
  110. IRA_ALGORITHM_PRIORITY
  111. };
  112. /* The regions used for the integrated register allocator (IRA). */
  113. enum ira_region
  114. {
  115. IRA_REGION_ONE,
  116. IRA_REGION_ALL,
  117. IRA_REGION_MIXED,
  118. /* This value means that there were no options -fira-region on the
  119. command line and that we should choose a value depending on the
  120. used -O option. */
  121. IRA_REGION_AUTODETECT
  122. };
  123. /* The options for excess precision. */
  124. enum excess_precision
  125. {
  126. EXCESS_PRECISION_DEFAULT,
  127. EXCESS_PRECISION_FAST,
  128. EXCESS_PRECISION_STANDARD
  129. };
  130. /* Type of stack check. */
  131. enum stack_check_type
  132. {
  133. /* Do not check the stack. */
  134. NO_STACK_CHECK = 0,
  135. /* Check the stack generically, i.e. assume no specific support
  136. from the target configuration files. */
  137. GENERIC_STACK_CHECK,
  138. /* Check the stack and rely on the target configuration files to
  139. check the static frame of functions, i.e. use the generic
  140. mechanism only for dynamic stack allocations. */
  141. STATIC_BUILTIN_STACK_CHECK,
  142. /* Check the stack and entirely rely on the target configuration
  143. files, i.e. do not use the generic mechanism at all. */
  144. FULL_BUILTIN_STACK_CHECK
  145. };
  146. /* Names for the different levels of -Wstrict-overflow=N. The numeric
  147. values here correspond to N. */
  148. enum warn_strict_overflow_code
  149. {
  150. /* Overflow warning that should be issued with -Wall: a questionable
  151. construct that is easy to avoid even when using macros. Example:
  152. folding (x + CONSTANT > x) to 1. */
  153. WARN_STRICT_OVERFLOW_ALL = 1,
  154. /* Overflow warning about folding a comparison to a constant because
  155. of undefined signed overflow, other than cases covered by
  156. WARN_STRICT_OVERFLOW_ALL. Example: folding (abs (x) >= 0) to 1
  157. (this is false when x == INT_MIN). */
  158. WARN_STRICT_OVERFLOW_CONDITIONAL = 2,
  159. /* Overflow warning about changes to comparisons other than folding
  160. them to a constant. Example: folding (x + 1 > 1) to (x > 0). */
  161. WARN_STRICT_OVERFLOW_COMPARISON = 3,
  162. /* Overflow warnings not covered by the above cases. Example:
  163. folding ((x * 10) / 5) to (x * 2). */
  164. WARN_STRICT_OVERFLOW_MISC = 4,
  165. /* Overflow warnings about reducing magnitude of constants in
  166. comparison. Example: folding (x + 2 > y) to (x + 1 >= y). */
  167. WARN_STRICT_OVERFLOW_MAGNITUDE = 5
  168. };
  169. /* Floating-point contraction mode. */
  170. enum fp_contract_mode {
  171. FP_CONTRACT_OFF = 0,
  172. FP_CONTRACT_ON = 1,
  173. FP_CONTRACT_FAST = 2
  174. };
  175. /* Vectorizer cost-model. */
  176. enum vect_cost_model {
  177. VECT_COST_MODEL_UNLIMITED = 0,
  178. VECT_COST_MODEL_CHEAP = 1,
  179. VECT_COST_MODEL_DYNAMIC = 2,
  180. VECT_COST_MODEL_DEFAULT = 3
  181. };
  182. /* Different instrumentation modes. */
  183. enum sanitize_code {
  184. /* AddressSanitizer. */
  185. SANITIZE_ADDRESS = 1 << 0,
  186. SANITIZE_USER_ADDRESS = 1 << 1,
  187. SANITIZE_KERNEL_ADDRESS = 1 << 2,
  188. /* ThreadSanitizer. */
  189. SANITIZE_THREAD = 1 << 3,
  190. /* LeakSanitizer. */
  191. SANITIZE_LEAK = 1 << 4,
  192. /* UndefinedBehaviorSanitizer. */
  193. SANITIZE_SHIFT = 1 << 5,
  194. SANITIZE_DIVIDE = 1 << 6,
  195. SANITIZE_UNREACHABLE = 1 << 7,
  196. SANITIZE_VLA = 1 << 8,
  197. SANITIZE_NULL = 1 << 9,
  198. SANITIZE_RETURN = 1 << 10,
  199. SANITIZE_SI_OVERFLOW = 1 << 11,
  200. SANITIZE_BOOL = 1 << 12,
  201. SANITIZE_ENUM = 1 << 13,
  202. SANITIZE_FLOAT_DIVIDE = 1 << 14,
  203. SANITIZE_FLOAT_CAST = 1 << 15,
  204. SANITIZE_BOUNDS = 1UL << 16,
  205. SANITIZE_ALIGNMENT = 1UL << 17,
  206. SANITIZE_NONNULL_ATTRIBUTE = 1UL << 18,
  207. SANITIZE_RETURNS_NONNULL_ATTRIBUTE = 1UL << 19,
  208. SANITIZE_OBJECT_SIZE = 1UL << 20,
  209. SANITIZE_VPTR = 1UL << 21,
  210. SANITIZE_UNDEFINED = SANITIZE_SHIFT | SANITIZE_DIVIDE | SANITIZE_UNREACHABLE
  211. | SANITIZE_VLA | SANITIZE_NULL | SANITIZE_RETURN
  212. | SANITIZE_SI_OVERFLOW | SANITIZE_BOOL | SANITIZE_ENUM
  213. | SANITIZE_BOUNDS | SANITIZE_ALIGNMENT
  214. | SANITIZE_NONNULL_ATTRIBUTE
  215. | SANITIZE_RETURNS_NONNULL_ATTRIBUTE
  216. | SANITIZE_OBJECT_SIZE | SANITIZE_VPTR,
  217. SANITIZE_NONDEFAULT = SANITIZE_FLOAT_DIVIDE | SANITIZE_FLOAT_CAST
  218. };
  219. /* flag_vtable_verify initialization levels. */
  220. enum vtv_priority {
  221. VTV_NO_PRIORITY = 0, /* i.E. Do NOT do vtable verification. */
  222. VTV_STANDARD_PRIORITY = 1,
  223. VTV_PREINIT_PRIORITY = 2
  224. };
  225. /* flag_lto_partition initialization values. */
  226. enum lto_partition_model {
  227. LTO_PARTITION_NONE = 0,
  228. LTO_PARTITION_ONE = 1,
  229. LTO_PARTITION_BALANCED = 2,
  230. LTO_PARTITION_1TO1 = 3,
  231. LTO_PARTITION_MAX = 4
  232. };
  233. /* gfortran -finit-real= values. */
  234. enum gfc_init_local_real
  235. {
  236. GFC_INIT_REAL_OFF = 0,
  237. GFC_INIT_REAL_ZERO,
  238. GFC_INIT_REAL_NAN,
  239. GFC_INIT_REAL_SNAN,
  240. GFC_INIT_REAL_INF,
  241. GFC_INIT_REAL_NEG_INF
  242. };
  243. /* gfortran -fcoarray= values. */
  244. enum gfc_fcoarray
  245. {
  246. GFC_FCOARRAY_NONE = 0,
  247. GFC_FCOARRAY_SINGLE,
  248. GFC_FCOARRAY_LIB
  249. };
  250. /* gfortran -fconvert= values; used for unformatted I/O.
  251. Keep in sync with GFC_CONVERT_* in gcc/fortran/libgfortran.h. */
  252. enum gfc_convert
  253. {
  254. GFC_FLAG_CONVERT_NATIVE = 0,
  255. GFC_FLAG_CONVERT_SWAP,
  256. GFC_FLAG_CONVERT_BIG,
  257. GFC_FLAG_CONVERT_LITTLE
  258. };
  259. #endif /* ! GCC_FLAG_TYPES_H */