clang  8.0.0svn
ToolChain.h
Go to the documentation of this file.
1 //===- ToolChain.h - Collections of tools for one platform ------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_DRIVER_TOOLCHAIN_H
11 #define LLVM_CLANG_DRIVER_TOOLCHAIN_H
12 
14 #include "clang/Basic/LLVM.h"
15 #include "clang/Basic/Sanitizers.h"
17 #include "clang/Driver/Action.h"
18 #include "clang/Driver/Multilib.h"
19 #include "clang/Driver/Types.h"
20 #include "llvm/ADT/ArrayRef.h"
21 #include "llvm/ADT/SmallVector.h"
22 #include "llvm/ADT/StringRef.h"
23 #include "llvm/ADT/Triple.h"
24 #include "llvm/MC/MCTargetOptions.h"
25 #include "llvm/Option/Option.h"
26 #include "llvm/Support/VersionTuple.h"
27 #include "llvm/Target/TargetOptions.h"
28 #include <cassert>
29 #include <memory>
30 #include <string>
31 #include <utility>
32 
33 namespace llvm {
34 namespace opt {
35 
36 class Arg;
37 class ArgList;
38 class DerivedArgList;
39 
40 } // namespace opt
41 namespace vfs {
42 
43 class FileSystem;
44 
45 } // namespace vfs
46 } // namespace llvm
47 
48 namespace clang {
49 
50 class ObjCRuntime;
51 
52 namespace driver {
53 
54 class Driver;
55 class InputInfo;
56 class SanitizerArgs;
57 class Tool;
58 class XRayArgs;
59 
60 /// Helper structure used to pass information extracted from clang executable
61 /// name such as `i686-linux-android-g++`.
63  /// Target part of the executable name, as `i686-linux-android`.
64  std::string TargetPrefix;
65 
66  /// Driver mode part of the executable name, as `g++`.
67  std::string ModeSuffix;
68 
69  /// Corresponding driver mode argument, as '--driver-mode=g++'
70  const char *DriverMode = nullptr;
71 
72  /// True if TargetPrefix is recognized as a registered target name.
73  bool TargetIsValid = false;
74 
75  ParsedClangName() = default;
76  ParsedClangName(std::string Suffix, const char *Mode)
77  : ModeSuffix(Suffix), DriverMode(Mode) {}
78  ParsedClangName(std::string Target, std::string Suffix, const char *Mode,
79  bool IsRegistered)
80  : TargetPrefix(Target), ModeSuffix(Suffix), DriverMode(Mode),
81  TargetIsValid(IsRegistered) {}
82 
83  bool isEmpty() const {
84  return TargetPrefix.empty() && ModeSuffix.empty() && DriverMode == nullptr;
85  }
86 };
87 
88 /// ToolChain - Access to tools for a single platform.
89 class ToolChain {
90 public:
92 
95  CST_Libstdcxx
96  };
97 
100  RLT_Libgcc
101  };
102 
103  enum RTTIMode {
106  };
107 
108 private:
110 
111  const Driver &D;
112  llvm::Triple Triple;
113  const llvm::opt::ArgList &Args;
114 
115  // We need to initialize CachedRTTIArg before CachedRTTIMode
116  const llvm::opt::Arg *const CachedRTTIArg;
117 
118  const RTTIMode CachedRTTIMode;
119 
120  /// The list of toolchain specific path prefixes to search for libraries.
121  path_list LibraryPaths;
122 
123  /// The list of toolchain specific path prefixes to search for files.
124  path_list FilePaths;
125 
126  /// The list of toolchain specific path prefixes to search for programs.
127  path_list ProgramPaths;
128 
129  mutable std::unique_ptr<Tool> Clang;
130  mutable std::unique_ptr<Tool> Assemble;
131  mutable std::unique_ptr<Tool> Link;
132  mutable std::unique_ptr<Tool> OffloadBundler;
133 
134  Tool *getClang() const;
135  Tool *getAssemble() const;
136  Tool *getLink() const;
137  Tool *getClangAs() const;
138  Tool *getOffloadBundler() const;
139 
140  mutable std::unique_ptr<SanitizerArgs> SanitizerArguments;
141  mutable std::unique_ptr<XRayArgs> XRayArguments;
142 
143  /// The effective clang triple for the current Job.
144  mutable llvm::Triple EffectiveTriple;
145 
146  /// Set the toolchain's effective clang triple.
147  void setEffectiveTriple(llvm::Triple ET) const {
148  EffectiveTriple = std::move(ET);
149  }
150 
151 protected:
154 
155  ToolChain(const Driver &D, const llvm::Triple &T,
156  const llvm::opt::ArgList &Args);
157 
158  void setTripleEnvironment(llvm::Triple::EnvironmentType Env);
159 
160  virtual Tool *buildAssembler() const;
161  virtual Tool *buildLinker() const;
162  virtual Tool *getTool(Action::ActionClass AC) const;
163 
164  /// \name Utilities for implementing subclasses.
165  ///@{
166  static void addSystemInclude(const llvm::opt::ArgList &DriverArgs,
167  llvm::opt::ArgStringList &CC1Args,
168  const Twine &Path);
169  static void addExternCSystemInclude(const llvm::opt::ArgList &DriverArgs,
170  llvm::opt::ArgStringList &CC1Args,
171  const Twine &Path);
172  static void
173  addExternCSystemIncludeIfExists(const llvm::opt::ArgList &DriverArgs,
174  llvm::opt::ArgStringList &CC1Args,
175  const Twine &Path);
176  static void addSystemIncludes(const llvm::opt::ArgList &DriverArgs,
177  llvm::opt::ArgStringList &CC1Args,
178  ArrayRef<StringRef> Paths);
179  ///@}
180 
181 public:
182  virtual ~ToolChain();
183 
184  // Accessors
185 
186  const Driver &getDriver() const { return D; }
187  llvm::vfs::FileSystem &getVFS() const;
188  const llvm::Triple &getTriple() const { return Triple; }
189 
190  /// Get the toolchain's aux triple, if it has one.
191  ///
192  /// Exactly what the aux triple represents depends on the toolchain, but for
193  /// example when compiling CUDA code for the GPU, the triple might be NVPTX,
194  /// while the aux triple is the host (CPU) toolchain, e.g. x86-linux-gnu.
195  virtual const llvm::Triple *getAuxTriple() const { return nullptr; }
196 
197  /// Some toolchains need to modify the file name, for example to replace the
198  /// extension for object files with .cubin for OpenMP offloading to Nvidia
199  /// GPUs.
200  virtual std::string getInputFilename(const InputInfo &Input) const;
201 
202  llvm::Triple::ArchType getArch() const { return Triple.getArch(); }
203  StringRef getArchName() const { return Triple.getArchName(); }
204  StringRef getPlatform() const { return Triple.getVendorName(); }
205  StringRef getOS() const { return Triple.getOSName(); }
206 
207  /// Provide the default architecture name (as expected by -arch) for
208  /// this toolchain.
209  StringRef getDefaultUniversalArchName() const;
210 
211  std::string getTripleString() const {
212  return Triple.getTriple();
213  }
214 
215  /// Get the toolchain's effective clang triple.
216  const llvm::Triple &getEffectiveTriple() const {
217  assert(!EffectiveTriple.getTriple().empty() && "No effective triple");
218  return EffectiveTriple;
219  }
220 
221  path_list &getLibraryPaths() { return LibraryPaths; }
222  const path_list &getLibraryPaths() const { return LibraryPaths; }
223 
224  path_list &getFilePaths() { return FilePaths; }
225  const path_list &getFilePaths() const { return FilePaths; }
226 
227  path_list &getProgramPaths() { return ProgramPaths; }
228  const path_list &getProgramPaths() const { return ProgramPaths; }
229 
230  const MultilibSet &getMultilibs() const { return Multilibs; }
231 
232  const Multilib &getMultilib() const { return SelectedMultilib; }
233 
234  const SanitizerArgs& getSanitizerArgs() const;
235 
236  const XRayArgs& getXRayArgs() const;
237 
238  // Returns the Arg * that explicitly turned on/off rtti, or nullptr.
239  const llvm::opt::Arg *getRTTIArg() const { return CachedRTTIArg; }
240 
241  // Returns the RTTIMode for the toolchain with the current arguments.
242  RTTIMode getRTTIMode() const { return CachedRTTIMode; }
243 
244  /// Return any implicit target and/or mode flag for an invocation of
245  /// the compiler driver as `ProgName`.
246  ///
247  /// For example, when called with i686-linux-android-g++, the first element
248  /// of the return value will be set to `"i686-linux-android"` and the second
249  /// will be set to "--driver-mode=g++"`.
250  /// It is OK if the target name is not registered. In this case the return
251  /// value contains false in the field TargetIsValid.
252  ///
253  /// \pre `llvm::InitializeAllTargets()` has been called.
254  /// \param ProgName The name the Clang driver was invoked with (from,
255  /// e.g., argv[0]).
256  /// \return A structure of type ParsedClangName that contains the executable
257  /// name parts.
258  static ParsedClangName getTargetAndModeFromProgramName(StringRef ProgName);
259 
260  // Tool access.
261 
262  /// TranslateArgs - Create a new derived argument list for any argument
263  /// translations this ToolChain may wish to perform, or 0 if no tool chain
264  /// specific translations are needed. If \p DeviceOffloadKind is specified
265  /// the translation specific for that offload kind is performed.
266  ///
267  /// \param BoundArch - The bound architecture name, or 0.
268  /// \param DeviceOffloadKind - The device offload kind used for the
269  /// translation.
270  virtual llvm::opt::DerivedArgList *
271  TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
272  Action::OffloadKind DeviceOffloadKind) const {
273  return nullptr;
274  }
275 
276  /// TranslateOpenMPTargetArgs - Create a new derived argument list for
277  /// that contains the OpenMP target specific flags passed via
278  /// -Xopenmp-target -opt=val OR -Xopenmp-target=<triple> -opt=val
279  virtual llvm::opt::DerivedArgList *TranslateOpenMPTargetArgs(
280  const llvm::opt::DerivedArgList &Args, bool SameTripleAsHost,
281  SmallVectorImpl<llvm::opt::Arg *> &AllocatedArgs) const;
282 
283  /// Choose a tool to use to handle the action \p JA.
284  ///
285  /// This can be overridden when a particular ToolChain needs to use
286  /// a compiler other than Clang.
287  virtual Tool *SelectTool(const JobAction &JA) const;
288 
289  // Helper methods
290 
291  std::string GetFilePath(const char *Name) const;
292  std::string GetProgramPath(const char *Name) const;
293 
294  /// Returns the linker path, respecting the -fuse-ld= argument to determine
295  /// the linker suffix or name.
296  std::string GetLinkerPath() const;
297 
298  /// Dispatch to the specific toolchain for verbose printing.
299  ///
300  /// This is used when handling the verbose option to print detailed,
301  /// toolchain-specific information useful for understanding the behavior of
302  /// the driver on a specific platform.
303  virtual void printVerboseInfo(raw_ostream &OS) const {}
304 
305  // Platform defaults information
306 
307  /// Returns true if the toolchain is targeting a non-native
308  /// architecture.
309  virtual bool isCrossCompiling() const;
310 
311  /// HasNativeLTOLinker - Check whether the linker and related tools have
312  /// native LLVM support.
313  virtual bool HasNativeLLVMSupport() const;
314 
315  /// LookupTypeForExtension - Return the default language type to use for the
316  /// given extension.
317  virtual types::ID LookupTypeForExtension(StringRef Ext) const;
318 
319  /// IsBlocksDefault - Does this tool chain enable -fblocks by default.
320  virtual bool IsBlocksDefault() const { return false; }
321 
322  /// IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as
323  /// by default.
324  virtual bool IsIntegratedAssemblerDefault() const { return false; }
325 
326  /// Check if the toolchain should use the integrated assembler.
327  virtual bool useIntegratedAs() const;
328 
329  /// IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
330  virtual bool IsMathErrnoDefault() const { return true; }
331 
332  /// IsEncodeExtendedBlockSignatureDefault - Does this tool chain enable
333  /// -fencode-extended-block-signature by default.
334  virtual bool IsEncodeExtendedBlockSignatureDefault() const { return false; }
335 
336  /// IsObjCNonFragileABIDefault - Does this tool chain set
337  /// -fobjc-nonfragile-abi by default.
338  virtual bool IsObjCNonFragileABIDefault() const { return false; }
339 
340  /// UseObjCMixedDispatchDefault - When using non-legacy dispatch, should the
341  /// mixed dispatch method be used?
342  virtual bool UseObjCMixedDispatch() const { return false; }
343 
344  /// Check whether to enable x86 relax relocations by default.
345  virtual bool useRelaxRelocations() const;
346 
347  /// GetDefaultStackProtectorLevel - Get the default stack protector level for
348  /// this tool chain (0=off, 1=on, 2=strong, 3=all).
349  virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const {
350  return 0;
351  }
352 
353  /// GetDefaultLinker - Get the default linker to use.
354  virtual const char *getDefaultLinker() const { return "ld"; }
355 
356  /// GetDefaultRuntimeLibType - Get the default runtime library variant to use.
358  return ToolChain::RLT_Libgcc;
359  }
360 
362  return ToolChain::CST_Libstdcxx;
363  }
364 
365  virtual std::string getCompilerRTPath() const;
366 
367  virtual std::string getCompilerRT(const llvm::opt::ArgList &Args,
368  StringRef Component,
369  bool Shared = false) const;
370 
371  const char *getCompilerRTArgString(const llvm::opt::ArgList &Args,
372  StringRef Component,
373  bool Shared = false) const;
374 
375  // Returns <ResourceDir>/lib/<OSName>/<arch>. This is used by runtimes (such
376  // as OpenMP) to find arch-specific libraries.
377  std::string getArchSpecificLibPath() const;
378 
379  // Returns <OSname> part of above.
380  StringRef getOSLibName() const;
381 
382  /// needsProfileRT - returns true if instrumentation profile is on.
383  static bool needsProfileRT(const llvm::opt::ArgList &Args);
384 
385  /// Returns true if gcov instrumentation (-fprofile-arcs or --coverage) is on.
386  static bool needsGCovInstrumentation(const llvm::opt::ArgList &Args);
387 
388  /// IsUnwindTablesDefault - Does this tool chain use -funwind-tables
389  /// by default.
390  virtual bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const;
391 
392  /// Test whether this toolchain defaults to PIC.
393  virtual bool isPICDefault() const = 0;
394 
395  /// Test whether this toolchain defaults to PIE.
396  virtual bool isPIEDefault() const = 0;
397 
398  /// Tests whether this toolchain forces its default for PIC, PIE or
399  /// non-PIC. If this returns true, any PIC related flags should be ignored
400  /// and instead the results of \c isPICDefault() and \c isPIEDefault() are
401  /// used exclusively.
402  virtual bool isPICDefaultForced() const = 0;
403 
404  /// SupportsProfiling - Does this tool chain support -pg.
405  virtual bool SupportsProfiling() const { return true; }
406 
407  /// Complain if this tool chain doesn't support Objective-C ARC.
408  virtual void CheckObjCARC() const {}
409 
410  /// Get the default debug info format. Typically, this is DWARF.
413  }
414 
415  /// UseDwarfDebugFlags - Embed the compile options to clang into the Dwarf
416  /// compile unit information.
417  virtual bool UseDwarfDebugFlags() const { return false; }
418 
419  // Return the DWARF version to emit, in the absence of arguments
420  // to the contrary.
421  virtual unsigned GetDefaultDwarfVersion() const { return 4; }
422 
423  // True if the driver should assume "-fstandalone-debug"
424  // in the absence of an option specifying otherwise,
425  // provided that debugging was requested in the first place.
426  // i.e. a value of 'true' does not imply that debugging is wanted.
427  virtual bool GetDefaultStandaloneDebug() const { return false; }
428 
429  // Return the default debugger "tuning."
430  virtual llvm::DebuggerKind getDefaultDebuggerTuning() const {
431  return llvm::DebuggerKind::GDB;
432  }
433 
434  /// Does this toolchain supports given debug info option or not.
435  virtual bool supportsDebugInfoOption(const llvm::opt::Arg *) const {
436  return true;
437  }
438 
439  /// Adjust debug information kind considering all passed options.
441  const llvm::opt::ArgList &Args) const {}
442 
443  /// GetExceptionModel - Return the tool chain exception model.
444  virtual llvm::ExceptionHandling
445  GetExceptionModel(const llvm::opt::ArgList &Args) const;
446 
447  /// SupportsEmbeddedBitcode - Does this tool chain support embedded bitcode.
448  virtual bool SupportsEmbeddedBitcode() const { return false; }
449 
450  /// getThreadModel() - Which thread model does this target use?
451  virtual std::string getThreadModel() const { return "posix"; }
452 
453  /// isThreadModelSupported() - Does this target support a thread model?
454  virtual bool isThreadModelSupported(const StringRef Model) const;
455 
456  /// ComputeLLVMTriple - Return the LLVM target triple to use, after taking
457  /// command line arguments into account.
458  virtual std::string
459  ComputeLLVMTriple(const llvm::opt::ArgList &Args,
460  types::ID InputType = types::TY_INVALID) const;
461 
462  /// ComputeEffectiveClangTriple - Return the Clang triple to use for this
463  /// target, which may take into account the command line arguments. For
464  /// example, on Darwin the -mmacosx-version-min= command line argument (which
465  /// sets the deployment target) determines the version in the triple passed to
466  /// Clang.
467  virtual std::string ComputeEffectiveClangTriple(
468  const llvm::opt::ArgList &Args,
469  types::ID InputType = types::TY_INVALID) const;
470 
471  /// getDefaultObjCRuntime - Return the default Objective-C runtime
472  /// for this platform.
473  ///
474  /// FIXME: this really belongs on some sort of DeploymentTarget abstraction
475  virtual ObjCRuntime getDefaultObjCRuntime(bool isNonFragile) const;
476 
477  /// hasBlocksRuntime - Given that the user is compiling with
478  /// -fblocks, does this tool chain guarantee the existence of a
479  /// blocks runtime?
480  ///
481  /// FIXME: this really belongs on some sort of DeploymentTarget abstraction
482  virtual bool hasBlocksRuntime() const { return true; }
483 
484  /// Add the clang cc1 arguments for system include paths.
485  ///
486  /// This routine is responsible for adding the necessary cc1 arguments to
487  /// include headers from standard system header directories.
488  virtual void
489  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
490  llvm::opt::ArgStringList &CC1Args) const;
491 
492  /// Add options that need to be passed to cc1 for this target.
493  virtual void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
494  llvm::opt::ArgStringList &CC1Args,
495  Action::OffloadKind DeviceOffloadKind) const;
496 
497  /// Add warning options that need to be passed to cc1 for this target.
498  virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const;
499 
500  // GetRuntimeLibType - Determine the runtime library type to use with the
501  // given compilation arguments.
502  virtual RuntimeLibType
503  GetRuntimeLibType(const llvm::opt::ArgList &Args) const;
504 
505  // GetCXXStdlibType - Determine the C++ standard library type to use with the
506  // given compilation arguments.
507  virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const;
508 
509  /// AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set
510  /// the include paths to use for the given C++ standard library type.
511  virtual void
512  AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
513  llvm::opt::ArgStringList &CC1Args) const;
514 
515  /// Returns if the C++ standard library should be linked in.
516  /// Note that e.g. -lm should still be linked even if this returns false.
517  bool ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const;
518 
519  /// AddCXXStdlibLibArgs - Add the system specific linker arguments to use
520  /// for the given C++ standard library type.
521  virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
522  llvm::opt::ArgStringList &CmdArgs) const;
523 
524  /// AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option.
525  void AddFilePathLibArgs(const llvm::opt::ArgList &Args,
526  llvm::opt::ArgStringList &CmdArgs) const;
527 
528  /// AddCCKextLibArgs - Add the system specific linker arguments to use
529  /// for kernel extensions (Darwin-specific).
530  virtual void AddCCKextLibArgs(const llvm::opt::ArgList &Args,
531  llvm::opt::ArgStringList &CmdArgs) const;
532 
533  /// AddFastMathRuntimeIfAvailable - If a runtime library exists that sets
534  /// global flags for unsafe floating point math, add it and return true.
535  ///
536  /// This checks for presence of the -Ofast, -ffast-math or -funsafe-math flags.
537  virtual bool AddFastMathRuntimeIfAvailable(
538  const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const;
539 
540  /// addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass
541  /// a suitable profile runtime library to the linker.
542  virtual void addProfileRTLibs(const llvm::opt::ArgList &Args,
543  llvm::opt::ArgStringList &CmdArgs) const;
544 
545  /// Add arguments to use system-specific CUDA includes.
546  virtual void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
547  llvm::opt::ArgStringList &CC1Args) const;
548 
549  /// Add arguments to use MCU GCC toolchain includes.
550  virtual void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs,
551  llvm::opt::ArgStringList &CC1Args) const;
552 
553  /// On Windows, returns the MSVC compatibility version.
554  virtual VersionTuple computeMSVCVersion(const Driver *D,
555  const llvm::opt::ArgList &Args) const;
556 
557  /// Return sanitizers which are available in this toolchain.
558  virtual SanitizerMask getSupportedSanitizers() const;
559 
560  /// Return sanitizers which are enabled by default.
561  virtual SanitizerMask getDefaultSanitizers() const { return 0; }
562 };
563 
564 /// Set a ToolChain's effective triple. Reset it when the registration object
565 /// is destroyed.
567  const ToolChain &TC;
568 
569 public:
570  RegisterEffectiveTriple(const ToolChain &TC, llvm::Triple T) : TC(TC) {
571  TC.setEffectiveTriple(std::move(T));
572  }
573 
574  ~RegisterEffectiveTriple() { TC.setEffectiveTriple(llvm::Triple()); }
575 };
576 
577 } // namespace driver
578 
579 } // namespace clang
580 
581 #endif // LLVM_CLANG_DRIVER_TOOLCHAIN_H
SmallVector< std::string, 16 > path_list
Definition: ToolChain.h:91
std::string ModeSuffix
Driver mode part of the executable name, as g++.
Definition: ToolChain.h:67
virtual const char * getDefaultLinker() const
GetDefaultLinker - Get the default linker to use.
Definition: ToolChain.h:354
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Definition: Dominators.h:30
const MultilibSet & getMultilibs() const
Definition: ToolChain.h:230
StringRef getArchName() const
Definition: ToolChain.h:203
Set a ToolChain&#39;s effective triple.
Definition: ToolChain.h:566
virtual bool SupportsProfiling() const
SupportsProfiling - Does this tool chain support -pg.
Definition: ToolChain.h:405
virtual bool UseDwarfDebugFlags() const
UseDwarfDebugFlags - Embed the compile options to clang into the Dwarf compile unit information...
Definition: ToolChain.h:417
virtual std::string getThreadModel() const
getThreadModel() - Which thread model does this target use?
Definition: ToolChain.h:451
StringRef getOS() const
Definition: ToolChain.h:205
virtual void printVerboseInfo(raw_ostream &OS) const
Dispatch to the specific toolchain for verbose printing.
Definition: ToolChain.h:303
RegisterEffectiveTriple(const ToolChain &TC, llvm::Triple T)
Definition: ToolChain.h:570
Defines the clang::SanitizerKind enum.
virtual bool hasBlocksRuntime() const
hasBlocksRuntime - Given that the user is compiling with -fblocks, does this tool chain guarantee the...
Definition: ToolChain.h:482
const Multilib & getMultilib() const
Definition: ToolChain.h:232
std::string TargetPrefix
Target part of the executable name, as i686-linux-android.
Definition: ToolChain.h:64
path_list & getProgramPaths()
Definition: ToolChain.h:227
virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const
GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain (0=off...
Definition: ToolChain.h:349
std::string getTripleString() const
Definition: ToolChain.h:211
virtual const llvm::Triple * getAuxTriple() const
Get the toolchain&#39;s aux triple, if it has one.
Definition: ToolChain.h:195
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
path_list & getFilePaths()
Definition: ToolChain.h:224
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:58
const llvm::opt::Arg * getRTTIArg() const
Definition: ToolChain.h:239
const path_list & getFilePaths() const
Definition: ToolChain.h:225
const path_list & getProgramPaths() const
Definition: ToolChain.h:228
StringRef getPlatform() const
Definition: ToolChain.h:204
virtual void adjustDebugInfoKind(codegenoptions::DebugInfoKind &DebugInfoKind, const llvm::opt::ArgList &Args) const
Adjust debug information kind considering all passed options.
Definition: ToolChain.h:440
virtual bool IsIntegratedAssemblerDefault() const
IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.
Definition: ToolChain.h:324
virtual bool SupportsEmbeddedBitcode() const
SupportsEmbeddedBitcode - Does this tool chain support embedded bitcode.
Definition: ToolChain.h:448
const llvm::Triple & getEffectiveTriple() const
Get the toolchain&#39;s effective clang triple.
Definition: ToolChain.h:216
virtual bool IsObjCNonFragileABIDefault() const
IsObjCNonFragileABIDefault - Does this tool chain set -fobjc-nonfragile-abi by default.
Definition: ToolChain.h:338
This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag...
Definition: Multilib.h:29
ParsedClangName(std::string Suffix, const char *Mode)
Definition: ToolChain.h:76
virtual bool supportsDebugInfoOption(const llvm::opt::Arg *) const
Does this toolchain supports given debug info option or not.
Definition: ToolChain.h:435
virtual CXXStdlibType GetDefaultCXXStdlibType() const
Definition: ToolChain.h:361
virtual bool IsMathErrnoDefault() const
IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
Definition: ToolChain.h:330
path_list & getLibraryPaths()
Definition: ToolChain.h:221
llvm::Triple::ArchType getArch() const
Definition: ToolChain.h:202
virtual bool UseObjCMixedDispatch() const
UseObjCMixedDispatchDefault - When using non-legacy dispatch, should the mixed dispatch method be use...
Definition: ToolChain.h:342
virtual bool IsEncodeExtendedBlockSignatureDefault() const
IsEncodeExtendedBlockSignatureDefault - Does this tool chain enable -fencode-extended-block-signature...
Definition: ToolChain.h:334
const Driver & getDriver() const
Definition: ToolChain.h:186
Helper structure used to pass information extracted from clang executable name such as i686-linux-and...
Definition: ToolChain.h:62
virtual SanitizerMask getDefaultSanitizers() const
Return sanitizers which are enabled by default.
Definition: ToolChain.h:561
Dataflow Directional Tag Classes.
virtual void CheckObjCARC() const
Complain if this tool chain doesn&#39;t support Objective-C ARC.
Definition: ToolChain.h:408
The basic abstraction for the target Objective-C runtime.
Definition: ObjCRuntime.h:28
virtual llvm::DebuggerKind getDefaultDebuggerTuning() const
Definition: ToolChain.h:430
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
virtual unsigned GetDefaultDwarfVersion() const
Definition: ToolChain.h:421
uint64_t SanitizerMask
Definition: Sanitizers.h:26
RTTIMode getRTTIMode() const
Definition: ToolChain.h:242
virtual codegenoptions::DebugInfoFormat getDefaultDebugFormat() const
Get the default debug info format. Typically, this is DWARF.
Definition: ToolChain.h:411
const llvm::Triple & getTriple() const
Definition: ToolChain.h:188
virtual bool GetDefaultStandaloneDebug() const
Definition: ToolChain.h:427
virtual llvm::opt::DerivedArgList * TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch, Action::OffloadKind DeviceOffloadKind) const
TranslateArgs - Create a new derived argument list for any argument translations this ToolChain may w...
Definition: ToolChain.h:271
const path_list & getLibraryPaths() const
Definition: ToolChain.h:222
ParsedClangName(std::string Target, std::string Suffix, const char *Mode, bool IsRegistered)
Definition: ToolChain.h:78
virtual bool IsBlocksDefault() const
IsBlocksDefault - Does this tool chain enable -fblocks by default.
Definition: ToolChain.h:320
virtual RuntimeLibType GetDefaultRuntimeLibType() const
GetDefaultRuntimeLibType - Get the default runtime library variant to use.
Definition: ToolChain.h:357
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:89