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