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