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