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