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