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