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