/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/Basic/CodeGenOptions.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===--- CodeGenOptions.h ---------------------------------------*- 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 CodeGenOptions interface. |
10 | | // |
11 | | //===----------------------------------------------------------------------===// |
12 | | |
13 | | #ifndef LLVM_CLANG_BASIC_CODEGENOPTIONS_H |
14 | | #define LLVM_CLANG_BASIC_CODEGENOPTIONS_H |
15 | | |
16 | | #include "clang/Basic/Sanitizers.h" |
17 | | #include "clang/Basic/XRayInstr.h" |
18 | | #include "llvm/ADT/FloatingPointMode.h" |
19 | | #include "llvm/Frontend/Debug/Options.h" |
20 | | #include "llvm/Support/CodeGen.h" |
21 | | #include "llvm/Support/Regex.h" |
22 | | #include "llvm/Target/TargetOptions.h" |
23 | | #include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h" |
24 | | #include <map> |
25 | | #include <memory> |
26 | | #include <string> |
27 | | #include <vector> |
28 | | |
29 | | namespace llvm { |
30 | | class PassBuilder; |
31 | | } |
32 | | namespace clang { |
33 | | |
34 | | /// Bitfields of CodeGenOptions, split out from CodeGenOptions to ensure |
35 | | /// that this large collection of bitfields is a trivial class type. |
36 | | class CodeGenOptionsBase { |
37 | | friend class CompilerInvocation; |
38 | | friend class CompilerInvocationBase; |
39 | | |
40 | | public: |
41 | | #define CODEGENOPT(Name, Bits, Default) unsigned Name : Bits; |
42 | | #define ENUM_CODEGENOPT(Name, Type, Bits, Default) |
43 | | #include "clang/Basic/CodeGenOptions.def" |
44 | | |
45 | | protected: |
46 | | #define CODEGENOPT(Name, Bits, Default) |
47 | | #define ENUM_CODEGENOPT(Name, Type, Bits, Default) unsigned Name : Bits; |
48 | | #include "clang/Basic/CodeGenOptions.def" |
49 | | }; |
50 | | |
51 | | /// CodeGenOptions - Track various options which control how the code |
52 | | /// is optimized and passed to the backend. |
53 | | class CodeGenOptions : public CodeGenOptionsBase { |
54 | | public: |
55 | | enum InliningMethod { |
56 | | NormalInlining, // Use the standard function inlining pass. |
57 | | OnlyHintInlining, // Inline only (implicitly) hinted functions. |
58 | | OnlyAlwaysInlining // Only run the always inlining pass. |
59 | | }; |
60 | | |
61 | | enum VectorLibrary { |
62 | | NoLibrary, // Don't use any vector library. |
63 | | Accelerate, // Use the Accelerate framework. |
64 | | LIBMVEC, // GLIBC vector math library. |
65 | | MASSV, // IBM MASS vector library. |
66 | | SVML, // Intel short vector math library. |
67 | | SLEEF, // SLEEF SIMD Library for Evaluating Elementary Functions. |
68 | | Darwin_libsystem_m, // Use Darwin's libsytem_m vector functions. |
69 | | ArmPL // Arm Performance Libraries. |
70 | | }; |
71 | | |
72 | | enum ObjCDispatchMethodKind { |
73 | | Legacy = 0, |
74 | | NonLegacy = 1, |
75 | | Mixed = 2 |
76 | | }; |
77 | | |
78 | | enum TLSModel { |
79 | | GeneralDynamicTLSModel, |
80 | | LocalDynamicTLSModel, |
81 | | InitialExecTLSModel, |
82 | | LocalExecTLSModel |
83 | | }; |
84 | | |
85 | | enum StructReturnConventionKind { |
86 | | SRCK_Default, // No special option was passed. |
87 | | SRCK_OnStack, // Small structs on the stack (-fpcc-struct-return). |
88 | | SRCK_InRegs // Small structs in registers (-freg-struct-return). |
89 | | }; |
90 | | |
91 | | enum ProfileInstrKind { |
92 | | ProfileNone, // Profile instrumentation is turned off. |
93 | | ProfileClangInstr, // Clang instrumentation to generate execution counts |
94 | | // to use with PGO. |
95 | | ProfileIRInstr, // IR level PGO instrumentation in LLVM. |
96 | | ProfileCSIRInstr, // IR level PGO context sensitive instrumentation in LLVM. |
97 | | }; |
98 | | |
99 | | enum EmbedBitcodeKind { |
100 | | Embed_Off, // No embedded bitcode. |
101 | | Embed_All, // Embed both bitcode and commandline in the output. |
102 | | Embed_Bitcode, // Embed just the bitcode in the output. |
103 | | Embed_Marker // Embed a marker as a placeholder for bitcode. |
104 | | }; |
105 | | |
106 | | enum InlineAsmDialectKind { |
107 | | IAD_ATT, |
108 | | IAD_Intel, |
109 | | }; |
110 | | |
111 | | enum DebugSrcHashKind { |
112 | | DSH_MD5, |
113 | | DSH_SHA1, |
114 | | DSH_SHA256, |
115 | | }; |
116 | | |
117 | | // This field stores one of the allowed values for the option |
118 | | // -fbasic-block-sections=. The allowed values with this option are: |
119 | | // {"labels", "all", "list=<file>", "none"}. |
120 | | // |
121 | | // "labels": Only generate basic block symbols (labels) for all basic |
122 | | // blocks, do not generate unique sections for basic blocks. |
123 | | // Use the machine basic block id in the symbol name to |
124 | | // associate profile info from virtual address to machine |
125 | | // basic block. |
126 | | // "all" : Generate basic block sections for all basic blocks. |
127 | | // "list=<file>": Generate basic block sections for a subset of basic blocks. |
128 | | // The functions and the machine basic block ids are specified |
129 | | // in the file. |
130 | | // "none": Disable sections/labels for basic blocks. |
131 | | std::string BBSections; |
132 | | |
133 | | // If set, override the default value of MCAsmInfo::BinutilsVersion. If |
134 | | // DisableIntegratedAS is specified, the assembly output will consider GNU as |
135 | | // support. "none" means that all ELF features can be used, regardless of |
136 | | // binutils support. |
137 | | std::string BinutilsVersion; |
138 | | |
139 | | enum class FramePointerKind { |
140 | | None, // Omit all frame pointers. |
141 | | NonLeaf, // Keep non-leaf frame pointers. |
142 | | All, // Keep all frame pointers. |
143 | | }; |
144 | | |
145 | 113k | static StringRef getFramePointerKindName(FramePointerKind Kind) { |
146 | 113k | switch (Kind) { |
147 | 0 | case FramePointerKind::None: |
148 | 0 | return "none"; |
149 | 212 | case FramePointerKind::NonLeaf: |
150 | 212 | return "non-leaf"; |
151 | 113k | case FramePointerKind::All: |
152 | 113k | return "all"; |
153 | 113k | } |
154 | | |
155 | 0 | llvm_unreachable("invalid FramePointerKind"); |
156 | 0 | } |
157 | | |
158 | | enum class SwiftAsyncFramePointerKind { |
159 | | Auto, // Choose Swift async extended frame info based on deployment target. |
160 | | Always, // Unconditionally emit Swift async extended frame info. |
161 | | Never, // Don't emit Swift async extended frame info. |
162 | | Default = Always, |
163 | | }; |
164 | | |
165 | | enum FiniteLoopsKind { |
166 | | Language, // Not specified, use language standard. |
167 | | Always, // All loops are assumed to be finite. |
168 | | Never, // No loop is assumed to be finite. |
169 | | }; |
170 | | |
171 | | enum AssignmentTrackingOpts { |
172 | | Disabled, |
173 | | Enabled, |
174 | | Forced, |
175 | | }; |
176 | | |
177 | | /// The code model to use (-mcmodel). |
178 | | std::string CodeModel; |
179 | | |
180 | | /// The code model-specific large data threshold to use |
181 | | /// (-mlarge-data-threshold). |
182 | | uint64_t LargeDataThreshold; |
183 | | |
184 | | /// The filename with path we use for coverage data files. The runtime |
185 | | /// allows further manipulation with the GCOV_PREFIX and GCOV_PREFIX_STRIP |
186 | | /// environment variables. |
187 | | std::string CoverageDataFile; |
188 | | |
189 | | /// The filename with path we use for coverage notes files. |
190 | | std::string CoverageNotesFile; |
191 | | |
192 | | /// Regexes separated by a semi-colon to filter the files to instrument. |
193 | | std::string ProfileFilterFiles; |
194 | | |
195 | | /// Regexes separated by a semi-colon to filter the files to not instrument. |
196 | | std::string ProfileExcludeFiles; |
197 | | |
198 | | /// The version string to put into coverage files. |
199 | | char CoverageVersion[4]; |
200 | | |
201 | | /// Enable additional debugging information. |
202 | | std::string DebugPass; |
203 | | |
204 | | /// The string to embed in debug information as the current working directory. |
205 | | std::string DebugCompilationDir; |
206 | | |
207 | | /// The string to embed in coverage mapping as the current working directory. |
208 | | std::string CoverageCompilationDir; |
209 | | |
210 | | /// The string to embed in the debug information for the compile unit, if |
211 | | /// non-empty. |
212 | | std::string DwarfDebugFlags; |
213 | | |
214 | | /// The string containing the commandline for the llvm.commandline metadata, |
215 | | /// if non-empty. |
216 | | std::string RecordCommandLine; |
217 | | |
218 | | llvm::SmallVector<std::pair<std::string, std::string>, 0> DebugPrefixMap; |
219 | | |
220 | | /// Prefix replacement map for source-based code coverage to remap source |
221 | | /// file paths in coverage mapping. |
222 | | llvm::SmallVector<std::pair<std::string, std::string>, 0> CoveragePrefixMap; |
223 | | |
224 | | /// The ABI to use for passing floating point arguments. |
225 | | std::string FloatABI; |
226 | | |
227 | | /// The file to use for dumping bug report by `Debugify` for original |
228 | | /// debug info. |
229 | | std::string DIBugsReportFilePath; |
230 | | |
231 | | /// The floating-point denormal mode to use. |
232 | | llvm::DenormalMode FPDenormalMode = llvm::DenormalMode::getIEEE(); |
233 | | |
234 | | /// The floating-point denormal mode to use, for float. |
235 | | llvm::DenormalMode FP32DenormalMode = llvm::DenormalMode::getIEEE(); |
236 | | |
237 | | /// The float precision limit to use, if non-empty. |
238 | | std::string LimitFloatPrecision; |
239 | | |
240 | | struct BitcodeFileToLink { |
241 | | /// The filename of the bitcode file to link in. |
242 | | std::string Filename; |
243 | | /// If true, we set attributes functions in the bitcode library according to |
244 | | /// our CodeGenOptions, much as we set attrs on functions that we generate |
245 | | /// ourselves. |
246 | | bool PropagateAttrs = false; |
247 | | /// If true, we use LLVM module internalizer. |
248 | | bool Internalize = false; |
249 | | /// Bitwise combination of llvm::Linker::Flags, passed to the LLVM linker. |
250 | | unsigned LinkFlags = 0; |
251 | | }; |
252 | | |
253 | | /// The files specified here are linked in to the module before optimizations. |
254 | | std::vector<BitcodeFileToLink> LinkBitcodeFiles; |
255 | | |
256 | | /// The user provided name for the "main file", if non-empty. This is useful |
257 | | /// in situations where the input file name does not match the original input |
258 | | /// file, for example with -save-temps. |
259 | | std::string MainFileName; |
260 | | |
261 | | /// The name for the split debug info file used for the DW_AT_[GNU_]dwo_name |
262 | | /// attribute in the skeleton CU. |
263 | | std::string SplitDwarfFile; |
264 | | |
265 | | /// Output filename for the split debug info, not used in the skeleton CU. |
266 | | std::string SplitDwarfOutput; |
267 | | |
268 | | /// Output filename used in the COFF debug information. |
269 | | std::string ObjectFilenameForDebug; |
270 | | |
271 | | /// The name of the relocation model to use. |
272 | | llvm::Reloc::Model RelocationModel; |
273 | | |
274 | | /// If not an empty string, trap intrinsics are lowered to calls to this |
275 | | /// function instead of to trap instructions. |
276 | | std::string TrapFuncName; |
277 | | |
278 | | /// A list of dependent libraries. |
279 | | std::vector<std::string> DependentLibraries; |
280 | | |
281 | | /// A list of linker options to embed in the object file. |
282 | | std::vector<std::string> LinkerOptions; |
283 | | |
284 | | /// Name of the profile file to use as output for -fprofile-instr-generate, |
285 | | /// -fprofile-generate, and -fcs-profile-generate. |
286 | | std::string InstrProfileOutput; |
287 | | |
288 | | /// Name of the profile file to use with -fprofile-sample-use. |
289 | | std::string SampleProfileFile; |
290 | | |
291 | | /// Name of the profile file to use as output for with -fmemory-profile. |
292 | | std::string MemoryProfileOutput; |
293 | | |
294 | | /// Name of the profile file to use as input for -fmemory-profile-use. |
295 | | std::string MemoryProfileUsePath; |
296 | | |
297 | | /// Name of the profile file to use as input for -fprofile-instr-use |
298 | | std::string ProfileInstrumentUsePath; |
299 | | |
300 | | /// Name of the profile remapping file to apply to the profile data supplied |
301 | | /// by -fprofile-sample-use or -fprofile-instr-use. |
302 | | std::string ProfileRemappingFile; |
303 | | |
304 | | /// Name of the function summary index file to use for ThinLTO function |
305 | | /// importing. |
306 | | std::string ThinLTOIndexFile; |
307 | | |
308 | | /// Name of a file that can optionally be written with minimized bitcode |
309 | | /// to be used as input for the ThinLTO thin link step, which only needs |
310 | | /// the summary and module symbol table (and not, e.g. any debug metadata). |
311 | | std::string ThinLinkBitcodeFile; |
312 | | |
313 | | /// Prefix to use for -save-temps output. |
314 | | std::string SaveTempsFilePrefix; |
315 | | |
316 | | /// Name of file passed with -fcuda-include-gpubinary option to forward to |
317 | | /// CUDA runtime back-end for incorporating them into host-side object file. |
318 | | std::string CudaGpuBinaryFileName; |
319 | | |
320 | | /// List of filenames passed in using the -fembed-offload-object option. These |
321 | | /// are offloading binaries containing device images and metadata. |
322 | | std::vector<std::string> OffloadObjects; |
323 | | |
324 | | /// The name of the file to which the backend should save YAML optimization |
325 | | /// records. |
326 | | std::string OptRecordFile; |
327 | | |
328 | | /// The regex that filters the passes that should be saved to the optimization |
329 | | /// records. |
330 | | std::string OptRecordPasses; |
331 | | |
332 | | /// The format used for serializing remarks (default: YAML) |
333 | | std::string OptRecordFormat; |
334 | | |
335 | | /// The name of the partition that symbols are assigned to, specified with |
336 | | /// -fsymbol-partition (see https://lld.llvm.org/Partitions.html). |
337 | | std::string SymbolPartition; |
338 | | |
339 | | enum RemarkKind { |
340 | | RK_Missing, // Remark argument not present on the command line. |
341 | | RK_Enabled, // Remark enabled via '-Rgroup'. |
342 | | RK_EnabledEverything, // Remark enabled via '-Reverything'. |
343 | | RK_Disabled, // Remark disabled via '-Rno-group'. |
344 | | RK_DisabledEverything, // Remark disabled via '-Rno-everything'. |
345 | | RK_WithPattern, // Remark pattern specified via '-Rgroup=regexp'. |
346 | | }; |
347 | | |
348 | | /// Optimization remark with an optional regular expression pattern. |
349 | | struct OptRemark { |
350 | | RemarkKind Kind = RK_Missing; |
351 | | std::string Pattern; |
352 | | std::shared_ptr<llvm::Regex> Regex; |
353 | | |
354 | | /// By default, optimization remark is missing. |
355 | 1.08M | OptRemark() = default; |
356 | | |
357 | | /// Returns true iff the optimization remark holds a valid regular |
358 | | /// expression. |
359 | 7.41M | bool hasValidPattern() const { return Regex != nullptr; } |
360 | | |
361 | | /// Matches the given string against the regex, if there is some. |
362 | 6.10M | bool patternMatches(StringRef String) const { |
363 | 6.10M | return hasValidPattern() && Regex->match(String)3.00k ; |
364 | 6.10M | } |
365 | | }; |
366 | | |
367 | | /// Selected optimizations for which we should enable optimization remarks. |
368 | | /// Transformation passes whose name matches the contained (optional) regular |
369 | | /// expression (and support this feature), will emit a diagnostic whenever |
370 | | /// they perform a transformation. |
371 | | OptRemark OptimizationRemark; |
372 | | |
373 | | /// Selected optimizations for which we should enable missed optimization |
374 | | /// remarks. Transformation passes whose name matches the contained (optional) |
375 | | /// regular expression (and support this feature), will emit a diagnostic |
376 | | /// whenever they tried but failed to perform a transformation. |
377 | | OptRemark OptimizationRemarkMissed; |
378 | | |
379 | | /// Selected optimizations for which we should enable optimization analyses. |
380 | | /// Transformation passes whose name matches the contained (optional) regular |
381 | | /// expression (and support this feature), will emit a diagnostic whenever |
382 | | /// they want to explain why they decided to apply or not apply a given |
383 | | /// transformation. |
384 | | OptRemark OptimizationRemarkAnalysis; |
385 | | |
386 | | /// Set of sanitizer checks that are non-fatal (i.e. execution should be |
387 | | /// continued when possible). |
388 | | SanitizerSet SanitizeRecover; |
389 | | |
390 | | /// Set of sanitizer checks that trap rather than diagnose. |
391 | | SanitizerSet SanitizeTrap; |
392 | | |
393 | | /// List of backend command-line options for -fembed-bitcode. |
394 | | std::vector<uint8_t> CmdArgs; |
395 | | |
396 | | /// A list of all -fno-builtin-* function names (e.g., memset). |
397 | | std::vector<std::string> NoBuiltinFuncs; |
398 | | |
399 | | std::vector<std::string> Reciprocals; |
400 | | |
401 | | /// The preferred width for auto-vectorization transforms. This is intended to |
402 | | /// override default transforms based on the width of the architected vector |
403 | | /// registers. |
404 | | std::string PreferVectorWidth; |
405 | | |
406 | | /// Set of XRay instrumentation kinds to emit. |
407 | | XRayInstrSet XRayInstrumentationBundle; |
408 | | |
409 | | std::vector<std::string> DefaultFunctionAttrs; |
410 | | |
411 | | /// List of dynamic shared object files to be loaded as pass plugins. |
412 | | std::vector<std::string> PassPlugins; |
413 | | |
414 | | /// List of pass builder callbacks. |
415 | | std::vector<std::function<void(llvm::PassBuilder &)>> PassBuilderCallbacks; |
416 | | |
417 | | /// Path to allowlist file specifying which objects |
418 | | /// (files, functions) should exclusively be instrumented |
419 | | /// by sanitizer coverage pass. |
420 | | std::vector<std::string> SanitizeCoverageAllowlistFiles; |
421 | | |
422 | | /// The guard style used for stack protector to get a initial value, this |
423 | | /// value usually be gotten from TLS or get from __stack_chk_guard, or some |
424 | | /// other styles we may implement in the future. |
425 | | std::string StackProtectorGuard; |
426 | | |
427 | | /// The TLS base register when StackProtectorGuard is "tls", or register used |
428 | | /// to store the stack canary for "sysreg". |
429 | | /// On x86 this can be "fs" or "gs". |
430 | | /// On AArch64 this can only be "sp_el0". |
431 | | std::string StackProtectorGuardReg; |
432 | | |
433 | | /// Specify a symbol to be the guard value. |
434 | | std::string StackProtectorGuardSymbol; |
435 | | |
436 | | /// Path to ignorelist file specifying which objects |
437 | | /// (files, functions) listed for instrumentation by sanitizer |
438 | | /// coverage pass should actually not be instrumented. |
439 | | std::vector<std::string> SanitizeCoverageIgnorelistFiles; |
440 | | |
441 | | /// Path to ignorelist file specifying which objects |
442 | | /// (files, functions) listed for instrumentation by sanitizer |
443 | | /// binary metadata pass should not be instrumented. |
444 | | std::vector<std::string> SanitizeMetadataIgnorelistFiles; |
445 | | |
446 | | /// Name of the stack usage file (i.e., .su file) if user passes |
447 | | /// -fstack-usage. If empty, it can be implied that -fstack-usage is not |
448 | | /// passed on the command line. |
449 | | std::string StackUsageOutput; |
450 | | |
451 | | /// Executable and command-line used to create a given CompilerInvocation. |
452 | | /// Most of the time this will be the full -cc1 command. |
453 | | const char *Argv0 = nullptr; |
454 | | std::vector<std::string> CommandLineArgs; |
455 | | |
456 | | /// The minimum hotness value a diagnostic needs in order to be included in |
457 | | /// optimization diagnostics. |
458 | | /// |
459 | | /// The threshold is an Optional value, which maps to one of the 3 states: |
460 | | /// 1. 0 => threshold disabled. All remarks will be printed. |
461 | | /// 2. positive int => manual threshold by user. Remarks with hotness exceed |
462 | | /// threshold will be printed. |
463 | | /// 3. None => 'auto' threshold by user. The actual value is not |
464 | | /// available at command line, but will be synced with |
465 | | /// hotness threshold from profile summary during |
466 | | /// compilation. |
467 | | /// |
468 | | /// If threshold option is not specified, it is disabled by default. |
469 | | std::optional<uint64_t> DiagnosticsHotnessThreshold = 0; |
470 | | |
471 | | /// The maximum percentage profiling weights can deviate from the expected |
472 | | /// values in order to be included in misexpect diagnostics. |
473 | | std::optional<uint32_t> DiagnosticsMisExpectTolerance = 0; |
474 | | |
475 | | /// The name of a file to use with \c .secure_log_unique directives. |
476 | | std::string AsSecureLogFile; |
477 | | |
478 | | public: |
479 | | // Define accessors/mutators for code generation options of enumeration type. |
480 | | #define CODEGENOPT(Name, Bits, Default) |
481 | | #define ENUM_CODEGENOPT(Name, Type, Bits, Default) \ |
482 | 8.45M | Type get##Name() const { return static_cast<Type>(Name); } \ clang::CodeGenOptions::getDebugSimpleTemplateNames() const Line | Count | Source | 482 | 816k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getDebugInfo() const Line | Count | Source | 482 | 4.81M | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getCompressDebugSections() const Line | Count | Source | 482 | 18.0k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getFramePointer() const Line | Count | Source | 482 | 506k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getEmbedBitcode() const Line | Count | Source | 482 | 21.6k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getInlineAsmDialect() const Line | Count | Source | 482 | 1.99k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getEmitDwarfUnwind() const Line | Count | Source | 482 | 18.0k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getObjCDispatchMethod() const Line | Count | Source | 482 | 8.36k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getProfileInstr() const Line | Count | Source | 482 | 1.18M | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getProfileUse() const Line | Count | Source | 482 | 78.2k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getStructReturnConvention() const Line | Count | Source | 482 | 3.39k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getSanitizeAddressUseAfterReturn() const Line | Count | Source | 482 | 102 | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getSanitizeAddressDtor() const Line | Count | Source | 482 | 102 | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getFiniteLoops() const Line | Count | Source | 482 | 329k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getAssignmentTrackingMode() const Line | Count | Source | 482 | 21.9k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getDebugSrcHash() const Line | Count | Source | 482 | 281 | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getDebuggerTuning() const Line | Count | Source | 482 | 131k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getInlining() const Line | Count | Source | 482 | 105k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getVecLib() const Line | Count | Source | 482 | 25.9k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getDefaultTLSModel() const Line | Count | Source | 482 | 671 | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getSwiftAsyncFramePointer() const Line | Count | Source | 482 | 18.0k | Type get##Name() const { return static_cast<Type>(Name); } \ |
clang::CodeGenOptions::getZeroCallUsedRegs() const Line | Count | Source | 482 | 358k | Type get##Name() const { return static_cast<Type>(Name); } \ |
|
483 | 4.69M | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } clang::CodeGenOptions::setCompressDebugSections(llvm::DebugCompressionType) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setFramePointer(clang::CodeGenOptions::FramePointerKind) Line | Count | Source | 483 | 216k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setEmbedBitcode(clang::CodeGenOptions::EmbedBitcodeKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setInlineAsmDialect(clang::CodeGenOptions::InlineAsmDialectKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setEmitDwarfUnwind(llvm::EmitDwarfUnwindType) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setObjCDispatchMethod(clang::CodeGenOptions::ObjCDispatchMethodKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setProfileInstr(clang::CodeGenOptions::ProfileInstrKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setSanitizeAddressUseAfterReturn(llvm::AsanDetectStackUseAfterReturnMode) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setSanitizeAddressDtor(llvm::AsanDtorKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setFiniteLoops(clang::CodeGenOptions::FiniteLoopsKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setAssignmentTrackingMode(clang::CodeGenOptions::AssignmentTrackingOpts) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setDebugSrcHash(clang::CodeGenOptions::DebugSrcHashKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setDebuggerTuning(llvm::DebuggerKind) Line | Count | Source | 483 | 205k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setVecLib(clang::CodeGenOptions::VectorLibrary) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setDefaultTLSModel(clang::CodeGenOptions::TLSModel) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setSwiftAsyncFramePointer(clang::CodeGenOptions::SwiftAsyncFramePointerKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setZeroCallUsedRegs(llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setInlining(clang::CodeGenOptions::InliningMethod) Line | Count | Source | 483 | 361k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setDebugInfo(llvm::codegenoptions::DebugInfoKind) Line | Count | Source | 483 | 225k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setDebugSimpleTemplateNames(llvm::codegenoptions::DebugTemplateNamesKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setStructReturnConvention(clang::CodeGenOptions::StructReturnConventionKind) Line | Count | Source | 483 | 204k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
clang::CodeGenOptions::setProfileUse(clang::CodeGenOptions::ProfileInstrKind) Line | Count | Source | 483 | 205k | void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } |
|
484 | | #include "clang/Basic/CodeGenOptions.def" |
485 | | |
486 | | CodeGenOptions(); |
487 | | |
488 | 0 | const std::vector<std::string> &getNoBuiltinFuncs() const { |
489 | 0 | return NoBuiltinFuncs; |
490 | 0 | } |
491 | | |
492 | | /// Check if Clang profile instrumenation is on. |
493 | 810k | bool hasProfileClangInstr() const { |
494 | 810k | return getProfileInstr() == ProfileClangInstr; |
495 | 810k | } |
496 | | |
497 | | /// Check if IR level profile instrumentation is on. |
498 | 24.7k | bool hasProfileIRInstr() const { |
499 | 24.7k | return getProfileInstr() == ProfileIRInstr; |
500 | 24.7k | } |
501 | | |
502 | | /// Check if CS IR level profile instrumentation is on. |
503 | 22.0k | bool hasProfileCSIRInstr() const { |
504 | 22.0k | return getProfileInstr() == ProfileCSIRInstr; |
505 | 22.0k | } |
506 | | |
507 | | /// Check if Clang profile use is on. |
508 | 34.2k | bool hasProfileClangUse() const { |
509 | 34.2k | return getProfileUse() == ProfileClangInstr; |
510 | 34.2k | } |
511 | | |
512 | | /// Check if IR level profile use is on. |
513 | 21.9k | bool hasProfileIRUse() const { |
514 | 21.9k | return getProfileUse() == ProfileIRInstr || |
515 | 21.9k | getProfileUse() == ProfileCSIRInstr21.9k ; |
516 | 21.9k | } |
517 | | |
518 | | /// Check if CSIR profile use is on. |
519 | 77 | bool hasProfileCSIRUse() const { return getProfileUse() == ProfileCSIRInstr; } |
520 | | |
521 | | /// Check if type and variable info should be emitted. |
522 | 2.39M | bool hasReducedDebugInfo() const { |
523 | 2.39M | return getDebugInfo() >= llvm::codegenoptions::DebugInfoConstructor; |
524 | 2.39M | } |
525 | | |
526 | | /// Check if maybe unused type info should be emitted. |
527 | 2.27M | bool hasMaybeUnusedDebugInfo() const { |
528 | 2.27M | return getDebugInfo() >= llvm::codegenoptions::UnusedTypeInfo; |
529 | 2.27M | } |
530 | | |
531 | | // Check if any one of SanitizeCoverage* is enabled. |
532 | 177k | bool hasSanitizeCoverage() const { |
533 | 177k | return SanitizeCoverageType || SanitizeCoverageIndirectCalls177k || |
534 | 177k | SanitizeCoverageTraceCmp177k || SanitizeCoverageTraceLoads177k || |
535 | 177k | SanitizeCoverageTraceStores177k || SanitizeCoverageControlFlow177k ; |
536 | 177k | } |
537 | | |
538 | | // Check if any one of SanitizeBinaryMetadata* is enabled. |
539 | 334k | bool hasSanitizeBinaryMetadata() const { |
540 | 334k | return SanitizeBinaryMetadataCovered || SanitizeBinaryMetadataAtomics334k || |
541 | 334k | SanitizeBinaryMetadataUAR334k ; |
542 | 334k | } |
543 | | }; |
544 | | |
545 | | } // end namespace clang |
546 | | |
547 | | #endif |