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