clang  14.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 
105  // This field stores one of the allowed values for the option
106  // -fbasic-block-sections=. The allowed values with this option are:
107  // {"labels", "all", "list=<file>", "none"}.
108  //
109  // "labels": Only generate basic block symbols (labels) for all basic
110  // blocks, do not generate unique sections for basic blocks.
111  // Use the machine basic block id in the symbol name to
112  // associate profile info from virtual address to machine
113  // basic block.
114  // "all" : Generate basic block sections for all basic blocks.
115  // "list=<file>": Generate basic block sections for a subset of basic blocks.
116  // The functions and the machine basic block ids are specified
117  // in the file.
118  // "none": Disable sections/labels for basic blocks.
120 
121  // If set, override the default value of MCAsmInfo::BinutilsVersion. If
122  // DisableIntegratedAS is specified, the assembly output will consider GNU as
123  // support. "none" means that all ELF features can be used, regardless of
124  // binutils support.
126 
127  enum class FramePointerKind {
128  None, // Omit all frame pointers.
129  NonLeaf, // Keep non-leaf frame pointers.
130  All, // Keep all frame pointers.
131  };
132 
134  Auto, // Choose Swift async extended frame info based on deployment target.
135  Always, // Unconditionally emit Swift async extended frame info.
136  Never, // Don't emit Swift async extended frame info.
137  Default = Always,
138  };
139 
141  Language, // Not specified, use language standard.
142  Always, // All loops are assumed to be finite.
143  Never, // No loop is assumed to be finite.
144  };
145 
146  /// The code model to use (-mcmodel).
148 
149  /// The filename with path we use for coverage data files. The runtime
150  /// allows further manipulation with the GCOV_PREFIX and GCOV_PREFIX_STRIP
151  /// environment variables.
153 
154  /// The filename with path we use for coverage notes files.
156 
157  /// Regexes separated by a semi-colon to filter the files to instrument.
159 
160  /// Regexes separated by a semi-colon to filter the files to not instrument.
162 
163  /// The version string to put into coverage files.
165 
166  /// Enable additional debugging information.
168 
169  /// The string to embed in debug information as the current working directory.
171 
172  /// The string to embed in coverage mapping as the current working directory.
174 
175  /// The string to embed in the debug information for the compile unit, if
176  /// non-empty.
178 
179  /// The string containing the commandline for the llvm.commandline metadata,
180  /// if non-empty.
182 
183  std::map<std::string, std::string> DebugPrefixMap;
184  std::map<std::string, std::string> CoveragePrefixMap;
185 
186  /// The ABI to use for passing floating point arguments.
188 
189  /// The file to use for dumping bug report by `Debugify` for original
190  /// debug info.
192 
193  /// The floating-point denormal mode to use.
194  llvm::DenormalMode FPDenormalMode = llvm::DenormalMode::getIEEE();
195 
196  /// The floating-point denormal mode to use, for float.
197  llvm::DenormalMode FP32DenormalMode = llvm::DenormalMode::getIEEE();
198 
199  /// The float precision limit to use, if non-empty.
201 
203  /// The filename of the bitcode file to link in.
205  /// If true, we set attributes functions in the bitcode library according to
206  /// our CodeGenOptions, much as we set attrs on functions that we generate
207  /// ourselves.
208  bool PropagateAttrs = false;
209  /// If true, we use LLVM module internalizer.
210  bool Internalize = false;
211  /// Bitwise combination of llvm::Linker::Flags, passed to the LLVM linker.
212  unsigned LinkFlags = 0;
213  };
214 
215  /// The files specified here are linked in to the module before optimizations.
216  std::vector<BitcodeFileToLink> LinkBitcodeFiles;
217 
218  /// The user provided name for the "main file", if non-empty. This is useful
219  /// in situations where the input file name does not match the original input
220  /// file, for example with -save-temps.
222 
223  /// The name for the split debug info file used for the DW_AT_[GNU_]dwo_name
224  /// attribute in the skeleton CU.
226 
227  /// Output filename for the split debug info, not used in the skeleton CU.
229 
230  /// The name of the relocation model to use.
231  llvm::Reloc::Model RelocationModel;
232 
233  /// If not an empty string, trap intrinsics are lowered to calls to this
234  /// function instead of to trap instructions.
236 
237  /// A list of dependent libraries.
238  std::vector<std::string> DependentLibraries;
239 
240  /// A list of linker options to embed in the object file.
241  std::vector<std::string> LinkerOptions;
242 
243  /// Name of the profile file to use as output for -fprofile-instr-generate,
244  /// -fprofile-generate, and -fcs-profile-generate.
246 
247  /// Name of the profile file to use with -fprofile-sample-use.
249 
250  /// Name of the profile file to use as output for with -fmemory-profile.
252 
253  /// Name of the profile file to use as input for -fprofile-instr-use
255 
256  /// Name of the profile remapping file to apply to the profile data supplied
257  /// by -fprofile-sample-use or -fprofile-instr-use.
259 
260  /// Name of the function summary index file to use for ThinLTO function
261  /// importing.
263 
264  /// Name of a file that can optionally be written with minimized bitcode
265  /// to be used as input for the ThinLTO thin link step, which only needs
266  /// the summary and module symbol table (and not, e.g. any debug metadata).
268 
269  /// Prefix to use for -save-temps output.
271 
272  /// Name of file passed with -fcuda-include-gpubinary option to forward to
273  /// CUDA runtime back-end for incorporating them into host-side object file.
275 
276  /// The name of the file to which the backend should save YAML optimization
277  /// records.
279 
280  /// The regex that filters the passes that should be saved to the optimization
281  /// records.
283 
284  /// The format used for serializing remarks (default: YAML)
286 
287  /// The name of the partition that symbols are assigned to, specified with
288  /// -fsymbol-partition (see https://lld.llvm.org/Partitions.html).
290 
291  enum RemarkKind {
292  RK_Missing, // Remark argument not present on the command line.
293  RK_Enabled, // Remark enabled via '-Rgroup'.
294  RK_EnabledEverything, // Remark enabled via '-Reverything'.
295  RK_Disabled, // Remark disabled via '-Rno-group'.
296  RK_DisabledEverything, // Remark disabled via '-Rno-everything'.
297  RK_WithPattern, // Remark pattern specified via '-Rgroup=regexp'.
298  };
299 
300  /// Optimization remark with an optional regular expression pattern.
301  struct OptRemark {
304  std::shared_ptr<llvm::Regex> Regex;
305 
306  /// By default, optimization remark is missing.
307  OptRemark() : Kind(RK_Missing), Pattern(""), Regex(nullptr) {}
308 
309  /// Returns true iff the optimization remark holds a valid regular
310  /// expression.
311  bool hasValidPattern() const { return Regex != nullptr; }
312 
313  /// Matches the given string against the regex, if there is some.
314  bool patternMatches(StringRef String) const {
315  return hasValidPattern() && Regex->match(String);
316  }
317  };
318 
319  /// Selected optimizations for which we should enable optimization remarks.
320  /// Transformation passes whose name matches the contained (optional) regular
321  /// expression (and support this feature), will emit a diagnostic whenever
322  /// they perform a transformation.
324 
325  /// Selected optimizations for which we should enable missed optimization
326  /// remarks. Transformation passes whose name matches the contained (optional)
327  /// regular expression (and support this feature), will emit a diagnostic
328  /// whenever they tried but failed to perform a transformation.
330 
331  /// Selected optimizations for which we should enable optimization analyses.
332  /// Transformation passes whose name matches the contained (optional) regular
333  /// expression (and support this feature), will emit a diagnostic whenever
334  /// they want to explain why they decided to apply or not apply a given
335  /// transformation.
337 
338  /// Set of files defining the rules for the symbol rewriting.
339  std::vector<std::string> RewriteMapFiles;
340 
341  /// Set of sanitizer checks that are non-fatal (i.e. execution should be
342  /// continued when possible).
344 
345  /// Set of sanitizer checks that trap rather than diagnose.
347 
348  /// List of backend command-line options for -fembed-bitcode.
349  std::vector<uint8_t> CmdArgs;
350 
351  /// A list of all -fno-builtin-* function names (e.g., memset).
352  std::vector<std::string> NoBuiltinFuncs;
353 
354  std::vector<std::string> Reciprocals;
355 
356  /// The preferred width for auto-vectorization transforms. This is intended to
357  /// override default transforms based on the width of the architected vector
358  /// registers.
360 
361  /// Set of XRay instrumentation kinds to emit.
363 
364  std::vector<std::string> DefaultFunctionAttrs;
365 
366  /// List of dynamic shared object files to be loaded as pass plugins.
367  std::vector<std::string> PassPlugins;
368 
369  /// Path to allowlist file specifying which objects
370  /// (files, functions) should exclusively be instrumented
371  /// by sanitizer coverage pass.
372  std::vector<std::string> SanitizeCoverageAllowlistFiles;
373 
374  /// The guard style used for stack protector to get a initial value, this
375  /// value usually be gotten from TLS or get from __stack_chk_guard, or some
376  /// other styles we may implement in the future.
378 
379  /// The TLS base register when StackProtectorGuard is "tls", or register used
380  /// to store the stack canary for "sysreg".
381  /// On x86 this can be "fs" or "gs".
382  /// On AArch64 this can only be "sp_el0".
384 
385  /// Path to ignorelist file specifying which objects
386  /// (files, functions) listed for instrumentation by sanitizer
387  /// coverage pass should actually not be instrumented.
388  std::vector<std::string> SanitizeCoverageIgnorelistFiles;
389 
390  /// Name of the stack usage file (i.e., .su file) if user passes
391  /// -fstack-usage. If empty, it can be implied that -fstack-usage is not
392  /// passed on the command line.
394 
395  /// Executable and command-line used to create a given CompilerInvocation.
396  /// Most of the time this will be the full -cc1 command.
397  const char *Argv0 = nullptr;
399 
400  /// The minimum hotness value a diagnostic needs in order to be included in
401  /// optimization diagnostics.
402  ///
403  /// The threshold is an Optional value, which maps to one of the 3 states:
404  /// 1. 0 => threshold disabled. All remarks will be printed.
405  /// 2. positive int => manual threshold by user. Remarks with hotness exceed
406  /// threshold will be printed.
407  /// 3. None => 'auto' threshold by user. The actual value is not
408  /// available at command line, but will be synced with
409  /// hotness threshold from profile summary during
410  /// compilation.
411  ///
412  /// If threshold option is not specified, it is disabled by default.
414 
415 public:
416  // Define accessors/mutators for code generation options of enumeration type.
417 #define CODEGENOPT(Name, Bits, Default)
418 #define ENUM_CODEGENOPT(Name, Type, Bits, Default) \
419  Type get##Name() const { return static_cast<Type>(Name); } \
420  void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
421 #include "clang/Basic/CodeGenOptions.def"
422 
423  CodeGenOptions();
424 
425  const std::vector<std::string> &getNoBuiltinFuncs() const {
426  return NoBuiltinFuncs;
427  }
428 
429  /// Check if Clang profile instrumenation is on.
430  bool hasProfileClangInstr() const {
431  return getProfileInstr() == ProfileClangInstr;
432  }
433 
434  /// Check if IR level profile instrumentation is on.
435  bool hasProfileIRInstr() const {
436  return getProfileInstr() == ProfileIRInstr;
437  }
438 
439  /// Check if CS IR level profile instrumentation is on.
440  bool hasProfileCSIRInstr() const {
441  return getProfileInstr() == ProfileCSIRInstr;
442  }
443 
444  /// Check if Clang profile use is on.
445  bool hasProfileClangUse() const {
446  return getProfileUse() == ProfileClangInstr;
447  }
448 
449  /// Check if IR level profile use is on.
450  bool hasProfileIRUse() const {
451  return getProfileUse() == ProfileIRInstr ||
452  getProfileUse() == ProfileCSIRInstr;
453  }
454 
455  /// Check if CSIR profile use is on.
456  bool hasProfileCSIRUse() const { return getProfileUse() == ProfileCSIRInstr; }
457 
458  /// Check if type and variable info should be emitted.
459  bool hasReducedDebugInfo() const {
460  return getDebugInfo() >= codegenoptions::DebugInfoConstructor;
461  }
462 
463  /// Check if maybe unused type info should be emitted.
464  bool hasMaybeUnusedDebugInfo() const {
465  return getDebugInfo() >= codegenoptions::UnusedTypeInfo;
466  }
467 
468  // Check if any one of SanitizeCoverage* is enabled.
469  bool hasSanitizeCoverage() const {
470  return SanitizeCoverageType || SanitizeCoverageIndirectCalls ||
471  SanitizeCoverageTraceCmp || SanitizeCoverageTraceLoads ||
472  SanitizeCoverageTraceStores;
473  }
474 };
475 
476 } // end namespace clang
477 
478 #endif
clang::CodeGenOptions::BinutilsVersion
std::string BinutilsVersion
Definition: CodeGenOptions.h:125
clang::CodeGenOptions::getNoBuiltinFuncs
const std::vector< std::string > & getNoBuiltinFuncs() const
Definition: CodeGenOptions.h:425
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:397
clang::CodeGenOptions::TLSModel
TLSModel
Definition: CodeGenOptions.h:72
clang::CodeGenOptions::EmbedBitcodeKind
EmbedBitcodeKind
Definition: CodeGenOptions.h:93
clang::CodeGenOptions::SwiftAsyncFramePointerKind
SwiftAsyncFramePointerKind
Definition: CodeGenOptions.h:133
clang::CodeGenOptions::CoveragePrefixMap
std::map< std::string, std::string > CoveragePrefixMap
Definition: CodeGenOptions.h:184
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:267
clang::CodeGenOptions::InstrProfileOutput
std::string InstrProfileOutput
Name of the profile file to use as output for -fprofile-instr-generate, -fprofile-generate,...
Definition: CodeGenOptions.h:245
clang::CodeGenOptions::InliningMethod
InliningMethod
Definition: CodeGenOptions.h:51
clang::CodeGenOptions::Reciprocals
std::vector< std::string > Reciprocals
Definition: CodeGenOptions.h:354
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:343
clang::CodeGenOptions::OptimizationRemarkAnalysis
OptRemark OptimizationRemarkAnalysis
Selected optimizations for which we should enable optimization analyses.
Definition: CodeGenOptions.h:336
clang::CodeGenOptions::hasMaybeUnusedDebugInfo
bool hasMaybeUnusedDebugInfo() const
Check if maybe unused type info should be emitted.
Definition: CodeGenOptions.h:464
clang::CodeGenOptions::CoverageNotesFile
std::string CoverageNotesFile
The filename with path we use for coverage notes files.
Definition: CodeGenOptions.h:155
clang::CodeGenOptions::LocalExecTLSModel
@ LocalExecTLSModel
Definition: CodeGenOptions.h:76
clang::CodeGenOptions::SwiftAsyncFramePointerKind::Auto
@ Auto
clang::CodeGenOptions::hasSanitizeCoverage
bool hasSanitizeCoverage() const
Definition: CodeGenOptions.h:469
clang::CodeGenOptions::OptRemark::Regex
std::shared_ptr< llvm::Regex > Regex
Definition: CodeGenOptions.h:304
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::DIBugsReportFilePath
std::string DIBugsReportFilePath
The file to use for dumping bug report by Debugify for original debug info.
Definition: CodeGenOptions.h:191
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:248
clang::CodeGenOptions::SaveTempsFilePrefix
std::string SaveTempsFilePrefix
Prefix to use for -save-temps output.
Definition: CodeGenOptions.h:270
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:314
clang::CodeGenOptions::OptRemark::Kind
RemarkKind Kind
Definition: CodeGenOptions.h:302
llvm::Optional< uint64_t >
clang::CodeGenOptions::OptRemark::Pattern
std::string Pattern
Definition: CodeGenOptions.h:303
clang::CodeGenOptions::CodeModel
std::string CodeModel
The code model to use (-mcmodel).
Definition: CodeGenOptions.h:147
clang::CodeGenOptions::RewriteMapFiles
std::vector< std::string > RewriteMapFiles
Set of files defining the rules for the symbol rewriting.
Definition: CodeGenOptions.h:339
clang::CodeGenOptions::hasProfileCSIRUse
bool hasProfileCSIRUse() const
Check if CSIR profile use is on.
Definition: CodeGenOptions.h:456
clang::CodeGenOptions::VectorLibrary
VectorLibrary
Definition: CodeGenOptions.h:57
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:377
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:167
clang::CodeGenOptions::IAD_Intel
@ IAD_Intel
Definition: CodeGenOptions.h:102
clang::CodeGenOptions::CommandLineArgs
ArrayRef< const char * > CommandLineArgs
Definition: CodeGenOptions.h:398
clang::CodeGenOptions::RemarkKind
RemarkKind
Definition: CodeGenOptions.h:291
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:158
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:258
clang::CodeGenOptions::Always
@ Always
clang::CodeGenOptions::Always
@ Always
Definition: CodeGenOptions.h:142
clang::CodeGenOptions::NoBuiltinFuncs
std::vector< std::string > NoBuiltinFuncs
A list of all -fno-builtin-* function names (e.g., memset).
Definition: CodeGenOptions.h:352
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:225
clang::CodeGenOptions::RK_DisabledEverything
@ RK_DisabledEverything
Definition: CodeGenOptions.h:296
clang::CodeGenOptions::FloatABI
std::string FloatABI
The ABI to use for passing floating point arguments.
Definition: CodeGenOptions.h:187
clang::SanitizerSet
Definition: Sanitizers.h:153
clang::CodeGenOptions::FramePointerKind
FramePointerKind
Definition: CodeGenOptions.h:127
clang::CodeGenOptions::CmdArgs
std::vector< uint8_t > CmdArgs
List of backend command-line options for -fembed-bitcode.
Definition: CodeGenOptions.h:349
clang::CodeGenOptions::DebugPrefixMap
std::map< std::string, std::string > DebugPrefixMap
Definition: CodeGenOptions.h:183
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:251
clang::CodeGenOptions::SplitDwarfOutput
std::string SplitDwarfOutput
Output filename for the split debug info, not used in the skeleton CU.
Definition: CodeGenOptions.h:228
clang::CodeGenOptions::CoverageCompilationDir
std::string CoverageCompilationDir
The string to embed in coverage mapping as the current working directory.
Definition: CodeGenOptions.h:173
clang::CodeGenOptions::OptimizationRemarkMissed
OptRemark OptimizationRemarkMissed
Selected optimizations for which we should enable missed optimization remarks.
Definition: CodeGenOptions.h:329
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:367
clang::CodeGenOptions::hasProfileClangUse
bool hasProfileClangUse() const
Check if Clang profile use is on.
Definition: CodeGenOptions.h:445
clang::CodeGenOptions::OptRemark
Optimization remark with an optional regular expression pattern.
Definition: CodeGenOptions.h:301
clang::CodeGenOptions::OptRecordFormat
std::string OptRecordFormat
The format used for serializing remarks (default: YAML)
Definition: CodeGenOptions.h:285
clang::CodeGenOptions::Legacy
@ Legacy
Definition: CodeGenOptions.h:67
clang::CodeGenOptions::DependentLibraries
std::vector< std::string > DependentLibraries
A list of dependent libraries.
Definition: CodeGenOptions.h:238
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:164
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:362
clang::CodeGenOptions::LimitFloatPrecision
std::string LimitFloatPrecision
The float precision limit to use, if non-empty.
Definition: CodeGenOptions.h:200
clang::CodeGenOptions::RK_Disabled
@ RK_Disabled
Definition: CodeGenOptions.h:295
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:388
clang::CodeGenOptions::OptRemark::hasValidPattern
bool hasValidPattern() const
Returns true iff the optimization remark holds a valid regular expression.
Definition: CodeGenOptions.h:311
clang::CodeGenOptions::hasProfileIRUse
bool hasProfileIRUse() const
Check if IR level profile use is on.
Definition: CodeGenOptions.h:450
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:231
clang::CodeGenOptions::SRCK_Default
@ SRCK_Default
Definition: CodeGenOptions.h:80
clang::CodeGenOptions::FP32DenormalMode
llvm::DenormalMode FP32DenormalMode
The floating-point denormal mode to use, for float.
Definition: CodeGenOptions.h:197
llvm::ArrayRef< const char * >
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:289
clang::CodeGenOptions::PreferVectorWidth
std::string PreferVectorWidth
The preferred width for auto-vectorization transforms.
Definition: CodeGenOptions.h:359
clang::CodeGenOptions::Language
@ Language
Definition: CodeGenOptions.h:141
clang::CodeGenOptions::CodeGenOptions
CodeGenOptions()
Definition: CodeGenOptions.cpp:14
clang::CodeGenOptions::OptRemark::OptRemark
OptRemark()
By default, optimization remark is missing.
Definition: CodeGenOptions.h:307
clang::CodeGenOptions::RK_WithPattern
@ RK_WithPattern
Definition: CodeGenOptions.h:297
clang::CodeGenOptions::hasProfileCSIRInstr
bool hasProfileCSIRInstr() const
Check if CS IR level profile instrumentation is on.
Definition: CodeGenOptions.h:440
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:459
clang::CodeGenOptions::RecordCommandLine
std::string RecordCommandLine
The string containing the commandline for the llvm.commandline metadata, if non-empty.
Definition: CodeGenOptions.h:181
clang::CodeGenOptions::DebugCompilationDir
std::string DebugCompilationDir
The string to embed in debug information as the current working directory.
Definition: CodeGenOptions.h:170
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:430
clang::CodeGenOptions::BBSections
std::string BBSections
Definition: CodeGenOptions.h:119
clang::CodeGenOptions::StackUsageOutput
std::string StackUsageOutput
Name of the stack usage file (i.e., .su file) if user passes -fstack-usage.
Definition: CodeGenOptions.h:393
clang::CodeGenOptions::DefaultFunctionAttrs
std::vector< std::string > DefaultFunctionAttrs
Definition: CodeGenOptions.h:364
Sanitizers.h
clang::CodeGenOptions::RK_EnabledEverything
@ RK_EnabledEverything
Definition: CodeGenOptions.h:294
clang
Definition: CalledOnceCheck.h:17
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:346
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:278
DebugInfoOptions.h
clang::CodeGenOptions::LinkBitcodeFiles
std::vector< BitcodeFileToLink > LinkBitcodeFiles
The files specified here are linked in to the module before optimizations.
Definition: CodeGenOptions.h:216
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:292
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:274
clang::CodeGenOptions::NoLibrary
@ NoLibrary
Definition: CodeGenOptions.h:58
clang::CodeGenOptions::FPDenormalMode
llvm::DenormalMode FPDenormalMode
The floating-point denormal mode to use.
Definition: CodeGenOptions.h:194
clang::CodeGenOptions::ThinLTOIndexFile
std::string ThinLTOIndexFile
Name of the function summary index file to use for ThinLTO function importing.
Definition: CodeGenOptions.h:262
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:293
clang::CodeGenOptions::ProfileExcludeFiles
std::string ProfileExcludeFiles
Regexes separated by a semi-colon to filter the files to not instrument.
Definition: CodeGenOptions.h:161
clang::CodeGenOptions::Never
@ Never
Definition: CodeGenOptions.h:143
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:241
clang::CodeGenOptions::CoverageDataFile
std::string CoverageDataFile
The filename with path we use for coverage data files.
Definition: CodeGenOptions.h:152
clang::CodeGenOptions::ProfileInstrumentUsePath
std::string ProfileInstrumentUsePath
Name of the profile file to use as input for -fprofile-instr-use.
Definition: CodeGenOptions.h:254
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:435
clang::CodeGenOptions::FiniteLoopsKind
FiniteLoopsKind
Definition: CodeGenOptions.h:140
clang::CodeGenOptions::DwarfDebugFlags
std::string DwarfDebugFlags
The string to embed in the debug information for the compile unit, if non-empty.
Definition: CodeGenOptions.h:177
clang::CodeGenOptions::OptRecordPasses
std::string OptRecordPasses
The regex that filters the passes that should be saved to the optimization records.
Definition: CodeGenOptions.h:282
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:413
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:383
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:235
clang::CodeGenOptions::MainFileName
std::string MainFileName
The user provided name for the "main file", if non-empty.
Definition: CodeGenOptions.h:221
clang::CodeGenOptions::Never
@ Never
clang::CodeGenOptions::OptimizationRemark
OptRemark OptimizationRemark
Selected optimizations for which we should enable optimization remarks.
Definition: CodeGenOptions.h:323
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:372