1//===--- CodeGenOptions.def - Code generation option database ----- C++ -*-===// 2// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6// 7//===----------------------------------------------------------------------===// 8// 9// This file defines the code generation options. Users of this file 10// must define the CODEGENOPT macro to make use of this information. 11// Optionally, the user may also define ENUM_CODEGENOPT (for options 12// that have enumeration type and VALUE_CODEGENOPT is a code 13// generation option that describes a value rather than a flag. 14// 15//===----------------------------------------------------------------------===// 16#ifndef CODEGENOPT 17# error Define the CODEGENOPT macro to handle language options 18#endif 19 20#ifndef VALUE_CODEGENOPT 21# define VALUE_CODEGENOPT(Name, Bits, Default) \ 22CODEGENOPT(Name, Bits, Default) 23#endif 24 25#ifndef ENUM_CODEGENOPT 26# define ENUM_CODEGENOPT(Name, Type, Bits, Default) \ 27CODEGENOPT(Name, Bits, Default) 28#endif 29 30CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as 31ENUM_CODEGENOPT(CompressDebugSections, llvm::DebugCompressionType, 2, 32 llvm::DebugCompressionType::None) 33CODEGENOPT(RelaxELFRelocations, 1, 0) ///< -Wa,--mrelax-relocations 34CODEGENOPT(AsmVerbose , 1, 0) ///< -dA, -fverbose-asm. 35CODEGENOPT(Dwarf64 , 1, 0) ///< -gdwarf64. 36CODEGENOPT(Dwarf32 , 1, 1) ///< -gdwarf32. 37CODEGENOPT(PreserveAsmComments, 1, 1) ///< -dA, -fno-preserve-as-comments. 38CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit __attribute__((malloc)) operator new 39CODEGENOPT(Autolink , 1, 1) ///< -fno-autolink 40CODEGENOPT(ObjCAutoRefCountExceptions , 1, 0) ///< Whether ARC should be EH-safe. 41CODEGENOPT(Backchain , 1, 0) ///< -mbackchain 42CODEGENOPT(ControlFlowGuardNoChecks , 1, 0) ///< -cfguard-no-checks 43CODEGENOPT(ControlFlowGuard , 1, 0) ///< -cfguard 44CODEGENOPT(EHContGuard , 1, 0) ///< -ehcontguard 45CODEGENOPT(CXAAtExit , 1, 1) ///< Use __cxa_atexit for calling destructors. 46CODEGENOPT(RegisterGlobalDtorsWithAtExit, 1, 1) ///< Use atexit or __cxa_atexit to register global destructors. 47CODEGENOPT(CXXCtorDtorAliases, 1, 0) ///< Emit complete ctors/dtors as linker 48 ///< aliases to base ctors when possible. 49CODEGENOPT(DataSections , 1, 0) ///< Set when -fdata-sections is enabled. 50CODEGENOPT(UniqueSectionNames, 1, 1) ///< Set for -funique-section-names. 51CODEGENOPT(UniqueBasicBlockSectionNames, 1, 1) ///< Set for -funique-basic-block-section-names, 52 ///< Produce unique section names with 53 ///< basic block sections. 54CODEGENOPT(EnableAIXExtendedAltivecABI, 1, 0) ///< Set for -mabi=vec-extabi. Enables the extended Altivec ABI on AIX. 55ENUM_CODEGENOPT(FramePointer, FramePointerKind, 2, FramePointerKind::None) /// frame-pointer: all,non-leaf,none 56 57CODEGENOPT(ClearASTBeforeBackend , 1, 0) ///< Free the AST before running backend code generation. Only works with -disable-free. 58CODEGENOPT(DisableFree , 1, 0) ///< Don't free memory. 59CODEGENOPT(DiscardValueNames , 1, 0) ///< Discard Value Names from the IR (LLVMContext flag) 60CODEGENOPT(DisableLLVMPasses , 1, 0) ///< Don't run any LLVM IR passes to get 61 ///< the pristine IR generated by the 62 ///< frontend. 63CODEGENOPT(DisableLifetimeMarkers, 1, 0) ///< Don't emit any lifetime markers 64CODEGENOPT(DisableO0ImplyOptNone , 1, 0) ///< Don't annonate function with optnone at O0 65CODEGENOPT(ExperimentalStrictFloatingPoint, 1, 0) ///< Enables the new, experimental 66 ///< strict floating point. 67CODEGENOPT(EnableNoundefAttrs, 1, 0) ///< Enable emitting `noundef` attributes on IR call arguments and return values 68CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new 69 ///< pass manager. 70CODEGENOPT(DisableRedZone , 1, 0) ///< Set when -mno-red-zone is enabled. 71CODEGENOPT(EmitCallSiteInfo, 1, 0) ///< Emit call site info only in the case of 72 ///< '-g' + 'O>0' level. 73CODEGENOPT(EnableDIPreservationVerify, 1, 0) ///< Enable di preservation verify 74 ///< each (it means check 75 ///< the original debug info 76 ///< metadata preservation). 77CODEGENOPT(IndirectTlsSegRefs, 1, 0) ///< Set when -mno-tls-direct-seg-refs 78 ///< is specified. 79CODEGENOPT(DisableTailCalls , 1, 0) ///< Do not emit tail calls. 80CODEGENOPT(NoEscapingBlockTailCalls, 1, 0) ///< Do not emit tail calls from 81 ///< escaping blocks. 82CODEGENOPT(EmitDeclMetadata , 1, 0) ///< Emit special metadata indicating what 83 ///< Decl* various IR entities came from. 84 ///< Only useful when running CodeGen as a 85 ///< subroutine. 86CODEGENOPT(EmitVersionIdentMetadata , 1, 1) ///< Emit compiler version metadata. 87CODEGENOPT(EmitGcovArcs , 1, 0) ///< Emit coverage data files, aka. GCDA. 88CODEGENOPT(EmitGcovNotes , 1, 0) ///< Emit coverage "notes" files, aka GCNO. 89CODEGENOPT(EmitOpenCLArgMetadata , 1, 0) ///< Emit OpenCL kernel arg metadata. 90CODEGENOPT(EmulatedTLS , 1, 0) ///< Set by default or -f[no-]emulated-tls. 91CODEGENOPT(ExplicitEmulatedTLS , 1, 0) ///< Set if -f[no-]emulated-tls is used. 92/// Embed Bitcode mode (off/all/bitcode/marker). 93ENUM_CODEGENOPT(EmbedBitcode, EmbedBitcodeKind, 2, Embed_Off) 94/// Inline asm dialect, -masm=(att|intel) 95ENUM_CODEGENOPT(InlineAsmDialect, InlineAsmDialectKind, 1, IAD_ATT) 96CODEGENOPT(ForbidGuardVariables , 1, 0) ///< Issue errors if C++ guard variables 97 ///< are required. 98CODEGENOPT(FunctionSections , 1, 0) ///< Set when -ffunction-sections is enabled. 99CODEGENOPT(InstrumentFunctions , 1, 0) ///< Set when -finstrument-functions is 100 ///< enabled. 101CODEGENOPT(InstrumentFunctionsAfterInlining , 1, 0) ///< Set when 102 ///< -finstrument-functions-after-inlining is enabled. 103CODEGENOPT(InstrumentFunctionEntryBare , 1, 0) ///< Set when 104 ///< -finstrument-function-entry-bare is enabled. 105CODEGENOPT(CFProtectionReturn , 1, 0) ///< if -fcf-protection is 106 ///< set to full or return. 107CODEGENOPT(CFProtectionBranch , 1, 0) ///< if -fcf-protection is 108 ///< set to full or branch. 109CODEGENOPT(IBTSeal, 1, 0) ///< set to optimize CFProtectionBranch. 110CODEGENOPT(FunctionReturnThunks, 1, 0) ///< -mfunction-return={keep|thunk-extern} 111 112CODEGENOPT(XRayInstrumentFunctions , 1, 0) ///< Set when -fxray-instrument is 113 ///< enabled. 114CODEGENOPT(StackSizeSection , 1, 0) ///< Set when -fstack-size-section is enabled. 115CODEGENOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame is 116 ///< enabled. 117 118///< Set when -femit-dwarf-unwind is passed. 119ENUM_CODEGENOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2, 120 llvm::EmitDwarfUnwindType::Default) 121 122///< Set when -fxray-always-emit-customevents is enabled. 123CODEGENOPT(XRayAlwaysEmitCustomEvents , 1, 0) 124 125///< Set when -fxray-always-emit-typedevents is enabled. 126CODEGENOPT(XRayAlwaysEmitTypedEvents , 1, 0) 127 128///< Set when -fxray-ignore-loops is enabled. 129CODEGENOPT(XRayIgnoreLoops , 1, 0) 130 131///< Set with -fno-xray-function-index to omit the index section. 132CODEGENOPT(XRayOmitFunctionIndex , 1, 0) 133 134 135///< Set the minimum number of instructions in a function to determine selective 136///< XRay instrumentation. 137VALUE_CODEGENOPT(XRayInstructionThreshold , 32, 200) 138 139///< Only instrument 1 in N functions, by dividing functions into N total groups and 140///< instrumenting only the specified group at a time. Group numbers start at 0 141///< and end at N-1. 142VALUE_CODEGENOPT(XRayTotalFunctionGroups, 32, 1) 143VALUE_CODEGENOPT(XRaySelectedFunctionGroup, 32, 0) 144 145VALUE_CODEGENOPT(PatchableFunctionEntryCount , 32, 0) ///< Number of NOPs at function entry 146VALUE_CODEGENOPT(PatchableFunctionEntryOffset , 32, 0) 147 148CODEGENOPT(HotPatch, 1, 0) ///< Supports the Microsoft /HOTPATCH flag and 149 ///< generates a 'patchable-function' attribute. 150 151CODEGENOPT(JMCInstrument, 1, 0) ///< Set when -fjmc is enabled. 152CODEGENOPT(InstrumentForProfiling , 1, 0) ///< Set when -pg is enabled. 153CODEGENOPT(CallFEntry , 1, 0) ///< Set when -mfentry is enabled. 154CODEGENOPT(MNopMCount , 1, 0) ///< Set when -mnop-mcount is enabled. 155CODEGENOPT(RecordMCount , 1, 0) ///< Set when -mrecord-mcount is enabled. 156CODEGENOPT(PackedStack , 1, 0) ///< Set when -mpacked-stack is enabled. 157CODEGENOPT(LessPreciseFPMAD , 1, 0) ///< Enable less precise MAD instructions to 158 ///< be generated. 159CODEGENOPT(PrepareForLTO , 1, 0) ///< Set when -flto is enabled on the 160 ///< compile step. 161CODEGENOPT(PrepareForThinLTO , 1, 0) ///< Set when -flto=thin is enabled on the 162 ///< compile step. 163CODEGENOPT(LTOUnit, 1, 0) ///< Emit IR to support LTO unit features (CFI, whole 164 ///< program vtable opt). 165CODEGENOPT(EnableSplitLTOUnit, 1, 0) ///< Enable LTO unit splitting to support 166 /// CFI and traditional whole program 167 /// devirtualization that require whole 168 /// program IR support. 169CODEGENOPT(IncrementalLinkerCompatible, 1, 0) ///< Emit an object file which can 170 ///< be used with an incremental 171 ///< linker. 172CODEGENOPT(MergeAllConstants , 1, 1) ///< Merge identical constants. 173CODEGENOPT(MergeFunctions , 1, 0) ///< Set when -fmerge-functions is enabled. 174CODEGENOPT(MSVolatile , 1, 0) ///< Set when /volatile:ms is enabled. 175CODEGENOPT(NoCommon , 1, 0) ///< Set when -fno-common or C++ is enabled. 176CODEGENOPT(NoDwarfDirectoryAsm , 1, 0) ///< Set when -fno-dwarf-directory-asm is 177 ///< enabled. 178CODEGENOPT(NoExecStack , 1, 0) ///< Set when -Wa,--noexecstack is enabled. 179CODEGENOPT(FatalWarnings , 1, 0) ///< Set when -Wa,--fatal-warnings is 180 ///< enabled. 181CODEGENOPT(NoWarn , 1, 0) ///< Set when -Wa,--no-warn is enabled. 182CODEGENOPT(MisExpect , 1, 0) ///< Set when -Wmisexpect is enabled 183CODEGENOPT(EnableSegmentedStacks , 1, 0) ///< Set when -fsplit-stack is enabled. 184CODEGENOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain 185 ///< inline line tables. 186CODEGENOPT(StackClashProtector, 1, 0) ///< Set when -fstack-clash-protection is enabled. 187CODEGENOPT(NoImplicitFloat , 1, 0) ///< Set when -mno-implicit-float is enabled. 188CODEGENOPT(NullPointerIsValid , 1, 0) ///< Assume Null pointer deference is defined. 189CODEGENOPT(OpenCLCorrectlyRoundedDivSqrt, 1, 0) ///< -cl-fp32-correctly-rounded-divide-sqrt 190CODEGENOPT(HIPCorrectlyRoundedDivSqrt, 1, 1) ///< -fno-hip-fp32-correctly-rounded-divide-sqrt 191CODEGENOPT(HIPSaveKernelArgName, 1, 0) ///< Set when -fhip-kernel-arg-name is enabled. 192CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get unique names. 193CODEGENOPT(SplitMachineFunctions, 1, 0) ///< Split machine functions using profile information. 194 195/// When false, this attempts to generate code as if the result of an 196/// overflowing conversion matches the overflowing behavior of a target's native 197/// float-to-int conversion instructions. 198CODEGENOPT(StrictFloatCastOverflow, 1, 1) 199 200CODEGENOPT(UniformWGSize , 1, 0) ///< -cl-uniform-work-group-size 201CODEGENOPT(NoZeroInitializedInBSS , 1, 0) ///< -fno-zero-initialized-in-bss. 202/// Method of Objective-C dispatch to use. 203ENUM_CODEGENOPT(ObjCDispatchMethod, ObjCDispatchMethodKind, 2, Legacy) 204/// Replace certain message sends with calls to ObjC runtime entrypoints 205CODEGENOPT(ObjCConvertMessagesToRuntimeCalls , 1, 1) 206CODEGENOPT(ObjCAvoidHeapifyLocalBlocks, 1, 0) 207 208VALUE_CODEGENOPT(OptimizationLevel, 2, 0) ///< The -O[0-3] option specified. 209VALUE_CODEGENOPT(OptimizeSize, 2, 0) ///< If -Os (==1) or -Oz (==2) is specified. 210 211CODEGENOPT(AtomicProfileUpdate , 1, 0) ///< Set -fprofile-update=atomic 212/// Choose profile instrumenation kind or no instrumentation. 213ENUM_CODEGENOPT(ProfileInstr, ProfileInstrKind, 2, ProfileNone) 214/// Choose profile kind for PGO use compilation. 215ENUM_CODEGENOPT(ProfileUse, ProfileInstrKind, 2, ProfileNone) 216/// Partition functions into N groups and select only functions in group i to be 217/// instrumented. Selected group numbers can be 0 to N-1 inclusive. 218VALUE_CODEGENOPT(ProfileTotalFunctionGroups, 32, 1) 219VALUE_CODEGENOPT(ProfileSelectedFunctionGroup, 32, 0) 220CODEGENOPT(CoverageMapping , 1, 0) ///< Generate coverage mapping regions to 221 ///< enable code coverage analysis. 222CODEGENOPT(DumpCoverageMapping , 1, 0) ///< Dump the generated coverage mapping 223 ///< regions. 224 225 /// If -fpcc-struct-return or -freg-struct-return is specified. 226ENUM_CODEGENOPT(StructReturnConvention, StructReturnConventionKind, 2, SRCK_Default) 227 228CODEGENOPT(RelaxAll , 1, 0) ///< Relax all machine code instructions. 229CODEGENOPT(RelaxedAliasing , 1, 0) ///< Set when -fno-strict-aliasing is enabled. 230CODEGENOPT(StructPathTBAA , 1, 0) ///< Whether or not to use struct-path TBAA. 231CODEGENOPT(NewStructPathTBAA , 1, 0) ///< Whether or not to use enhanced struct-path TBAA. 232CODEGENOPT(SaveTempLabels , 1, 0) ///< Save temporary labels. 233CODEGENOPT(SanitizeAddressUseAfterScope , 1, 0) ///< Enable use-after-scope detection 234 ///< in AddressSanitizer 235ENUM_CODEGENOPT(SanitizeAddressUseAfterReturn, 236 llvm::AsanDetectStackUseAfterReturnMode, 2, 237 llvm::AsanDetectStackUseAfterReturnMode::Runtime 238 ) ///< Set detection mode for stack-use-after-return. 239CODEGENOPT(SanitizeAddressPoisonCustomArrayCookie, 1, 240 0) ///< Enable poisoning operator new[] which is not a replaceable 241 ///< global allocation function in AddressSanitizer 242CODEGENOPT(SanitizeAddressGlobalsDeadStripping, 1, 0) ///< Enable linker dead stripping 243 ///< of globals in AddressSanitizer 244CODEGENOPT(SanitizeAddressUseOdrIndicator, 1, 0) ///< Enable ODR indicator globals 245CODEGENOPT(SanitizeMemoryTrackOrigins, 2, 0) ///< Enable tracking origins in 246 ///< MemorySanitizer 247ENUM_CODEGENOPT(SanitizeAddressDtor, llvm::AsanDtorKind, 2, 248 llvm::AsanDtorKind::Global) ///< Set how ASan global 249 ///< destructors are emitted. 250CODEGENOPT(SanitizeMemoryParamRetval, 1, 0) ///< Enable detection of uninitialized 251 ///< parameters and return values 252 ///< in MemorySanitizer 253CODEGENOPT(SanitizeMemoryUseAfterDtor, 1, 0) ///< Enable use-after-delete detection 254 ///< in MemorySanitizer 255CODEGENOPT(SanitizeCfiCrossDso, 1, 0) ///< Enable cross-dso support in CFI. 256CODEGENOPT(SanitizeMinimalRuntime, 1, 0) ///< Use "_minimal" sanitizer runtime for 257 ///< diagnostics. 258CODEGENOPT(SanitizeCfiICallGeneralizePointers, 1, 0) ///< Generalize pointer types in 259 ///< CFI icall function signatures 260CODEGENOPT(SanitizeCfiCanonicalJumpTables, 1, 0) ///< Make jump table symbols canonical 261 ///< instead of creating a local jump table. 262CODEGENOPT(SanitizeCoverageType, 2, 0) ///< Type of sanitizer coverage 263 ///< instrumentation. 264CODEGENOPT(SanitizeCoverageIndirectCalls, 1, 0) ///< Enable sanitizer coverage 265 ///< for indirect calls. 266CODEGENOPT(SanitizeCoverageTraceBB, 1, 0) ///< Enable basic block tracing in 267 ///< in sanitizer coverage. 268CODEGENOPT(SanitizeCoverageTraceCmp, 1, 0) ///< Enable cmp instruction tracing 269 ///< in sanitizer coverage. 270CODEGENOPT(SanitizeCoverageTraceDiv, 1, 0) ///< Enable div instruction tracing 271 ///< in sanitizer coverage. 272CODEGENOPT(SanitizeCoverageTraceGep, 1, 0) ///< Enable GEP instruction tracing 273 ///< in sanitizer coverage. 274CODEGENOPT(SanitizeCoverage8bitCounters, 1, 0) ///< Use 8-bit frequency counters 275 ///< in sanitizer coverage. 276CODEGENOPT(SanitizeCoverageTracePC, 1, 0) ///< Enable PC tracing 277 ///< in sanitizer coverage. 278CODEGENOPT(SanitizeCoverageTracePCGuard, 1, 0) ///< Enable PC tracing with guard 279 ///< in sanitizer coverage. 280CODEGENOPT(SanitizeCoverageInline8bitCounters, 1, 0) ///< Use inline 8bit counters. 281CODEGENOPT(SanitizeCoverageInlineBoolFlag, 1, 0) ///< Use inline bool flag. 282CODEGENOPT(SanitizeCoveragePCTable, 1, 0) ///< Create a PC Table. 283CODEGENOPT(SanitizeCoverageNoPrune, 1, 0) ///< Disable coverage pruning. 284CODEGENOPT(SanitizeCoverageStackDepth, 1, 0) ///< Enable max stack depth tracing 285CODEGENOPT(SanitizeCoverageTraceLoads, 1, 0) ///< Enable tracing of loads. 286CODEGENOPT(SanitizeCoverageTraceStores, 1, 0) ///< Enable tracing of stores. 287CODEGENOPT(SanitizeStats , 1, 0) ///< Collect statistics for sanitizers. 288CODEGENOPT(SimplifyLibCalls , 1, 1) ///< Set when -fbuiltin is enabled. 289CODEGENOPT(SoftFloat , 1, 0) ///< -soft-float. 290CODEGENOPT(SpeculativeLoadHardening, 1, 0) ///< Enable speculative load hardening. 291CODEGENOPT(FineGrainedBitfieldAccesses, 1, 0) ///< Enable fine-grained bitfield accesses. 292CODEGENOPT(StrictEnums , 1, 0) ///< Optimize based on strict enum definition. 293CODEGENOPT(StrictVTablePointers, 1, 0) ///< Optimize based on the strict vtable pointers 294CODEGENOPT(TimePasses , 1, 0) ///< Set when -ftime-report or -ftime-report= is enabled. 295CODEGENOPT(TimePassesPerRun , 1, 0) ///< Set when -ftime-report=per-pass-run is enabled. 296CODEGENOPT(TimeTrace , 1, 0) ///< Set when -ftime-trace is enabled. 297VALUE_CODEGENOPT(TimeTraceGranularity, 32, 500) ///< Minimum time granularity (in microseconds), 298 ///< traced by time profiler 299CODEGENOPT(UnrollLoops , 1, 0) ///< Control whether loops are unrolled. 300CODEGENOPT(RerollLoops , 1, 0) ///< Control whether loops are rerolled. 301CODEGENOPT(NoUseJumpTables , 1, 0) ///< Set when -fno-jump-tables is enabled. 302VALUE_CODEGENOPT(UnwindTables, 2, 0) ///< Unwind tables (1) or asynchronous unwind tables (2) 303CODEGENOPT(VectorizeLoop , 1, 0) ///< Run loop vectorizer. 304CODEGENOPT(VectorizeSLP , 1, 0) ///< Run SLP vectorizer. 305CODEGENOPT(ProfileSampleAccurate, 1, 0) ///< Sample profile is accurate. 306 307/// Treat loops as finite: language, always, never. 308ENUM_CODEGENOPT(FiniteLoops, FiniteLoopsKind, 2, FiniteLoopsKind::Language) 309 310 /// Attempt to use register sized accesses to bit-fields in structures, when 311 /// possible. 312CODEGENOPT(UseRegisterSizedBitfieldAccess , 1, 0) 313 314CODEGENOPT(VerifyModule , 1, 1) ///< Control whether the module should be run 315 ///< through the LLVM Verifier. 316 317CODEGENOPT(StackRealignment , 1, 0) ///< Control whether to force stack 318 ///< realignment. 319CODEGENOPT(UseInitArray , 1, 0) ///< Control whether to use .init_array or 320 ///< .ctors. 321VALUE_CODEGENOPT(LoopAlignment , 32, 0) ///< Overrides default loop 322 ///< alignment, if not 0. 323VALUE_CODEGENOPT(StackAlignment , 32, 0) ///< Overrides default stack 324 ///< alignment, if not 0. 325VALUE_CODEGENOPT(StackProbeSize , 32, 4096) ///< Overrides default stack 326 ///< probe size, even if 0. 327VALUE_CODEGENOPT(WarnStackSize , 32, UINT_MAX) ///< Set via -fwarn-stack-size. 328CODEGENOPT(NoStackArgProbe, 1, 0) ///< Set when -mno-stack-arg-probe is used 329CODEGENOPT(DebugStrictDwarf, 1, 1) ///< Whether or not to use strict DWARF info. 330CODEGENOPT(DebugColumnInfo, 1, 0) ///< Whether or not to use column information 331 ///< in debug info. 332 333CODEGENOPT(DebugTypeExtRefs, 1, 0) ///< Whether or not debug info should contain 334 ///< external references to a PCH or module. 335 336CODEGENOPT(DebugExplicitImport, 1, 0) ///< Whether or not debug info should 337 ///< contain explicit imports for 338 ///< anonymous namespaces 339 340CODEGENOPT(SplitDwarfInlining, 1, 1) ///< Whether to include inlining info in the 341 ///< skeleton CU to allow for symbolication 342 ///< of inline stack frames without .dwo files. 343CODEGENOPT(DebugFwdTemplateParams, 1, 0) ///< Whether to emit complete 344 ///< template parameter descriptions in 345 ///< forward declarations (versus just 346 ///< including them in the name). 347ENUM_CODEGENOPT(DebugSimpleTemplateNames, codegenoptions::DebugTemplateNamesKind, 2, codegenoptions::DebugTemplateNamesKind::Full) ///< Whether to emit template parameters 348 ///< in the textual names of template 349 ///< specializations. 350 ///< Implies DebugFwdTemplateNames to 351 ///< allow decorated names to be 352 ///< reconstructed when needed. 353CODEGENOPT(EmitLLVMUseLists, 1, 0) ///< Control whether to serialize use-lists. 354 355CODEGENOPT(WholeProgramVTables, 1, 0) ///< Whether to apply whole-program 356 /// vtable optimization. 357 358CODEGENOPT(VirtualFunctionElimination, 1, 0) ///< Whether to apply the dead 359 /// virtual function elimination 360 /// optimization. 361 362/// Whether to use public LTO visibility for entities in std and stdext 363/// namespaces. This is enabled by clang-cl's /MT and /MTd flags. 364CODEGENOPT(LTOVisibilityPublicStd, 1, 0) 365 366/// The user specified number of registers to be used for integral arguments, 367/// or 0 if unspecified. 368VALUE_CODEGENOPT(NumRegisterParameters, 32, 0) 369 370/// The threshold to put data into small data section. 371VALUE_CODEGENOPT(SmallDataLimit, 32, 0) 372 373/// The lower bound for a buffer to be considered for stack protection. 374VALUE_CODEGENOPT(SSPBufferSize, 32, 0) 375 376/// The kind of generated debug info. 377ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 4, codegenoptions::NoDebugInfo) 378 379/// Whether to generate macro debug info. 380CODEGENOPT(MacroDebugInfo, 1, 0) 381 382/// Tune the debug info for this debugger. 383ENUM_CODEGENOPT(DebuggerTuning, llvm::DebuggerKind, 3, 384 llvm::DebuggerKind::Default) 385 386/// Dwarf version. Version zero indicates to LLVM that no DWARF should be 387/// emitted. 388VALUE_CODEGENOPT(DwarfVersion, 3, 0) 389 390/// Whether we should emit CodeView debug information. It's possible to emit 391/// CodeView and DWARF into the same object. 392CODEGENOPT(EmitCodeView, 1, 0) 393 394/// Whether to emit the .debug$H section containing hashes of CodeView types. 395CODEGENOPT(CodeViewGHash, 1, 0) 396 397/// The kind of inlining to perform. 398ENUM_CODEGENOPT(Inlining, InliningMethod, 2, NormalInlining) 399 400// Vector functions library to use. 401ENUM_CODEGENOPT(VecLib, VectorLibrary, 3, NoLibrary) 402 403/// The default TLS model to use. 404ENUM_CODEGENOPT(DefaultTLSModel, TLSModel, 2, GeneralDynamicTLSModel) 405 406/// Bit size of immediate TLS offsets (0 == use the default). 407VALUE_CODEGENOPT(TLSSize, 8, 0) 408 409/// The default stack protector guard offset to use. 410VALUE_CODEGENOPT(StackProtectorGuardOffset, 32, INT_MAX) 411 412/// Number of path components to strip when emitting checks. (0 == full 413/// filename) 414VALUE_CODEGENOPT(EmitCheckPathComponentsToStrip, 32, 0) 415 416/// Whether to report the hotness of the code region for optimization remarks. 417CODEGENOPT(DiagnosticsWithHotness, 1, 0) 418 419/// Whether to use direct access relocations (instead of GOT) to reference external data symbols. 420CODEGENOPT(DirectAccessExternalData, 1, 0) 421 422/// Whether we should use the undefined behaviour optimization for control flow 423/// paths that reach the end of a function without executing a required return. 424CODEGENOPT(StrictReturn, 1, 1) 425 426/// Whether emit extra debug info for sample pgo profile collection. 427CODEGENOPT(DebugInfoForProfiling, 1, 0) 428 429/// Whether emit pseudo probes for sample pgo profile collection. 430CODEGENOPT(PseudoProbeForProfiling, 1, 0) 431 432/// Whether 3-component vector type is preserved. 433CODEGENOPT(PreserveVec3Type, 1, 0) 434 435/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames. 436CODEGENOPT(DebugNameTable, 2, 0) 437 438/// Whether to use DWARF base address specifiers in .debug_ranges. 439CODEGENOPT(DebugRangesBaseAddress, 1, 0) 440 441CODEGENOPT(NoPLT, 1, 0) 442 443/// Whether to embed source in DWARF debug line section. 444CODEGENOPT(EmbedSource, 1, 0) 445 446/// Whether to emit all vtables 447CODEGENOPT(ForceEmitVTables, 1, 0) 448 449/// Whether to emit an address-significance table into the object file. 450CODEGENOPT(Addrsig, 1, 0) 451 452/// Whether to emit unused static constants. 453CODEGENOPT(KeepStaticConsts, 1, 0) 454 455/// Whether to follow the AAPCS enforcing at least one read before storing to a volatile bitfield 456CODEGENOPT(ForceAAPCSBitfieldLoad, 1, 0) 457 458/// Assume that by-value parameters do not alias any other values. 459CODEGENOPT(PassByValueIsNoAlias, 1, 0) 460 461/// Whether to not follow the AAPCS that enforces volatile bit-field access width to be 462/// according to the field declaring type width. 463CODEGENOPT(AAPCSBitfieldWidth, 1, 1) 464 465/// Sets the IEEE bit in the expected default floating point mode register. 466/// Floating point opcodes that support exception flag gathering quiet and 467/// propagate signaling NaN inputs per IEEE 754-2008 (AMDGPU Only) 468CODEGENOPT(EmitIEEENaNCompliantInsts, 1, 1) 469 470// Whether to emit Swift Async function extended frame information: auto, 471// never, always. 472ENUM_CODEGENOPT(SwiftAsyncFramePointer, SwiftAsyncFramePointerKind, 2, 473 SwiftAsyncFramePointerKind::Always) 474 475/// Whether to skip RAX setup when passing variable arguments (x86 only). 476CODEGENOPT(SkipRaxSetup, 1, 0) 477 478/// Whether to zero out caller-used registers before returning. 479ENUM_CODEGENOPT(ZeroCallUsedRegs, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind, 480 5, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind::Skip) 481 482/// Whether to use opaque pointers. 483CODEGENOPT(OpaquePointers, 1, 0) 484 485#undef CODEGENOPT 486#undef ENUM_CODEGENOPT 487#undef VALUE_CODEGENOPT 488