Warning, /include/clang/Basic/CodeGenOptions.def is written in an unsupported language. File is not indexed.
0001 //===--- CodeGenOptions.def - Code generation option database ----- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines the code generation options. Users of this file
0010 // must define the CODEGENOPT macro to make use of this information.
0011 // Optionally, the user may also define ENUM_CODEGENOPT (for options
0012 // that have enumeration type and VALUE_CODEGENOPT is a code
0013 // generation option that describes a value rather than a flag.
0014 //
0015 // AFFECTING_VALUE_CODEGENOPT is used for code generation options that can
0016 // affect the AST.
0017 //
0018 //===----------------------------------------------------------------------===//
0019 #ifndef CODEGENOPT
0020 # error Define the CODEGENOPT macro to handle language options
0021 #endif
0022
0023 #ifndef VALUE_CODEGENOPT
0024 # define VALUE_CODEGENOPT(Name, Bits, Default) \
0025 CODEGENOPT(Name, Bits, Default)
0026 #endif
0027
0028 #ifndef ENUM_CODEGENOPT
0029 # define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
0030 CODEGENOPT(Name, Bits, Default)
0031 #endif
0032
0033 #ifndef AFFECTING_VALUE_CODEGENOPT
0034 # define AFFECTING_VALUE_CODEGENOPT(Name, Bits, Default) \
0035 VALUE_CODEGENOPT(Name, Bits, Default)
0036 #endif
0037
0038 CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as
0039 CODEGENOPT(Crel, 1, 0) ///< -Wa,--crel
0040 CODEGENOPT(ImplicitMapSyms, 1, 0) ///< -Wa,-mmapsyms=implicit
0041 CODEGENOPT(AsmVerbose , 1, 0) ///< -dA, -fverbose-asm.
0042 CODEGENOPT(PreserveAsmComments, 1, 1) ///< -dA, -fno-preserve-as-comments.
0043 CODEGENOPT(AssumeSaneOperatorNew , 1, 1) ///< implicit __attribute__((malloc)) operator new
0044 CODEGENOPT(AssumeUniqueVTables , 1, 1) ///< Assume a class has only one vtable.
0045 CODEGENOPT(Autolink , 1, 1) ///< -fno-autolink
0046 CODEGENOPT(AutoImport , 1, 1) ///< -fno-auto-import
0047 CODEGENOPT(ObjCAutoRefCountExceptions , 1, 0) ///< Whether ARC should be EH-safe.
0048 CODEGENOPT(Backchain , 1, 0) ///< -mbackchain
0049 CODEGENOPT(ControlFlowGuardNoChecks , 1, 0) ///< -cfguard-no-checks
0050 CODEGENOPT(ControlFlowGuard , 1, 0) ///< -cfguard
0051 CODEGENOPT(EHContGuard , 1, 0) ///< -ehcontguard
0052 CODEGENOPT(CXAAtExit , 1, 1) ///< Use __cxa_atexit for calling destructors.
0053 CODEGENOPT(RegisterGlobalDtorsWithAtExit, 1, 1) ///< Use atexit or __cxa_atexit to register global destructors.
0054 CODEGENOPT(CXXCtorDtorAliases, 1, 0) ///< Emit complete ctors/dtors as linker
0055 ///< aliases to base ctors when possible.
0056 CODEGENOPT(DataSections , 1, 0) ///< Set when -fdata-sections is enabled.
0057 CODEGENOPT(UniqueSectionNames, 1, 1) ///< Set for -funique-section-names.
0058 CODEGENOPT(UniqueBasicBlockSectionNames, 1, 1) ///< Set for -funique-basic-block-section-names,
0059 ///< Produce unique section names with
0060 ///< basic block sections.
0061 CODEGENOPT(SeparateNamedSections, 1, 0) ///< Set for -fseparate-named-sections.
0062 CODEGENOPT(EnableAIXExtendedAltivecABI, 1, 0) ///< Set for -mabi=vec-extabi. Enables the extended Altivec ABI on AIX.
0063 CODEGENOPT(XCOFFReadOnlyPointers, 1, 0) ///< Set for -mxcoff-roptr.
0064 CODEGENOPT(AllTocData, 1, 0) ///< AIX -mtocdata
0065 ENUM_CODEGENOPT(FramePointer, FramePointerKind, 2, FramePointerKind::None) /// frame-pointer: all,non-leaf,reserved,none
0066
0067 CODEGENOPT(ClearASTBeforeBackend , 1, 0) ///< Free the AST before running backend code generation. Only works with -disable-free.
0068 CODEGENOPT(DisableFree , 1, 0) ///< Don't free memory.
0069 CODEGENOPT(DiscardValueNames , 1, 0) ///< Discard Value Names from the IR (LLVMContext flag)
0070 CODEGENOPT(DisableLLVMPasses , 1, 0) ///< Don't run any LLVM IR passes to get
0071 ///< the pristine IR generated by the
0072 ///< frontend.
0073 CODEGENOPT(DisableLifetimeMarkers, 1, 0) ///< Don't emit any lifetime markers
0074 CODEGENOPT(DisableO0ImplyOptNone , 1, 0) ///< Don't annonate function with optnone at O0
0075 CODEGENOPT(ExperimentalStrictFloatingPoint, 1, 0) ///< Enables the new, experimental
0076 ///< strict floating point.
0077 CODEGENOPT(EnableNoundefAttrs, 1, 0) ///< Enable emitting `noundef` attributes on IR call arguments and return values
0078 CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new
0079 ///< pass manager.
0080 CODEGENOPT(DisableRedZone , 1, 0) ///< Set when -mno-red-zone is enabled.
0081 CODEGENOPT(EmitCallSiteInfo, 1, 0) ///< Emit call site info only in the case of
0082 ///< '-g' + 'O>0' level.
0083 CODEGENOPT(IndirectTlsSegRefs, 1, 0) ///< Set when -mno-tls-direct-seg-refs
0084 ///< is specified.
0085 CODEGENOPT(DisableTailCalls , 1, 0) ///< Do not emit tail calls.
0086 CODEGENOPT(NoEscapingBlockTailCalls, 1, 0) ///< Do not emit tail calls from
0087 ///< escaping blocks.
0088 CODEGENOPT(EmitDeclMetadata , 1, 0) ///< Emit special metadata indicating what
0089 ///< Decl* various IR entities came from.
0090 ///< Only useful when running CodeGen as a
0091 ///< subroutine.
0092 CODEGENOPT(EmitVersionIdentMetadata , 1, 1) ///< Emit compiler version metadata.
0093 CODEGENOPT(EmitOpenCLArgMetadata , 1, 0) ///< Emit OpenCL kernel arg metadata.
0094 CODEGENOPT(EmulatedTLS , 1, 0) ///< Set by default or -f[no-]emulated-tls.
0095 /// Embed Bitcode mode (off/all/bitcode/marker).
0096 ENUM_CODEGENOPT(EmbedBitcode, EmbedBitcodeKind, 2, Embed_Off)
0097 /// Inline asm dialect, -masm=(att|intel)
0098 ENUM_CODEGENOPT(InlineAsmDialect, InlineAsmDialectKind, 1, IAD_ATT)
0099 CODEGENOPT(OutputAsmVariant, 2, 3) ///< Set the asm variant for output (3: unspecified).
0100 CODEGENOPT(ForbidGuardVariables , 1, 0) ///< Issue errors if C++ guard variables
0101 ///< are required.
0102 CODEGENOPT(FunctionSections , 1, 0) ///< Set when -ffunction-sections is enabled.
0103 CODEGENOPT(BBAddrMap , 1, 0) ///< Set when -fbasic-block-address-map is enabled.
0104 CODEGENOPT(InstrumentFunctions , 1, 0) ///< Set when -finstrument-functions is
0105 ///< enabled.
0106 CODEGENOPT(InstrumentFunctionsAfterInlining , 1, 0) ///< Set when
0107 ///< -finstrument-functions-after-inlining is enabled.
0108 CODEGENOPT(InstrumentFunctionEntryBare , 1, 0) ///< Set when
0109 ///< -finstrument-function-entry-bare is enabled.
0110 CODEGENOPT(CFProtectionReturn , 1, 0) ///< if -fcf-protection is
0111 ///< set to full or return.
0112 CODEGENOPT(CFProtectionBranch , 1, 0) ///< if -fcf-protection is
0113 ///< set to full or branch.
0114 ENUM_CODEGENOPT(CFBranchLabelScheme, CFBranchLabelSchemeKind, 2,
0115 CFBranchLabelSchemeKind::Default) ///< if -mcf-branch-label-scheme is set.
0116 CODEGENOPT(FunctionReturnThunks, 1, 0) ///< -mfunction-return={keep|thunk-extern}
0117 CODEGENOPT(IndirectBranchCSPrefix, 1, 0) ///< if -mindirect-branch-cs-prefix
0118 ///< is set.
0119
0120 CODEGENOPT(XRayInstrumentFunctions , 1, 0) ///< Set when -fxray-instrument is
0121 ///< enabled.
0122 CODEGENOPT(StackSizeSection , 1, 0) ///< Set when -fstack-size-section is enabled.
0123
0124 ///< Set when -femit-compact-unwind-non-canonical is enabled.
0125 CODEGENOPT(EmitCompactUnwindNonCanonical, 1, 0)
0126
0127 ///< Set when -fxray-always-emit-customevents is enabled.
0128 CODEGENOPT(XRayAlwaysEmitCustomEvents , 1, 0)
0129
0130 ///< Set when -fxray-always-emit-typedevents is enabled.
0131 CODEGENOPT(XRayAlwaysEmitTypedEvents , 1, 0)
0132
0133 ///< Set when -fxray-ignore-loops is enabled.
0134 CODEGENOPT(XRayIgnoreLoops , 1, 0)
0135
0136 ///< Emit the XRay function index section.
0137 CODEGENOPT(XRayFunctionIndex , 1, 1)
0138
0139 ///< Set when -fxray-shared is enabled
0140 CODEGENOPT(XRayShared , 1, 0)
0141
0142 ///< Set the minimum number of instructions in a function to determine selective
0143 ///< XRay instrumentation.
0144 VALUE_CODEGENOPT(XRayInstructionThreshold , 32, 200)
0145
0146 ///< Only instrument 1 in N functions, by dividing functions into N total groups and
0147 ///< instrumenting only the specified group at a time. Group numbers start at 0
0148 ///< and end at N-1.
0149 VALUE_CODEGENOPT(XRayTotalFunctionGroups, 32, 1)
0150 VALUE_CODEGENOPT(XRaySelectedFunctionGroup, 32, 0)
0151
0152 VALUE_CODEGENOPT(PatchableFunctionEntryCount , 32, 0) ///< Number of NOPs at function entry
0153 VALUE_CODEGENOPT(PatchableFunctionEntryOffset , 32, 0)
0154
0155 CODEGENOPT(HotPatch, 1, 0) ///< Supports the Microsoft /HOTPATCH flag and
0156 ///< generates a 'patchable-function' attribute.
0157
0158 CODEGENOPT(TlsGuards , 1, 1) ///< Controls emission of tls guards via -fms-tls-guards
0159 CODEGENOPT(JMCInstrument, 1, 0) ///< Set when -fjmc is enabled.
0160 CODEGENOPT(InstrumentForProfiling , 1, 0) ///< Set when -pg is enabled.
0161 CODEGENOPT(CallFEntry , 1, 0) ///< Set when -mfentry is enabled.
0162 CODEGENOPT(MNopMCount , 1, 0) ///< Set when -mnop-mcount is enabled.
0163 CODEGENOPT(RecordMCount , 1, 0) ///< Set when -mrecord-mcount is enabled.
0164 CODEGENOPT(PackedStack , 1, 0) ///< Set when -mpacked-stack is enabled.
0165 CODEGENOPT(LessPreciseFPMAD , 1, 0) ///< Enable less precise MAD instructions to
0166 ///< be generated.
0167 CODEGENOPT(PrepareForLTO , 1, 0) ///< Set when -flto is enabled on the
0168 ///< compile step.
0169 CODEGENOPT(PrepareForThinLTO , 1, 0) ///< Set when -flto=thin is enabled on the
0170 ///< compile step.
0171 CODEGENOPT(LTOUnit, 1, 0) ///< Emit IR to support LTO unit features (CFI, whole
0172 ///< program vtable opt).
0173 CODEGENOPT(FatLTO, 1, 0) ///< Set when -ffat-lto-objects is enabled.
0174 CODEGENOPT(EnableSplitLTOUnit, 1, 0) ///< Enable LTO unit splitting to support
0175 /// CFI and traditional whole program
0176 /// devirtualization that require whole
0177 /// program IR support.
0178 CODEGENOPT(UnifiedLTO, 1, 0) ///< Use the unified LTO pipeline.
0179 CODEGENOPT(IncrementalLinkerCompatible, 1, 0) ///< Emit an object file which can
0180 ///< be used with an incremental
0181 ///< linker.
0182 CODEGENOPT(MergeAllConstants , 1, 1) ///< Merge identical constants.
0183 CODEGENOPT(MergeFunctions , 1, 0) ///< Set when -fmerge-functions is enabled.
0184 CODEGENOPT(NoCommon , 1, 0) ///< Set when -fno-common or C++ is enabled.
0185 CODEGENOPT(NoExecStack , 1, 0) ///< Set when -Wa,--noexecstack is enabled.
0186 CODEGENOPT(MipsMsa , 1, 0) ///< Set when -Wa,-mmsa is enabled.
0187 CODEGENOPT(FatalWarnings , 1, 0) ///< Set when -Wa,--fatal-warnings is
0188 ///< enabled.
0189 CODEGENOPT(NoWarn , 1, 0) ///< Set when -Wa,--no-warn is enabled.
0190 CODEGENOPT(NoTypeCheck , 1, 0) ///< Set when -Wa,--no-type-check is enabled.
0191 CODEGENOPT(MisExpect , 1, 0) ///< Set when -Wmisexpect is enabled
0192 CODEGENOPT(EnableSegmentedStacks , 1, 0) ///< Set when -fsplit-stack is enabled.
0193 CODEGENOPT(StackClashProtector, 1, 0) ///< Set when -fstack-clash-protection is enabled.
0194 CODEGENOPT(NoImplicitFloat , 1, 0) ///< Set when -mno-implicit-float is enabled.
0195 CODEGENOPT(NullPointerIsValid , 1, 0) ///< Assume Null pointer deference is defined.
0196 CODEGENOPT(OpenCLCorrectlyRoundedDivSqrt, 1, 0) ///< -cl-fp32-correctly-rounded-divide-sqrt
0197 CODEGENOPT(HIPCorrectlyRoundedDivSqrt, 1, 1) ///< -fno-hip-fp32-correctly-rounded-divide-sqrt
0198 CODEGENOPT(DisableBlockSignatureString, 1, 0) ///< Set when -fdisable-block-signature-string is enabled.
0199 CODEGENOPT(HIPSaveKernelArgName, 1, 0) ///< Set when -fhip-kernel-arg-name is enabled.
0200 CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get unique names.
0201 CODEGENOPT(SplitMachineFunctions, 1, 0) ///< Split machine functions using profile information.
0202 CODEGENOPT(PPCUseFullRegisterNames, 1, 0) ///< Print full register names in assembly
0203 CODEGENOPT(X86RelaxRelocations, 1, 1) ///< -Wa,-mrelax-relocations={yes,no}
0204 CODEGENOPT(X86Sse2Avx , 1, 0) ///< -Wa,-msse2avx
0205
0206 /// When false, this attempts to generate code as if the result of an
0207 /// overflowing conversion matches the overflowing behavior of a target's native
0208 /// float-to-int conversion instructions.
0209 CODEGENOPT(StrictFloatCastOverflow, 1, 1)
0210
0211 CODEGENOPT(NoZeroInitializedInBSS , 1, 0) ///< -fno-zero-initialized-in-bss.
0212 /// Method of Objective-C dispatch to use.
0213 ENUM_CODEGENOPT(ObjCDispatchMethod, ObjCDispatchMethodKind, 2, Legacy)
0214 /// Replace certain message sends with calls to ObjC runtime entrypoints
0215 CODEGENOPT(ObjCConvertMessagesToRuntimeCalls , 1, 1)
0216 CODEGENOPT(ObjCAvoidHeapifyLocalBlocks, 1, 0)
0217
0218
0219 // The optimization options affect frontend options, whicn in turn do affect the AST.
0220 AFFECTING_VALUE_CODEGENOPT(OptimizationLevel, 2, 0) ///< The -O[0-3] option specified.
0221 AFFECTING_VALUE_CODEGENOPT(OptimizeSize, 2, 0) ///< If -Os (==1) or -Oz (==2) is specified.
0222
0223 CODEGENOPT(AtomicProfileUpdate , 1, 0) ///< Set -fprofile-update=atomic
0224 /// Choose profile instrumenation kind or no instrumentation.
0225 ENUM_CODEGENOPT(ProfileInstr, ProfileInstrKind, 2, ProfileNone)
0226 /// Choose profile kind for PGO use compilation.
0227 ENUM_CODEGENOPT(ProfileUse, ProfileInstrKind, 2, ProfileNone)
0228 /// Partition functions into N groups and select only functions in group i to be
0229 /// instrumented. Selected group numbers can be 0 to N-1 inclusive.
0230 VALUE_CODEGENOPT(ProfileTotalFunctionGroups, 32, 1)
0231 VALUE_CODEGENOPT(ProfileSelectedFunctionGroup, 32, 0)
0232 CODEGENOPT(CoverageMapping , 1, 0) ///< Generate coverage mapping regions to
0233 ///< enable code coverage analysis.
0234 CODEGENOPT(DumpCoverageMapping , 1, 0) ///< Dump the generated coverage mapping
0235 ///< regions.
0236 CODEGENOPT(MCDCCoverage , 1, 0) ///< Enable MC/DC code coverage criteria.
0237 VALUE_CODEGENOPT(MCDCMaxConds, 16, 32767) ///< MC/DC Maximum conditions.
0238 VALUE_CODEGENOPT(MCDCMaxTVs, 32, 0x7FFFFFFE) ///< MC/DC Maximum test vectors.
0239
0240 /// If -fpcc-struct-return or -freg-struct-return is specified.
0241 ENUM_CODEGENOPT(StructReturnConvention, StructReturnConventionKind, 2, SRCK_Default)
0242
0243 CODEGENOPT(RelaxAll , 1, 0) ///< Relax all machine code instructions.
0244 CODEGENOPT(RelaxedAliasing , 1, 0) ///< Set when -fno-strict-aliasing is enabled.
0245 CODEGENOPT(PointerTBAA , 1, 1) ///< Whether or not to use distinct TBAA tags for pointers.
0246 CODEGENOPT(StructPathTBAA , 1, 0) ///< Whether or not to use struct-path TBAA.
0247 CODEGENOPT(NewStructPathTBAA , 1, 0) ///< Whether or not to use enhanced struct-path TBAA.
0248 CODEGENOPT(SaveTempLabels , 1, 0) ///< Save temporary labels.
0249 CODEGENOPT(SanitizeAddressUseAfterScope , 1, 0) ///< Enable use-after-scope detection
0250 ///< in AddressSanitizer
0251 ENUM_CODEGENOPT(SanitizeAddressUseAfterReturn,
0252 llvm::AsanDetectStackUseAfterReturnMode, 2,
0253 llvm::AsanDetectStackUseAfterReturnMode::Runtime
0254 ) ///< Set detection mode for stack-use-after-return.
0255 CODEGENOPT(SanitizeAddressPoisonCustomArrayCookie, 1,
0256 0) ///< Enable poisoning operator new[] which is not a replaceable
0257 ///< global allocation function in AddressSanitizer
0258 CODEGENOPT(SanitizeAddressGlobalsDeadStripping, 1, 0) ///< Enable linker dead stripping
0259 ///< of globals in AddressSanitizer
0260 CODEGENOPT(SanitizeAddressUseOdrIndicator, 1, 0) ///< Enable ODR indicator globals
0261 CODEGENOPT(SanitizeMemoryTrackOrigins, 2, 0) ///< Enable tracking origins in
0262 ///< MemorySanitizer
0263 ENUM_CODEGENOPT(SanitizeAddressDtor, llvm::AsanDtorKind, 2,
0264 llvm::AsanDtorKind::Global) ///< Set how ASan global
0265 ///< destructors are emitted.
0266 CODEGENOPT(SanitizeMemoryParamRetval, 1, 0) ///< Enable detection of uninitialized
0267 ///< parameters and return values
0268 ///< in MemorySanitizer
0269 CODEGENOPT(SanitizeMemoryUseAfterDtor, 1, 0) ///< Enable use-after-delete detection
0270 ///< in MemorySanitizer
0271 CODEGENOPT(SanitizeCfiCrossDso, 1, 0) ///< Enable cross-dso support in CFI.
0272 CODEGENOPT(SanitizeMinimalRuntime, 1, 0) ///< Use "_minimal" sanitizer runtime for
0273 ///< diagnostics.
0274 CODEGENOPT(SanitizeCfiICallGeneralizePointers, 1, 0) ///< Generalize pointer types in
0275 ///< CFI icall function signatures
0276 CODEGENOPT(SanitizeCfiICallNormalizeIntegers, 1, 0) ///< Normalize integer types in
0277 ///< CFI icall function signatures
0278 CODEGENOPT(SanitizeCfiCanonicalJumpTables, 1, 0) ///< Make jump table symbols canonical
0279 ///< instead of creating a local jump table.
0280 CODEGENOPT(SanitizeCoverageType, 2, 0) ///< Type of sanitizer coverage
0281 ///< instrumentation.
0282 CODEGENOPT(SanitizeCoverageIndirectCalls, 1, 0) ///< Enable sanitizer coverage
0283 ///< for indirect calls.
0284 CODEGENOPT(SanitizeCoverageTraceBB, 1, 0) ///< Enable basic block tracing in
0285 ///< in sanitizer coverage.
0286 CODEGENOPT(SanitizeCoverageTraceCmp, 1, 0) ///< Enable cmp instruction tracing
0287 ///< in sanitizer coverage.
0288 CODEGENOPT(SanitizeCoverageTraceDiv, 1, 0) ///< Enable div instruction tracing
0289 ///< in sanitizer coverage.
0290 CODEGENOPT(SanitizeCoverageTraceGep, 1, 0) ///< Enable GEP instruction tracing
0291 ///< in sanitizer coverage.
0292 CODEGENOPT(SanitizeCoverage8bitCounters, 1, 0) ///< Use 8-bit frequency counters
0293 ///< in sanitizer coverage.
0294 CODEGENOPT(SanitizeCoverageTracePC, 1, 0) ///< Enable PC tracing
0295 ///< in sanitizer coverage.
0296 CODEGENOPT(SanitizeCoverageTracePCGuard, 1, 0) ///< Enable PC tracing with guard
0297 ///< in sanitizer coverage.
0298 CODEGENOPT(SanitizeCoverageInline8bitCounters, 1, 0) ///< Use inline 8bit counters.
0299 CODEGENOPT(SanitizeCoverageInlineBoolFlag, 1, 0) ///< Use inline bool flag.
0300 CODEGENOPT(SanitizeCoveragePCTable, 1, 0) ///< Create a PC Table.
0301 CODEGENOPT(SanitizeCoverageControlFlow, 1, 0) ///< Collect control flow
0302 CODEGENOPT(SanitizeCoverageNoPrune, 1, 0) ///< Disable coverage pruning.
0303 CODEGENOPT(SanitizeCoverageStackDepth, 1, 0) ///< Enable max stack depth tracing
0304 CODEGENOPT(SanitizeCoverageTraceLoads, 1, 0) ///< Enable tracing of loads.
0305 CODEGENOPT(SanitizeCoverageTraceStores, 1, 0) ///< Enable tracing of stores.
0306 CODEGENOPT(SanitizeBinaryMetadataCovered, 1, 0) ///< Emit PCs for covered functions.
0307 CODEGENOPT(SanitizeBinaryMetadataAtomics, 1, 0) ///< Emit PCs for atomic operations.
0308 CODEGENOPT(SanitizeBinaryMetadataUAR, 1, 0) ///< Emit PCs for start of functions
0309 ///< that are subject for use-after-return checking.
0310 CODEGENOPT(SanitizeStats , 1, 0) ///< Collect statistics for sanitizers.
0311 CODEGENOPT(SimplifyLibCalls , 1, 1) ///< Set when -fbuiltin is enabled.
0312 CODEGENOPT(SoftFloat , 1, 0) ///< -soft-float.
0313 CODEGENOPT(SpeculativeLoadHardening, 1, 0) ///< Enable speculative load hardening.
0314 CODEGENOPT(FineGrainedBitfieldAccesses, 1, 0) ///< Enable fine-grained bitfield accesses.
0315 CODEGENOPT(StrictEnums , 1, 0) ///< Optimize based on strict enum definition.
0316 CODEGENOPT(StrictVTablePointers, 1, 0) ///< Optimize based on the strict vtable pointers
0317 CODEGENOPT(TimePasses , 1, 0) ///< Set when -ftime-report or -ftime-report= is enabled.
0318 CODEGENOPT(TimePassesPerRun , 1, 0) ///< Set when -ftime-report=per-pass-run is enabled.
0319 CODEGENOPT(TimeTrace , 1, 0) ///< Set when -ftime-trace is enabled.
0320 VALUE_CODEGENOPT(TimeTraceGranularity, 32, 500) ///< Minimum time granularity (in microseconds),
0321 ///< traced by time profiler
0322 CODEGENOPT(UnrollLoops , 1, 0) ///< Control whether loops are unrolled.
0323 CODEGENOPT(RerollLoops , 1, 0) ///< Control whether loops are rerolled.
0324 CODEGENOPT(NoUseJumpTables , 1, 0) ///< Set when -fno-jump-tables is enabled.
0325 VALUE_CODEGENOPT(UnwindTables, 2, 0) ///< Unwind tables (1) or asynchronous unwind tables (2)
0326 CODEGENOPT(LinkBitcodePostopt, 1, 0) ///< Link builtin bitcodes after optimization pipeline.
0327 CODEGENOPT(VectorizeLoop , 1, 0) ///< Run loop vectorizer.
0328 CODEGENOPT(VectorizeSLP , 1, 0) ///< Run SLP vectorizer.
0329 CODEGENOPT(ProfileSampleAccurate, 1, 0) ///< Sample profile is accurate.
0330
0331 /// Treat loops as finite: language, always, never.
0332 ENUM_CODEGENOPT(FiniteLoops, FiniteLoopsKind, 2, FiniteLoopsKind::Language)
0333
0334 /// Attempt to use register sized accesses to bit-fields in structures, when
0335 /// possible.
0336 CODEGENOPT(UseRegisterSizedBitfieldAccess , 1, 0)
0337
0338 CODEGENOPT(VerifyModule , 1, 1) ///< Control whether the module should be run
0339 ///< through the LLVM Verifier.
0340 CODEGENOPT(VerifyEach , 1, 1) ///< Control whether the LLVM verifier
0341 ///< should run after every pass.
0342
0343 CODEGENOPT(StackRealignment , 1, 0) ///< Control whether to force stack
0344 ///< realignment.
0345 CODEGENOPT(UseInitArray , 1, 0) ///< Control whether to use .init_array or
0346 ///< .ctors.
0347 VALUE_CODEGENOPT(LoopAlignment , 32, 0) ///< Overrides default loop
0348 ///< alignment, if not 0.
0349 VALUE_CODEGENOPT(StackAlignment , 32, 0) ///< Overrides default stack
0350 ///< alignment, if not 0.
0351 VALUE_CODEGENOPT(StackProbeSize , 32, 4096) ///< Overrides default stack
0352 ///< probe size, even if 0.
0353 VALUE_CODEGENOPT(WarnStackSize , 32, UINT_MAX) ///< Set via -fwarn-stack-size.
0354 CODEGENOPT(NoStackArgProbe, 1, 0) ///< Set when -mno-stack-arg-probe is used
0355 CODEGENOPT(EmitLLVMUseLists, 1, 0) ///< Control whether to serialize use-lists.
0356
0357 CODEGENOPT(WholeProgramVTables, 1, 0) ///< Whether to apply whole-program
0358 /// vtable optimization.
0359
0360 CODEGENOPT(VirtualFunctionElimination, 1, 0) ///< Whether to apply the dead
0361 /// virtual function elimination
0362 /// optimization.
0363
0364 /// Whether to use public LTO visibility for entities in std and stdext
0365 /// namespaces. This is enabled by clang-cl's /MT and /MTd flags.
0366 CODEGENOPT(LTOVisibilityPublicStd, 1, 0)
0367
0368 /// The user specified number of registers to be used for integral arguments,
0369 /// or 0 if unspecified.
0370 VALUE_CODEGENOPT(NumRegisterParameters, 32, 0)
0371
0372 /// The threshold to put data into small data section.
0373 VALUE_CODEGENOPT(SmallDataLimit, 32, 0)
0374
0375 /// The lower bound for a buffer to be considered for stack protection.
0376 VALUE_CODEGENOPT(SSPBufferSize, 32, 0)
0377
0378 /// The kind of inlining to perform.
0379 ENUM_CODEGENOPT(Inlining, InliningMethod, 2, NormalInlining)
0380
0381 /// The maximum stack size a function can have to be considered for inlining.
0382 VALUE_CODEGENOPT(InlineMaxStackSize, 32, UINT_MAX)
0383
0384 // Vector functions library to use.
0385 ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary, 3, llvm::driver::VectorLibrary::NoLibrary)
0386
0387 /// The default TLS model to use.
0388 ENUM_CODEGENOPT(DefaultTLSModel, TLSModel, 2, GeneralDynamicTLSModel)
0389
0390 /// Whether to enable TLSDESC. AArch64 enables TLSDESC regardless of this value.
0391 CODEGENOPT(EnableTLSDESC, 1, 0)
0392
0393 /// Bit size of immediate TLS offsets (0 == use the default).
0394 VALUE_CODEGENOPT(TLSSize, 8, 0)
0395
0396 /// The types of variables that we will extend the live ranges of.
0397 ENUM_CODEGENOPT(ExtendVariableLiveness, ExtendVariableLivenessKind, 2, ExtendVariableLivenessKind::None)
0398
0399 /// The default stack protector guard offset to use.
0400 VALUE_CODEGENOPT(StackProtectorGuardOffset, 32, INT_MAX)
0401
0402 /// Number of path components to strip when emitting checks. (0 == full
0403 /// filename)
0404 VALUE_CODEGENOPT(EmitCheckPathComponentsToStrip, 32, 0)
0405
0406 /// Whether to report the hotness of the code region for optimization remarks.
0407 CODEGENOPT(DiagnosticsWithHotness, 1, 0)
0408
0409 /// Whether to use direct access relocations (instead of GOT) to reference external data symbols.
0410 CODEGENOPT(DirectAccessExternalData, 1, 0)
0411
0412 /// Whether we should use the undefined behaviour optimization for control flow
0413 /// paths that reach the end of a function without executing a required return.
0414 CODEGENOPT(StrictReturn, 1, 1)
0415
0416 /// Whether emit pseudo probes for sample pgo profile collection.
0417 CODEGENOPT(PseudoProbeForProfiling, 1, 0)
0418
0419 CODEGENOPT(NoPLT, 1, 0)
0420
0421 /// Whether to emit all vtables
0422 CODEGENOPT(ForceEmitVTables, 1, 0)
0423
0424 /// Whether to emit an address-significance table into the object file.
0425 CODEGENOPT(Addrsig, 1, 0)
0426
0427 /// Whether to emit unused static constants.
0428 CODEGENOPT(KeepStaticConsts, 1, 0)
0429
0430 /// Whether to emit all variables that have a persistent storage duration,
0431 /// including global, static and thread local variables.
0432 CODEGENOPT(KeepPersistentStorageVariables, 1, 0)
0433
0434 /// Whether to follow the AAPCS enforcing at least one read before storing to a volatile bitfield
0435 CODEGENOPT(ForceAAPCSBitfieldLoad, 1, 0)
0436
0437 /// Assume that by-value parameters do not alias any other values.
0438 CODEGENOPT(PassByValueIsNoAlias, 1, 0)
0439
0440 /// Whether to store register parameters to stack.
0441 CODEGENOPT(SaveRegParams, 1, 0)
0442
0443 /// Whether to not follow the AAPCS that enforces volatile bit-field access width to be
0444 /// according to the field declaring type width.
0445 CODEGENOPT(AAPCSBitfieldWidth, 1, 1)
0446
0447 /// Sets the IEEE bit in the expected default floating point mode register.
0448 /// Floating point opcodes that support exception flag gathering quiet and
0449 /// propagate signaling NaN inputs per IEEE 754-2008 (AMDGPU Only)
0450 CODEGENOPT(EmitIEEENaNCompliantInsts, 1, 1)
0451
0452 // Whether to emit Swift Async function extended frame information: auto,
0453 // never, always.
0454 ENUM_CODEGENOPT(SwiftAsyncFramePointer, SwiftAsyncFramePointerKind, 2,
0455 SwiftAsyncFramePointerKind::Always)
0456
0457 /// Whether to skip RAX setup when passing variable arguments (x86 only).
0458 CODEGENOPT(SkipRaxSetup, 1, 0)
0459
0460 /// Whether to zero out caller-used registers before returning.
0461 ENUM_CODEGENOPT(ZeroCallUsedRegs, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind,
0462 5, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind::Skip)
0463
0464 /// Modify C++ ABI to returning `this` pointer from constructors and
0465 /// non-deleting destructors. (No effect on Microsoft ABI.)
0466 CODEGENOPT(CtorDtorReturnThis, 1, 0)
0467
0468 /// FIXME: Make DebugOptions its own top-level .def file.
0469 #include "DebugOptions.def"
0470
0471 #undef CODEGENOPT
0472 #undef ENUM_CODEGENOPT
0473 #undef VALUE_CODEGENOPT
0474 #undef AFFECTING_VALUE_CODEGENOPT