clang 8.0.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
clang::driver::ToolChain Class Referenceabstract

ToolChain - Access to tools for a single platform. More...

`#include "clang/Driver/ToolChain.h"`

Inheritance diagram for clang::driver::ToolChain:
[legend]
Collaboration diagram for clang::driver::ToolChain:
[legend]

## Public Types
enum | CXXStdlibType { CST_Libcxx, CST_Libstdcxx }
enum | RuntimeLibType { RLT_CompilerRT, RLT_Libgcc }
enum | RTTIMode { RM_Enabled, RM_Disabled }
using | path_list = SmallVector< std::string, 16 >

## Public Member Functions
virtual | ~ToolChain ()
const Driver & | getDriver () const
llvm::vfs::FileSystem & | getVFS () const
const llvm::Triple & | getTriple () const
virtual const llvm::Triple * | getAuxTriple () const
| Get the toolchain's aux triple, if it has one. More...
virtual std::string | getInputFilename (const InputInfo &Input) const
| Some toolchains need to modify the file name, for example to replace the extension for object files with .cubin for OpenMP offloading to Nvidia GPUs. More...
llvm::Triple::ArchType | getArch () const
StringRef | getArchName () const
StringRef | getPlatform () const
StringRef | getOS () const
StringRef | getDefaultUniversalArchName () const
| Provide the default architecture name (as expected by -arch) for this toolchain. More...
std::string | getTripleString () const
const llvm::Triple & | getEffectiveTriple () const
| Get the toolchain's effective clang triple. More...
path_list & | getLibraryPaths ()
const path_list & | getLibraryPaths () const
path_list & | getFilePaths ()
const path_list & | getFilePaths () const
path_list & | getProgramPaths ()
const path_list & | getProgramPaths () const
const MultilibSet & | getMultilibs () const
const Multilib & | getMultilib () const
const SanitizerArgs & | getSanitizerArgs () const
const XRayArgs & | getXRayArgs () const
const llvm::opt::Arg * | getRTTIArg () const
RTTIMode | getRTTIMode () const
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 wish to perform, or 0 if no tool chain specific translations are needed. More...
virtual llvm::opt::DerivedArgList * | TranslateOpenMPTargetArgs (const llvm::opt::DerivedArgList &Args, bool SameTripleAsHost, SmallVectorImpl< llvm::opt::Arg *> &AllocatedArgs) const
| TranslateOpenMPTargetArgs - Create a new derived argument list for that contains the OpenMP target specific flags passed via -Xopenmp-target -opt=val OR -Xopenmp-target=<triple> -opt=val. More...
virtual Tool * | SelectTool (const JobAction &JA) const
| Choose a tool to use to handle the action `JA`. More...
std::string | GetFilePath (const char *Name) const
std::string | GetProgramPath (const char *Name) const
std::string | GetLinkerPath () const
| Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name. More...
virtual void | printVerboseInfo (raw_ostream &OS) const
| Dispatch to the specific toolchain for verbose printing. More...
virtual bool | isCrossCompiling () const
| Returns true if the toolchain is targeting a non-native architecture. More...
virtual bool | HasNativeLLVMSupport () const
| HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support. More...
virtual types::ID | LookupTypeForExtension (StringRef Ext) const
| LookupTypeForExtension - Return the default language type to use for the given extension. More...
virtual bool | IsBlocksDefault () const
| IsBlocksDefault - Does this tool chain enable -fblocks by default. More...
virtual bool | IsIntegratedAssemblerDefault () const
| IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default. More...
virtual bool | useIntegratedAs () const
| Check if the toolchain should use the integrated assembler. More...
virtual bool | IsMathErrnoDefault () const
| IsMathErrnoDefault - Does this tool chain use -fmath-errno by default. More...
virtual bool | IsEncodeExtendedBlockSignatureDefault () const
| IsEncodeExtendedBlockSignatureDefault - Does this tool chain enable -fencode-extended-block-signature by default. More...
virtual bool | IsObjCNonFragileABIDefault () const
| IsObjCNonFragileABIDefault - Does this tool chain set -fobjc-nonfragile-abi by default. More...
virtual bool | UseObjCMixedDispatch () const
| UseObjCMixedDispatchDefault - When using non-legacy dispatch, should the mixed dispatch method be used? More...
virtual bool | useRelaxRelocations () const
| Check whether to enable x86 relax relocations by default. More...
virtual unsigned | GetDefaultStackProtectorLevel (bool KernelOrKext) const
| GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain (0=off, 1=on, 2=strong, 3=all). More...
virtual LangOptions::TrivialAutoVarInitKind | GetDefaultTrivialAutoVarInit () const
| Get the default trivial automatic variable initialization. More...
virtual const char * | getDefaultLinker () const
| GetDefaultLinker - Get the default linker to use. More...
virtual RuntimeLibType | GetDefaultRuntimeLibType () const
| GetDefaultRuntimeLibType - Get the default runtime library variant to use. More...
virtual CXXStdlibType | GetDefaultCXXStdlibType () const
virtual std::string | getCompilerRTPath () const
virtual std::string | getCompilerRT (const llvm::opt::ArgList &Args, StringRef Component, bool Shared=false) const
const char * | getCompilerRTArgString (const llvm::opt::ArgList &Args, StringRef Component, bool Shared=false) const
std::string | getArchSpecificLibPath () const
StringRef | getOSLibName () const
virtual bool | IsUnwindTablesDefault (const llvm::opt::ArgList &Args) const
| IsUnwindTablesDefault - Does this tool chain use -funwind-tables by default. More...
virtual bool | isPICDefault () const =0
| Test whether this toolchain defaults to PIC. More...
virtual bool | isPIEDefault () const =0
| Test whether this toolchain defaults to PIE. More...
virtual bool | isPICDefaultForced () const =0
| Tests whether this toolchain forces its default for PIC, PIE or non-PIC. More...
virtual bool | SupportsProfiling () const
| SupportsProfiling - Does this tool chain support -pg. More...
virtual void | CheckObjCARC () const
| Complain if this tool chain doesn't support Objective-C ARC. More...
virtual codegenoptions::DebugInfoFormat | getDefaultDebugFormat () const
| Get the default debug info format. Typically, this is DWARF. More...
virtual bool | UseDwarfDebugFlags () const
| UseDwarfDebugFlags - Embed the compile options to clang into the Dwarf compile unit information. More...
virtual unsigned | GetDefaultDwarfVersion () const
virtual bool | GetDefaultStandaloneDebug () const
virtual llvm::DebuggerKind | getDefaultDebuggerTuning () const
virtual bool | supportsDebugInfoOption (const llvm::opt::Arg *) const
| Does this toolchain supports given debug info option or not. More...
virtual void | adjustDebugInfoKind (codegenoptions::DebugInfoKind &DebugInfoKind, const llvm::opt::ArgList &Args) const
| Adjust debug information kind considering all passed options. More...
virtual llvm::ExceptionHandling | GetExceptionModel (const llvm::opt::ArgList &Args) const
| GetExceptionModel - Return the tool chain exception model. More...
virtual bool | SupportsEmbeddedBitcode () const
| SupportsEmbeddedBitcode - Does this tool chain support embedded bitcode. More...
virtual std::string | getThreadModel () const
| getThreadModel() - Which thread model does this target use? More...
virtual bool | isThreadModelSupported (const StringRef Model) const
| isThreadModelSupported() - Does this target support a thread model? More...
virtual std::string | ComputeLLVMTriple (const llvm::opt::ArgList &Args, types::ID InputType=types::TY_INVALID) const
| ComputeLLVMTriple - Return the LLVM target triple to use, after taking command line arguments into account. More...
virtual std::string | ComputeEffectiveClangTriple (const llvm::opt::ArgList &Args, types::ID InputType=types::TY_INVALID) const
| ComputeEffectiveClangTriple - Return the Clang triple to use for this target, which may take into account the command line arguments. More...
virtual ObjCRuntime | getDefaultObjCRuntime (bool isNonFragile) const
| getDefaultObjCRuntime - Return the default Objective-C runtime for this platform. More...
virtual bool | hasBlocksRuntime () const
| hasBlocksRuntime - Given that the user is compiling with -fblocks, does this tool chain guarantee the existence of a blocks runtime? More...
virtual void | AddClangSystemIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
| Add the clang cc1 arguments for system include paths. More...
virtual void | addClangTargetOptions (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const
| Add options that need to be passed to cc1 for this target. More...
virtual void | addClangWarningOptions (llvm::opt::ArgStringList &CC1Args) const
| Add warning options that need to be passed to cc1 for this target. More...
virtual RuntimeLibType | GetRuntimeLibType (const llvm::opt::ArgList &Args) const
virtual CXXStdlibType | GetCXXStdlibType (const llvm::opt::ArgList &Args) const
virtual void | AddClangCXXStdlibIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
| AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set the include paths to use for the given C++ standard library type. More...
bool | ShouldLinkCXXStdlib (const llvm::opt::ArgList &Args) const
| Returns if the C++ standard library should be linked in. More...
virtual void | AddCXXStdlibLibArgs (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
| AddCXXStdlibLibArgs - Add the system specific linker arguments to use for the given C++ standard library type. More...
void | AddFilePathLibArgs (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
| AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option. More...
virtual void | AddCCKextLibArgs (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
| AddCCKextLibArgs - Add the system specific linker arguments to use for kernel extensions (Darwin-specific). More...
virtual bool | AddFastMathRuntimeIfAvailable (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
| AddFastMathRuntimeIfAvailable - If a runtime library exists that sets global flags for unsafe floating point math, add it and return true. More...
virtual void | addProfileRTLibs (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
| addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass a suitable profile runtime library to the linker. More...
virtual void | AddCudaIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
| Add arguments to use system-specific CUDA includes. More...
virtual void | AddIAMCUIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
| Add arguments to use MCU GCC toolchain includes. More...
virtual VersionTuple | computeMSVCVersion (const Driver *D, const llvm::opt::ArgList &Args) const
| On Windows, returns the MSVC compatibility version. More...
virtual SanitizerMask | getSupportedSanitizers () const
| Return sanitizers which are available in this toolchain. More...
virtual SanitizerMask | getDefaultSanitizers () const
| Return sanitizers which are enabled by default. More...

## Static Public Member Functions
static ParsedClangName | getTargetAndModeFromProgramName (StringRef ProgName)
| Return any implicit target and/or mode flag for an invocation of the compiler driver as `ProgName`. More...
static bool | needsProfileRT (const llvm::opt::ArgList &Args)
| needsProfileRT - returns true if instrumentation profile is on. More...
static bool | needsGCovInstrumentation (const llvm::opt::ArgList &Args)
| Returns true if gcov instrumentation (-fprofile-arcs or –coverage) is on. More...

## Protected Member Functions
| ToolChain (const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args)
void | setTripleEnvironment (llvm::Triple::EnvironmentType Env)
virtual Tool * | buildAssembler () const
virtual Tool * | buildLinker () const
virtual Tool * | getTool (Action::ActionClass AC) const

## Static Protected Member Functions
Utilities for implementing subclasses.
static void | addSystemInclude (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
| Utility function to add a system include directory to CC1 arguments. More...
static void | addExternCSystemInclude (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
| Utility function to add a system include directory with extern "C" semantics to CC1 arguments. More...
static void | addExternCSystemIncludeIfExists (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
static void | addSystemIncludes (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, ArrayRef< StringRef > Paths)
| Utility function to add a list of system include directories to CC1. More...

## Protected Attributes
MultilibSet | Multilibs
Multilib | SelectedMultilib

## Friends
class | RegisterEffectiveTriple

## Detailed Description

ToolChain - Access to tools for a single platform.

Definition at line 89 of file ToolChain.h.

## Member Typedef Documentation

## ◆ path_list

using clang::driver::ToolChain::path_list = SmallVector<std::string, 16>

Definition at line 91 of file ToolChain.h.

## Member Enumeration Documentation

## ◆ CXXStdlibType

enum clang::driver::ToolChain::CXXStdlibType

Enumerator
CST_Libcxx |
CST_Libstdcxx |

Definition at line 93 of file ToolChain.h.

## ◆ RTTIMode

enum clang::driver::ToolChain::RTTIMode

Enumerator
RM_Enabled |
RM_Disabled |

Definition at line 103 of file ToolChain.h.

## ◆ RuntimeLibType

enum clang::driver::ToolChain::RuntimeLibType

Enumerator
RLT_CompilerRT |
RLT_Libgcc |

Definition at line 98 of file ToolChain.h.

## Constructor & Destructor Documentation

## ◆ ToolChain()

ToolChain::ToolChain | ( | const Driver & | D,
|  | const llvm::Triple & | T,
|  | const llvm::opt::ArgList & | Args
| ) |  |
| protected

Definition at line 73 of file ToolChain.cpp.

References getArchSpecificLibPath(), getFilePaths(), getLibraryPaths(), clang::driver::Driver::getTargetTriple(), getVFS(), P, and clang::driver::Driver::ResourceDir.

## ◆ ~ToolChain()

ToolChain::~ToolChain | ( |  | ) |
| virtual default

Referenced by setTripleEnvironment().

## Member Function Documentation

## ◆ AddCCKextLibArgs()

void ToolChain::AddCCKextLibArgs | ( | const llvm::opt::ArgList & | Args,
|  | llvm::opt::ArgStringList & | CmdArgs
| ) |  | const
| virtual

AddCCKextLibArgs - Add the system specific linker arguments to use for kernel extensions (Darwin-specific).

Reimplemented in clang::driver::toolchains::DarwinClang.

Definition at line 789 of file ToolChain.cpp.

## ◆ AddClangCXXStdlibIncludeArgs()

void ToolChain::AddClangCXXStdlibIncludeArgs | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args
| ) |  | const
| virtual

AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set the include paths to use for the given C++ standard library type.

Reimplemented in clang::driver::toolchains::DarwinClang, clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::MinGW, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::CrossWindowsToolChain, and clang::driver::toolchains::BareMetal.

Definition at line 741 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::HIPToolChain::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::CudaToolChain::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::DarwinClang::AddClangCXXStdlibIncludeArgs(), and RelocationModelName().

## ◆ AddClangSystemIncludeArgs()

void ToolChain::AddClangSystemIncludeArgs | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args
| ) |  | const
| virtual

Add the clang cc1 arguments for system include paths.

This routine is responsible for adding the necessary cc1 arguments to include headers from standard system header directories.

Reimplemented in clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::MyriadToolChain, clang::driver::toolchains::MinGW, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::Solaris, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::BareMetal, clang::driver::toolchains::MSP430ToolChain, clang::driver::toolchains::RISCVToolChain, clang::driver::toolchains::MipsLLVMToolChain, clang::driver::toolchains::Hurd, and clang::driver::toolchains::Linux.

Definition at line 646 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::HIPToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::CudaToolChain::AddClangSystemIncludeArgs(), and RelocationModelName().

## ◆ addClangTargetOptions()

void ToolChain::addClangTargetOptions | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args,
|  | Action::OffloadKind | DeviceOffloadKind
| ) |  | const
| virtual

Add options that need to be passed to cc1 for this target.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::Generic_ELF, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::NetBSD, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::AMDGPUToolChain, clang::driver::toolchains::BareMetal, clang::driver::toolchains::MSP430ToolChain, and clang::driver::toolchains::RISCVToolChain.

Definition at line 651 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::HIPToolChain::addClangTargetOptions(), and clang::driver::toolchains::CudaToolChain::addClangTargetOptions().

## ◆ addClangWarningOptions()

void ToolChain::addClangWarningOptions | ( | llvm::opt::ArgStringList & | CC1Args | ) | const
| virtual

Add warning options that need to be passed to cc1 for this target.

Reimplemented in clang::driver::toolchains::DarwinClang, clang::driver::toolchains::CudaToolChain, and clang::driver::toolchains::HIPToolChain.

Definition at line 655 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::HIPToolChain::addClangWarningOptions(), and clang::driver::toolchains::CudaToolChain::addClangWarningOptions().

## ◆ AddCudaIncludeArgs()

void ToolChain::AddCudaIncludeArgs | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args
| ) |  | const
| virtual

Add arguments to use system-specific CUDA includes.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::MinGW, and clang::driver::toolchains::Linux.

Definition at line 840 of file ToolChain.cpp.

## ◆ AddCXXStdlibLibArgs()

void ToolChain::AddCXXStdlibLibArgs | ( | const llvm::opt::ArgList & | Args,
|  | llvm::opt::ArgStringList & | CmdArgs
| ) |  | const
| virtual

AddCXXStdlibLibArgs - Add the system specific linker arguments to use for the given C++ standard library type.

Reimplemented in clang::driver::toolchains::DarwinClang, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::BareMetal, clang::driver::toolchains::CloudABI, and clang::driver::toolchains::MipsLLVMToolChain.

Definition at line 761 of file ToolChain.cpp.

References CST_Libcxx, CST_Libstdcxx, and GetCXXStdlibType().

Referenced by collectSanitizerRuntimes(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::ananas::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::RISCV::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().

## ◆ addExternCSystemInclude()

void ToolChain::addExternCSystemInclude | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args,
|  | const Twine & | Path
| ) |  |
| static protected

Utility function to add a system include directory with extern "C" semantics to CC1 arguments.

Note that this should be used rarely, and only for directories that historically and for legacy reasons are treated as having implicit extern "C" semantics. These semantics are ignored by and large today, but its important to preserve the preprocessor changes resulting from the classification.

Definition at line 717 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::Linux::AddClangSystemIncludeArgs(), clang::driver::toolchains::Solaris::AddClangSystemIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HexagonToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangSystemIncludeArgs(), and addExternCSystemIncludeIfExists().

## ◆ addExternCSystemIncludeIfExists()

void ToolChain::addExternCSystemIncludeIfExists | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args,
|  | const Twine & | Path
| ) |  |
| static protected

Definition at line 724 of file ToolChain.cpp.

References addExternCSystemInclude().

## ◆ AddFastMathRuntimeIfAvailable()

bool ToolChain::AddFastMathRuntimeIfAvailable | ( | const llvm::opt::ArgList & | Args,
|  | llvm::opt::ArgStringList & | CmdArgs
| ) |  | const
| virtual

AddFastMathRuntimeIfAvailable - If a runtime library exists that sets global flags for unsafe floating point math, add it and return true.

This checks for presence of the -Ofast, -ffast-math or -funsafe-math flags.

Definition at line 794 of file ToolChain.cpp.

References GetFilePath(), and clang::driver::isOptimizationLevelFast().

Referenced by clang::driver::tools::MinGW::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().

## ◆ AddFilePathLibArgs()

void ToolChain::AddFilePathLibArgs | ( | const llvm::opt::ArgList & | Args,
|  | llvm::opt::ArgStringList & | CmdArgs
| ) |  | const

AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option.

Definition at line 778 of file ToolChain.cpp.

References getFilePaths(), and getLibraryPaths().

Referenced by ConstructGoldLinkJob(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::ananas::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::RISCV::Linker::ConstructJob(), clang::driver::tools::msp430::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().

## ◆ AddIAMCUIncludeArgs()

void ToolChain::AddIAMCUIncludeArgs | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args
| ) |  | const
| virtual

Add arguments to use MCU GCC toolchain includes.

Reimplemented in clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, and clang::driver::toolchains::Linux.

Definition at line 843 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::HIPToolChain::AddIAMCUIncludeArgs(), and clang::driver::toolchains::CudaToolChain::AddIAMCUIncludeArgs().

## ◆ addProfileRTLibs()

void ToolChain::addProfileRTLibs | ( | const llvm::opt::ArgList & | Args,
|  | llvm::opt::ArgStringList & | CmdArgs
| ) |  | const
| virtual

addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass a suitable profile runtime library to the linker.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::MachO, and clang::driver::toolchains::Linux.

Definition at line 657 of file ToolChain.cpp.

References getCompilerRTArgString(), and needsProfileRT().

Referenced by clang::driver::toolchains::Linux::addProfileRTLibs(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), and clang::driver::tools::freebsd::Linker::ConstructJob().

## ◆ addSystemInclude()

void ToolChain::addSystemInclude | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args,
|  | const Twine & | Path
| ) |  |
| static protected

Utility function to add a system include directory to CC1 arguments.

Definition at line 702 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::BareMetal::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::MinGW::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::DarwinClang::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::Linux::AddClangSystemIncludeArgs(), clang::driver::toolchains::MipsLLVMToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::RISCVToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::MSP430ToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::BareMetal::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Solaris::AddClangSystemIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::MinGW::AddClangSystemIncludeArgs(), clang::driver::toolchains::MyriadToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangSystemIncludeArgs(), clang::driver::toolchains::MSVCToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Haiku::addLibCxxIncludePaths(), clang::driver::toolchains::Linux::addLibCxxIncludePaths(), clang::driver::toolchains::CloudABI::addLibCxxIncludePaths(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::NetBSD::addLibCxxIncludePaths(), clang::driver::toolchains::MyriadToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibStdCXXIncludePaths(), and clang::driver::toolchains::MSVCToolChain::AddSystemIncludeWithSubfolder().

## ◆ addSystemIncludes()

void ToolChain::addSystemIncludes | ( | const llvm::opt::ArgList & | DriverArgs,
|  | llvm::opt::ArgStringList & | CC1Args,
|  | ArrayRef< StringRef > | Paths
| ) |  |
| static protected

Utility function to add a list of system include directories to CC1.

Definition at line 732 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::XCoreToolChain::AddClangCXXStdlibIncludeArgs(), and clang::driver::toolchains::XCoreToolChain::AddClangSystemIncludeArgs().

## ◆ adjustDebugInfoKind()

virtual void clang::driver::ToolChain::adjustDebugInfoKind | ( | codegenoptions::DebugInfoKind & | DebugInfoKind,
|  | const llvm::opt::ArgList & | Args
| ) |  | const
| inline virtual

Adjust debug information kind considering all passed options.

Reimplemented in clang::driver::toolchains::CudaToolChain.

Definition at line 446 of file ToolChain.h.

Referenced by RenderDebugOptions().

## ◆ buildAssembler()

Tool * ToolChain::buildAssembler | ( |  | ) | const
| protected virtual

Reimplemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::MachO, clang::driver::toolchains::MinGW, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::NetBSD, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::Solaris, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::DragonFly, clang::driver::toolchains::Ananas, clang::driver::toolchains::Minix, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::Linux, and clang::driver::toolchains::Hurd.

Definition at line 257 of file ToolChain.cpp.

Referenced by buildLinker().

## ◆ buildLinker()

Tool * ToolChain::buildLinker | ( |  | ) | const
| protected virtual

Reimplemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::MachO, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::MyriadToolChain, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::MinGW, clang::driver::toolchains::NetBSD, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::Solaris, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::CloudABI, clang::driver::toolchains::DragonFly, clang::driver::toolchains::Ananas, clang::driver::toolchains::Minix, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::Linux, clang::driver::toolchains::AMDGPUToolChain, clang::driver::toolchains::MSP430ToolChain, clang::driver::toolchains::Hurd, clang::driver::toolchains::RISCVToolChain, clang::driver::toolchains::BareMetal, clang::driver::toolchains::AVRToolChain, and clang::driver::toolchains::MipsLLVMToolChain.

Definition at line 261 of file ToolChain.cpp.

References buildAssembler().

## ◆ CheckObjCARC()

virtual void clang::driver::ToolChain::CheckObjCARC | ( |  | ) | const
| inline virtual

Complain if this tool chain doesn't support Objective-C ARC.

Reimplemented in clang::driver::toolchains::Darwin.

Definition at line 414 of file ToolChain.h.

Referenced by RenderObjCOptions().

## ◆ ComputeEffectiveClangTriple()

std::string ToolChain::ComputeEffectiveClangTriple | ( | const llvm::opt::ArgList & | Args,
|  | types::ID | InputType = `types::TY_INVALID`
| ) |  | const
| virtual

ComputeEffectiveClangTriple - Return the Clang triple to use for this target, which may take into account the command line arguments.

For example, on Darwin the -mmacosx-version-min= command line argument (which sets the deployment target) determines the version in the triple passed to Clang.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::NaClToolChain, and clang::driver::toolchains::Fuchsia.

Definition at line 641 of file ToolChain.cpp.

References ComputeLLVMTriple().

Referenced by clang::driver::Driver::BuildJobsForAction(), clang::driver::toolchains::MSVCToolChain::ComputeEffectiveClangTriple(), and clang::driver::Driver::HandleImmediateArgs().

## ◆ ComputeLLVMTriple()

std::string ToolChain::ComputeLLVMTriple | ( | const llvm::opt::ArgList & | Args,
|  | types::ID | InputType = `types::TY_INVALID`
| ) |  | const
| virtual

ComputeLLVMTriple - Return the LLVM target triple to use, after taking command line arguments into account.

Definition at line 520 of file ToolChain.cpp.

References clang::driver::Driver::Diag(), getArch(), clang::driver::tools::arm::getARMArch(), clang::driver::tools::arm::getARMCPUForMArch(), clang::driver::tools::arm::getARMTargetCPU(), getDriver(), clang::driver::tools::arm::getLLVMArchSuffixForARM(), getTriple(), and getTripleString().

Referenced by clang::driver::toolchains::Fuchsia::ComputeEffectiveClangTriple(), clang::driver::toolchains::NaClToolChain::ComputeEffectiveClangTriple(), clang::driver::toolchains::Darwin::ComputeEffectiveClangTriple(), ComputeEffectiveClangTriple(), and clang::driver::toolchains::Darwin::GetExceptionModel().

## ◆ computeMSVCVersion()

VersionTuple ToolChain::computeMSVCVersion | ( | const Driver * | D,
|  | const llvm::opt::ArgList & | Args
| ) |  | const
| virtual

On Windows, returns the MSVC compatibility version.

Reimplemented in clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::MSVCToolChain, and clang::driver::toolchains::HIPToolChain.

Definition at line 860 of file ToolChain.cpp.

References clang::driver::Driver::Diag(), and separateMSVCFullVersion().

Referenced by clang::driver::toolchains::HIPToolChain::computeMSVCVersion(), clang::driver::toolchains::MSVCToolChain::computeMSVCVersion(), and clang::driver::toolchains::CudaToolChain::computeMSVCVersion().

## ◆ getArch()

llvm::Triple::ArchType clang::driver::ToolChain::getArch | ( |  | ) | const
| inline

Definition at line 202 of file ToolChain.h.

Referenced by clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::DarwinClang::AddLinkARCArgs(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), clang::driver::toolchains::Darwin::addStartObjectFileArgs(), clang::driver::toolchains::NaClToolChain::buildAssembler(), clang::driver::toolchains::HIPToolChain::buildLinker(), CollectArgsForIntegratedAssembler(), ComputeLLVMTriple(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), getArchNameForCompilerRTLib(), getArchSpecificLibPath(), clang::driver::toolchains::NetBSD::GetDefaultCXXStdlibType(), clang::driver::toolchains::Hurd::getDynamicLinker(), clang::driver::toolchains::Linux::getDynamicLinker(), clang::driver::toolchains::FreeBSD::GetExceptionModel(), clang::driver::toolchains::MinGW::GetExceptionModel(), clang::driver::toolchains::Darwin::GetExceptionModel(), clang::driver::toolchains::MachO::getMachOArchName(), clang::driver::toolchains::MSVCToolChain::getUniversalCRTLibraryPath(), clang::driver::toolchains::MSVCToolChain::getWindowsSDKLibraryPath(), isCrossCompiling(), clang::driver::toolchains::Generic_GCC::IsIntegratedAssemblerDefault(), isNoCommonDefault(), clang::driver::toolchains::CrossWindowsToolChain::isPICDefault(), clang::driver::toolchains::MinGW::isPICDefault(), clang::driver::toolchains::MSVCToolChain::isPICDefault(), clang::driver::toolchains::Generic_GCC::isPICDefault(), clang::driver::toolchains::CrossWindowsToolChain::isPICDefaultForced(), clang::driver::toolchains::MinGW::isPICDefaultForced(), clang::driver::toolchains::MSVCToolChain::isPICDefaultForced(), clang::driver::toolchains::MachO::isPICDefaultForced(), clang::driver::toolchains::Generic_GCC::isPICDefaultForced(), clang::driver::toolchains::CloudABI::isPIEDefault(), clang::driver::toolchains::CrossWindowsToolChain::isPIEDefault(), clang::driver::toolchains::CrossWindowsToolChain::IsUnwindTablesDefault(), clang::driver::toolchains::MinGW::IsUnwindTablesDefault(), clang::driver::toolchains::MSVCToolChain::IsUnwindTablesDefault(), clang::driver::toolchains::MachO::IsUnwindTablesDefault(), clang::driver::toolchains::Generic_GCC::IsUnwindTablesDefault(), parseClangCLEHFlags(), RenderBuiltinOptions(), RenderObjCOptions(), clang::driver::toolchains::MachO::SupportsProfiling(), clang::driver::toolchains::MSVCToolChain::TranslateArgs(), and clang::driver::toolchains::MachO::TranslateArgs().

## ◆ getArchName()

StringRef clang::driver::ToolChain::getArchName | ( |  | ) | const
| inline

Definition at line 203 of file ToolChain.h.

Referenced by clang::driver::toolchains::BareMetal::AddLinkRuntimeLib(), clang::driver::Driver::BuildJobsForAction(), and clang::driver::tools::nacltools::Linker::ConstructJob().

## ◆ getArchSpecificLibPath()

std::string ToolChain::getArchSpecificLibPath | ( |  | ) | const

Definition at line 398 of file ToolChain.cpp.

References getArch(), getDriver(), and getOSLibName().

Referenced by clang::driver::tools::isUseSeparateSections(), and ToolChain().

## ◆ getAuxTriple()

virtual const llvm::Triple* clang::driver::ToolChain::getAuxTriple | ( |  | ) | const
| inline virtual

Get the toolchain's aux triple, if it has one.

Exactly what the aux triple represents depends on the toolchain, but for example when compiling CUDA code for the GPU, the triple might be NVPTX, while the aux triple is the host (CPU) toolchain, e.g. x86-linux-gnu.

Reimplemented in clang::driver::toolchains::CudaToolChain, and clang::driver::toolchains::HIPToolChain.

Definition at line 195 of file ToolChain.h.

## ◆ getCompilerRT()

std::string ToolChain::getCompilerRT | ( | const llvm::opt::ArgList & | Args,
|  | StringRef | Component,
|  | bool | Shared = `false`
| ) |  | const
| virtual

Reimplemented in clang::driver::toolchains::MipsLLVMToolChain.

Definition at line 365 of file ToolChain.cpp.

References getArchNameForCompilerRTLib(), getCompilerRTPath(), getLibraryPaths(), getTriple(), getVFS(), and P.

Referenced by clang::driver::SanitizerArgs::addArgs(), addSanitizerDynamicList(), clang::driver::tools::MinGW::Linker::ConstructJob(), getCompilerRTArgString(), and clang::driver::Driver::HandleImmediateArgs().

## ◆ getCompilerRTArgString()

const char * ToolChain::getCompilerRTArgString | ( | const llvm::opt::ArgList & | Args,
|  | StringRef | Component,
|  | bool | Shared = `false`
| ) |  | const

Definition at line 392 of file ToolChain.cpp.

References getCompilerRT().

Referenced by AddLibgcc(), addProfileRTLibs(), addSanitizerRuntime(), clang::driver::tools::openbsd::Linker::ConstructJob(), and clang::driver::tools::MinGW::Linker::ConstructJob().

## ◆ getCompilerRTPath()

std::string ToolChain::getCompilerRTPath | ( |  | ) | const
| virtual

Definition at line 355 of file ToolChain.cpp.

References getDriver(), and getOSLibName().

Referenced by clang::driver::tools::netbsd::Linker::ConstructJob(), getCompilerRT(), and clang::driver::Driver::GetFilePath().

## ◆ GetCXXStdlibType()

ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType | ( | const llvm::opt::ArgList & | Args | ) | const
| virtual

Reimplemented in clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::CloudABI, and clang::driver::toolchains::MipsLLVMToolChain.

Definition at line 683 of file ToolChain.cpp.

References CST_Libcxx, CST_Libstdcxx, clang::driver::Driver::Diag(), GetDefaultCXXStdlibType(), and getDriver().

Referenced by clang::driver::toolchains::BareMetal::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::MinGW::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::Generic_GCC::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::DarwinClang::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::BareMetal::AddCXXStdlibLibArgs(), clang::driver::toolchains::FreeBSD::AddCXXStdlibLibArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddCXXStdlibLibArgs(), clang::driver::toolchains::DarwinClang::AddCXXStdlibLibArgs(), AddCXXStdlibLibArgs(), clang::driver::toolchains::HIPToolChain::GetCXXStdlibType(), clang::driver::toolchains::CudaToolChain::GetCXXStdlibType(), RenderObjCOptions(), and clang::driver::toolchains::Darwin::TranslateArgs().

## ◆ GetDefaultCXXStdlibType()

virtual CXXStdlibType clang::driver::ToolChain::GetDefaultCXXStdlibType | ( |  | ) | const
| inline virtual

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::NetBSD, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::BareMetal, and clang::driver::toolchains::Linux.

Definition at line 367 of file ToolChain.h.

Referenced by GetCXXStdlibType().

## ◆ getDefaultDebugFormat()

virtual codegenoptions::DebugInfoFormat clang::driver::ToolChain::getDefaultDebugFormat | ( |  | ) | const
| inline virtual

Get the default debug info format. Typically, this is DWARF.

Reimplemented in clang::driver::toolchains::MSVCToolChain.

Definition at line 417 of file ToolChain.h.

References clang::codegenoptions::DIF_DWARF.

Referenced by RenderDebugOptions().

## ◆ getDefaultDebuggerTuning()

virtual llvm::DebuggerKind clang::driver::ToolChain::getDefaultDebuggerTuning | ( |  | ) | const
| inline virtual

Reimplemented in clang::driver::toolchains::DarwinClang, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::PS4CPU, and clang::driver::toolchains::Fuchsia.

Definition at line 436 of file ToolChain.h.

Referenced by RenderDebugOptions().

## ◆ GetDefaultDwarfVersion()

virtual unsigned clang::driver::ToolChain::GetDefaultDwarfVersion | ( |  | ) | const
| inline virtual

Reimplemented in clang::driver::toolchains::DarwinClang, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::MyriadToolChain, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::Solaris, and clang::driver::toolchains::AMDGPUToolChain.

Definition at line 427 of file ToolChain.h.

Referenced by clang::driver::tools::ClangAs::ConstructJob(), and RenderDebugOptions().

## ◆ getDefaultLinker()

virtual const char* clang::driver::ToolChain::getDefaultLinker | ( |  | ) | const
| inline virtual

GetDefaultLinker - Get the default linker to use.

Reimplemented in clang::driver::toolchains::Fuchsia, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::MipsLLVMToolChain, and clang::driver::toolchains::BareMetal.

Definition at line 360 of file ToolChain.h.

Referenced by GetLinkerPath().

## ◆ getDefaultObjCRuntime()

ObjCRuntime ToolChain::getDefaultObjCRuntime | ( | bool | isNonFragile | ) | const
| virtual

getDefaultObjCRuntime - Return the default Objective-C runtime for this platform.

FIXME: this really belongs on some sort of DeploymentTarget abstraction

Reimplemented in clang::driver::toolchains::Darwin.

Definition at line 495 of file ToolChain.cpp.

References clang::ObjCRuntime::GCC, and clang::ObjCRuntime::GNUstep.

Referenced by clang::driver::tools::Clang::~Clang().

## ◆ GetDefaultRuntimeLibType()

virtual RuntimeLibType clang::driver::ToolChain::GetDefaultRuntimeLibType | ( |  | ) | const
| inline virtual

GetDefaultRuntimeLibType - Get the default runtime library variant to use.

Reimplemented in clang::driver::toolchains::MachO, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::MipsLLVMToolChain, and clang::driver::toolchains::BareMetal.

Definition at line 363 of file ToolChain.h.

Referenced by GetRuntimeLibType().

## ◆ getDefaultSanitizers()

virtual SanitizerMask clang::driver::ToolChain::getDefaultSanitizers | ( |  | ) | const
| inline virtual

Return sanitizers which are enabled by default.

Reimplemented in clang::driver::toolchains::Fuchsia, and clang::driver::toolchains::CloudABI.

Definition at line 567 of file ToolChain.h.

Referenced by clang::driver::SanitizerArgs::SanitizerArgs().

## ◆ GetDefaultStackProtectorLevel()

virtual unsigned clang::driver::ToolChain::GetDefaultStackProtectorLevel | ( | bool | KernelOrKext | ) | const
| inline virtual

GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain (0=off, 1=on, 2=strong, 3=all).

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::CrossWindowsToolChain, and clang::driver::toolchains::Fuchsia.

Definition at line 349 of file ToolChain.h.

Referenced by RenderSSPOptions().

## ◆ GetDefaultStandaloneDebug()

virtual bool clang::driver::ToolChain::GetDefaultStandaloneDebug | ( |  | ) | const
| inline virtual

Reimplemented in clang::driver::toolchains::DarwinClang, and clang::driver::toolchains::FreeBSD.

Definition at line 433 of file ToolChain.h.

Referenced by RenderDebugOptions().

## ◆ GetDefaultTrivialAutoVarInit()

virtual LangOptions::TrivialAutoVarInitKind clang::driver::ToolChain::GetDefaultTrivialAutoVarInit | ( |  | ) | const
| inline virtual

Get the default trivial automatic variable initialization.

Definition at line 355 of file ToolChain.h.

References Uninitialized.

Referenced by RenderTrivialAutoVarInitOptions().

## ◆ getDefaultUniversalArchName()

StringRef ToolChain::getDefaultUniversalArchName | ( |  | ) | const

Provide the default architecture name (as expected by -arch) for this toolchain.

Definition at line 226 of file ToolChain.cpp.

Referenced by clang::driver::Driver::BuildUniversalActions(), and clang::driver::toolchains::MachO::getMachOArchName().

## ◆ getDriver()

const Driver& clang::driver::ToolChain::getDriver | ( |  | ) | const
| inline

Definition at line 186 of file ToolChain.h.

Referenced by clang::driver::SanitizerArgs::addArgs(), clang::driver::toolchains::DarwinClang::AddCCKextLibArgs(), clang::driver::toolchains::BareMetal::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::DarwinClang::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::Linux::AddClangSystemIncludeArgs(), clang::driver::toolchains::MipsLLVMToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::BareMetal::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Solaris::AddClangSystemIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::MinGW::AddClangSystemIncludeArgs(), clang::driver::toolchains::MyriadToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HexagonToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangSystemIncludeArgs(), clang::driver::toolchains::MSVCToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::CudaToolChain::addClangTargetOptions(), clang::driver::toolchains::Haiku::addLibCxxIncludePaths(), clang::driver::toolchains::Linux::addLibCxxIncludePaths(), clang::driver::toolchains::CloudABI::addLibCxxIncludePaths(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::NetBSD::addLibCxxIncludePaths(), clang::driver::toolchains::MyriadToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibCxxIncludePaths(), AddLibgcc(), clang::driver::toolchains::Haiku::addLibStdCxxIncludePaths(), clang::driver::toolchains::Linux::addLibStdCxxIncludePaths(), clang::driver::toolchains::RISCVToolChain::addLibStdCxxIncludePaths(), clang::driver::toolchains::FreeBSD::addLibStdCxxIncludePaths(), clang::driver::toolchains::NetBSD::addLibStdCxxIncludePaths(), clang::driver::toolchains::HexagonToolChain::addLibStdCxxIncludePaths(), clang::driver::toolchains::DarwinClang::AddLinkARCArgs(), clang::driver::toolchains::MachO::AddLinkRuntimeLib(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), clang::driver::tools::ClangAs::AddX86TargetArgs(), clang::driver::toolchains::Ananas::Ananas(), clang::driver::toolchains::BareMetal::BareMetal(), clang::driver::toolchains::MSVCToolChain::buildAssembler(), clang::driver::toolchains::Darwin::CheckObjCARC(), clang::driver::toolchains::CloudABI::CloudABI(), ComputeLLVMTriple(), clang::driver::toolchains::Hurd::computeSysRoot(), clang::driver::toolchains::MipsLLVMToolChain::computeSysRoot(), clang::driver::toolchains::Linux::computeSysRoot(), ConstructGoldLinkJob(), constructHexagonLinkArgs(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::ananas::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::PS4cpu::Link::ConstructJob(), clang::driver::tools::RISCV::Linker::ConstructJob(), clang::driver::tools::msp430::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), ConstructPS4LinkJob(), clang::driver::toolchains::CudaToolChain::CudaToolChain(), clang::driver::toolchains::DragonFly::DragonFly(), clang::driver::FallbackCommand::Execute(), clang::driver::toolchains::FreeBSD::FreeBSD(), clang::driver::toolchains::Fuchsia::Fuchsia(), clang::driver::toolchains::Generic_GCC::Generic_GCC(), getArchSpecificLibPath(), clang::driver::toolchains::MipsLLVMToolChain::getCompilerRT(), getCompilerRTPath(), clang::driver::toolchains::MipsLLVMToolChain::GetCXXStdlibType(), clang::driver::toolchains::NaClToolChain::GetCXXStdlibType(), clang::driver::toolchains::Fuchsia::GetCXXStdlibType(), clang::driver::toolchains::HexagonToolChain::GetCXXStdlibType(), GetCXXStdlibType(), clang::driver::toolchains::Linux::getDynamicLinker(), GetLinkerPath(), clang::driver::toolchains::Fuchsia::GetRuntimeLibType(), clang::driver::toolchains::DarwinClang::GetRuntimeLibType(), GetRuntimeLibType(), clang::driver::toolchains::BareMetal::getRuntimesDir(), getTargetFeatures(), getVFS(), clang::driver::toolchains::HIPToolChain::HIPToolChain(), clang::driver::tools::isUseSeparateSections(), clang::driver::toolchains::MachO::MachO(), clang::driver::toolchains::MinGW::MinGW(), clang::driver::toolchains::Minix::Minix(), clang::driver::toolchains::MSP430ToolChain::MSP430ToolChain(), clang::driver::toolchains::MSVCToolChain::MSVCToolChain(), clang::driver::toolchains::NaClToolChain::NaClToolChain(), clang::driver::toolchains::OpenBSD::OpenBSD(), parseClangCLEHFlags(), clang::driver::toolchains::PS4CPU::PS4CPU(), clang::driver::SanitizerArgs::SanitizerArgs(), SelectTool(), ShouldLinkCXXStdlib(), clang::driver::toolchains::TCEToolChain::TCEToolChain(), clang::driver::toolchains::AMDGPUToolChain::TranslateArgs(), clang::driver::toolchains::MSVCToolChain::TranslateArgs(), clang::driver::toolchains::HIPToolChain::TranslateArgs(), clang::driver::toolchains::CudaToolChain::TranslateArgs(), clang::driver::toolchains::MachO::TranslateArgs(), clang::driver::toolchains::Generic_GCC::TranslateArgs(), clang::driver::toolchains::Darwin::TranslateArgs(), TranslateOpenMPTargetArgs(), clang::driver::tools::arm::useAAPCSForMachO(), clang::driver::XRayArgs::XRayArgs(), and clang::driver::tools::Clang::~Clang().

## ◆ getEffectiveTriple()

const llvm::Triple& clang::driver::ToolChain::getEffectiveTriple | ( |  | ) | const
| inline

Get the toolchain's effective clang triple.

Definition at line 216 of file ToolChain.h.

Referenced by clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::isUseSeparateSections(), RenderSSPOptions(), and clang::driver::tools::arm::useAAPCSForMachO().

## ◆ GetExceptionModel()

llvm::ExceptionHandling ToolChain::GetExceptionModel | ( | const llvm::opt::ArgList & | Args | ) | const
| virtual

GetExceptionModel - Return the tool chain exception model.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::MachO, clang::driver::toolchains::NetBSD, clang::driver::toolchains::MinGW, and clang::driver::toolchains::FreeBSD.

Definition at line 501 of file ToolChain.cpp.

References clang::XRayInstrKind::None.

## ◆ GetFilePath()

std::string ToolChain::GetFilePath | ( | const char * | Name | ) | const

Definition at line 431 of file ToolChain.cpp.

Referenced by AddFastMathRuntimeIfAvailable(), clang::driver::toolchains::Darwin::addStartObjectFileArgs(), ConstructGoldLinkJob(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::ananas::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::RISCV::Linker::ConstructJob(), clang::driver::tools::msp430::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), and clang::driver::toolchains::NaClToolChain::NaClToolChain().

## ◆ getFilePaths() [1/2]

path_list& clang::driver::ToolChain::getFilePaths | ( |  | ) |
| inline

Definition at line 224 of file ToolChain.h.

Referenced by AddFilePathLibArgs(), clang::driver::toolchains::Ananas::Ananas(), clang::driver::toolchains::CloudABI::CloudABI(), clang::driver::toolchains::DragonFly::DragonFly(), clang::driver::toolchains::FreeBSD::FreeBSD(), clang::driver::toolchains::Fuchsia::Fuchsia(), clang::driver::Driver::GetFilePath(), clang::driver::Driver::HandleImmediateArgs(), clang::driver::toolchains::HexagonToolChain::HexagonToolChain(), clang::driver::toolchains::MinGW::MinGW(), clang::driver::toolchains::Minix::Minix(), clang::driver::toolchains::MipsLLVMToolChain::MipsLLVMToolChain(), clang::driver::toolchains::MSP430ToolChain::MSP430ToolChain(), clang::driver::toolchains::MyriadToolChain::MyriadToolChain(), clang::driver::toolchains::NaClToolChain::NaClToolChain(), clang::driver::toolchains::NetBSD::NetBSD(), clang::driver::toolchains::OpenBSD::OpenBSD(), clang::driver::toolchains::PS4CPU::PS4CPU(), clang::driver::toolchains::RISCVToolChain::RISCVToolChain(), and ToolChain().

## ◆ getFilePaths() [2/2]

const path_list& clang::driver::ToolChain::getFilePaths | ( |  | ) | const
| inline

Definition at line 225 of file ToolChain.h.

## ◆ getInputFilename()

std::string ToolChain::getInputFilename | ( | const InputInfo & | Input | ) | const
| virtual

Some toolchains need to modify the file name, for example to replace the extension for object files with .cubin for OpenMP offloading to Nvidia GPUs.

Reimplemented in clang::driver::toolchains::CudaToolChain.

Definition at line 243 of file ToolChain.cpp.

References clang::driver::InputInfo::getFilename().

Referenced by clang::driver::tools::OffloadBundler::ConstructJob(), and clang::driver::toolchains::CudaToolChain::getInputFilename().

## ◆ getLibraryPaths() [1/2]

path_list& clang::driver::ToolChain::getLibraryPaths | ( |  | ) |
| inline

Definition at line 221 of file ToolChain.h.

Referenced by AddFilePathLibArgs(), getCompilerRT(), clang::driver::Driver::GetFilePath(), and ToolChain().

## ◆ getLibraryPaths() [2/2]

const path_list& clang::driver::ToolChain::getLibraryPaths | ( |  | ) | const
| inline

Definition at line 222 of file ToolChain.h.

## ◆ GetLinkerPath()

std::string ToolChain::GetLinkerPath | ( |  | ) | const

Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name.

Definition at line 439 of file ToolChain.cpp.

References clang::driver::Driver::Diag(), getDefaultLinker(), getDriver(), and GetProgramPath().

Referenced by clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::ananas::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().

## ◆ getMultilib()

const Multilib& clang::driver::ToolChain::getMultilib | ( |  | ) | const
| inline

Definition at line 232 of file ToolChain.h.

Referenced by clang::driver::Driver::HandleImmediateArgs().

## ◆ getMultilibs()

const MultilibSet& clang::driver::ToolChain::getMultilibs | ( |  | ) | const
| inline

Definition at line 230 of file ToolChain.h.

Referenced by clang::driver::Driver::HandleImmediateArgs().

## ◆ getOS()

StringRef clang::driver::ToolChain::getOS | ( |  | ) | const
| inline

Definition at line 205 of file ToolChain.h.

Referenced by clang::driver::toolchains::MipsLLVMToolChain::getCompilerRT(), and getOSLibName().

## ◆ getOSLibName()

StringRef ToolChain::getOSLibName | ( |  | ) | const

Definition at line 340 of file ToolChain.cpp.

References getOS().

Referenced by getArchSpecificLibPath(), and getCompilerRTPath().

## ◆ getPlatform()

StringRef clang::driver::ToolChain::getPlatform | ( |  | ) | const
| inline

Definition at line 204 of file ToolChain.h.

Referenced by getSystemOrSDKMacOSVersion().

## ◆ GetProgramPath()

std::string ToolChain::GetProgramPath | ( | const char * | Name | ) | const

Definition at line 435 of file ToolChain.cpp.

Referenced by ConstructGoldLinkJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::msp430::Linker::ConstructJob(), ConstructPS4LinkJob(), and GetLinkerPath().

## ◆ getProgramPaths() [1/2]

path_list& clang::driver::ToolChain::getProgramPaths | ( |  | ) |
| inline

Definition at line 227 of file ToolChain.h.

Referenced by clang::driver::toolchains::BareMetal::BareMetal(), clang::driver::toolchains::CudaToolChain::CudaToolChain(), clang::driver::toolchains::DragonFly::DragonFly(), clang::driver::toolchains::Fuchsia::Fuchsia(), clang::driver::toolchains::Generic_GCC::Generic_GCC(), clang::driver::Driver::HandleImmediateArgs(), clang::driver::toolchains::HexagonToolChain::HexagonToolChain(), clang::driver::toolchains::HIPToolChain::HIPToolChain(), clang::driver::toolchains::Linux::Linux(), clang::driver::toolchains::MachO::MachO(), clang::driver::toolchains::MinGW::MinGW(), clang::driver::toolchains::MSP430ToolChain::MSP430ToolChain(), clang::driver::toolchains::MSVCToolChain::MSVCToolChain(), clang::driver::toolchains::NaClToolChain::NaClToolChain(), clang::driver::toolchains::RISCVToolChain::RISCVToolChain(), and clang::driver::toolchains::TCEToolChain::TCEToolChain().

## ◆ getProgramPaths() [2/2]

const path_list& clang::driver::ToolChain::getProgramPaths | ( |  | ) | const
| inline

Definition at line 228 of file ToolChain.h.

## ◆ getRTTIArg()

const llvm::opt::Arg* clang::driver::ToolChain::getRTTIArg | ( |  | ) | const
| inline

Definition at line 239 of file ToolChain.h.

Referenced by clang::driver::SanitizerArgs::SanitizerArgs().

## ◆ getRTTIMode()

RTTIMode clang::driver::ToolChain::getRTTIMode | ( |  | ) | const
| inline

Definition at line 242 of file ToolChain.h.

Referenced by clang::driver::SanitizerArgs::SanitizerArgs().

## ◆ GetRuntimeLibType()

ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType | ( | const llvm::opt::ArgList & | Args | ) | const
| virtual

Reimplemented in clang::driver::toolchains::DarwinClang, and clang::driver::toolchains::Fuchsia.

Definition at line 664 of file ToolChain.cpp.

References clang::driver::Driver::Diag(), GetDefaultRuntimeLibType(), getDriver(), RLT_CompilerRT, and RLT_Libgcc.

Referenced by clang::driver::toolchains::MinGW::AddClangSystemIncludeArgs(), AddLibgcc(), and clang::driver::Driver::HandleImmediateArgs().

## ◆ getSanitizerArgs()

const SanitizerArgs & ToolChain::getSanitizerArgs | ( |  | ) | const

Definition at line 116 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::NetBSD::addClangTargetOptions(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), AddPS4SanitizerArgs(), collectSanitizerRuntimes(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::toolchains::Linux::isPIEDefault(), and clang::driver::toolchains::FreeBSD::isPIEDefault().

## ◆ getSupportedSanitizers()

SanitizerMask ToolChain::getSupportedSanitizers | ( |  | ) | const
| virtual

Return sanitizers which are available in this toolchain.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::MyriadToolChain, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::NetBSD, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::MinGW, clang::driver::toolchains::Solaris, clang::driver::toolchains::CloudABI, clang::driver::toolchains::Linux, and clang::driver::toolchains::Contiki.

Definition at line 818 of file ToolChain.cpp.

References getTriple().

Referenced by clang::driver::toolchains::Contiki::getSupportedSanitizers(), clang::driver::toolchains::Linux::getSupportedSanitizers(), clang::driver::toolchains::CloudABI::getSupportedSanitizers(), clang::driver::toolchains::Solaris::getSupportedSanitizers(), clang::driver::toolchains::Fuchsia::getSupportedSanitizers(), clang::driver::toolchains::MinGW::getSupportedSanitizers(), clang::driver::toolchains::FreeBSD::getSupportedSanitizers(), clang::driver::toolchains::CrossWindowsToolChain::getSupportedSanitizers(), clang::driver::toolchains::NetBSD::getSupportedSanitizers(), clang::driver::toolchains::OpenBSD::getSupportedSanitizers(), clang::driver::toolchains::PS4CPU::getSupportedSanitizers(), clang::driver::toolchains::HIPToolChain::getSupportedSanitizers(), clang::driver::toolchains::MSVCToolChain::getSupportedSanitizers(), clang::driver::toolchains::CudaToolChain::getSupportedSanitizers(), clang::driver::toolchains::Darwin::getSupportedSanitizers(), and clang::driver::SanitizerArgs::SanitizerArgs().

## ◆ getTargetAndModeFromProgramName()

ParsedClangName ToolChain::getTargetAndModeFromProgramName | ( | StringRef | ProgName | ) |
| static

Return any implicit target and/or mode flag for an invocation of the compiler driver as `ProgName`.

For example, when called with i686-linux-android-g++, the first element of the return value will be set to `"i686-linux-android"` and the second will be set to "--driver-mode=g++"`. It is OK if the target name is not registered. In this case the return value contains false in the field TargetIsValid.

Precondition
  `llvm::InitializeAllTargets()` has been called.

Parameters

  ProgName | The name the Clang driver was invoked with (from, e.g., argv[0]).

Returns
  A structure of type ParsedClangName that contains the executable name parts.

Definition at line 204 of file ToolChain.cpp.

References normalizeProgramName(), and parseDriverSuffix().

Referenced by clang::driver::Driver::ParseDriverMode().

## ◆ getThreadModel()

virtual std::string clang::driver::ToolChain::getThreadModel | ( |  | ) | const
| inline virtual

getThreadModel() - Which thread model does this target use?

Definition at line 457 of file ToolChain.h.

References clang::driver::types::TY_INVALID.

Referenced by clang::driver::Driver::PrintVersion().

## ◆ getTool()

Tool * ToolChain::getTool | ( | Action::ActionClass | AC | ) | const
| protected virtual

Reimplemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MachO, and clang::driver::toolchains::MinGW.

Definition at line 289 of file ToolChain.cpp.

References clang::driver::Action::AnalyzeJobClass, clang::driver::Action::AssembleJobClass, clang::driver::Action::BackendJobClass, clang::driver::Action::BindArchClass, clang::driver::Action::CompileJobClass, clang::driver::Action::DsymutilJobClass, clang::driver::Action::HeaderModulePrecompileJobClass, clang::driver::Action::InputClass, clang::driver::Action::LinkJobClass, clang::driver::Action::LipoJobClass, clang::driver::Action::MigrateJobClass, clang::driver::Action::OffloadBundlingJobClass, clang::driver::Action::OffloadClass, clang::driver::Action::OffloadUnbundlingJobClass, clang::driver::Action::PrecompileJobClass, clang::driver::Action::PreprocessJobClass, clang::driver::Action::VerifyDebugInfoJobClass, and clang::driver::Action::VerifyPCHJobClass.

Referenced by clang::driver::toolchains::MinGW::getTool(), clang::driver::toolchains::MachO::getTool(), clang::driver::toolchains::Generic_GCC::getTool(), clang::driver::toolchains::MyriadToolChain::SelectTool(), and SelectTool().

## ◆ getTriple()

const llvm::Triple& clang::driver::ToolChain::getTriple | ( |  | ) | const
| inline

Definition at line 188 of file ToolChain.h.

Referenced by clang::driver::SanitizerArgs::addArgs(), clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Generic_ELF::addClangTargetOptions(), clang::driver::toolchains::DarwinClang::addClangWarningOptions(), addExceptionArgs(), addIncludeLinkerOption(), clang::driver::toolchains::CloudABI::addLibCxxIncludePaths(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), AddLibgcc(), clang::driver::toolchains::Haiku::addLibStdCxxIncludePaths(), clang::driver::toolchains::Linux::addLibStdCxxIncludePaths(), clang::driver::toolchains::BareMetal::AddLinkRuntimeLib(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), clang::driver::tools::ClangAs::AddMIPSTargetArgs(), addSanitizerDynamicList(), clang::driver::toolchains::NaClToolChain::buildAssembler(), clang::driver::toolchains::MSVCToolChain::buildAssembler(), clang::driver::Driver::BuildInputs(), clang::driver::Driver::BuildJobs(), clang::driver::Driver::BuildJobsForAction(), clang::driver::toolchains::HIPToolChain::buildLinker(), clang::driver::toolchains::CloudABI::CloudABI(), CollectArgsForIntegratedAssembler(), collectSanitizerRuntimes(), ComputeLLVMTriple(), clang::driver::toolchains::MSVCToolChain::computeMSVCVersion(), clang::driver::toolchains::Linux::computeSysRoot(), clang::driver::tools::visualstudio::Linker::ConstructJob(), clang::driver::tools::CrossWindows::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::Myriad::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::OffloadBundler::ConstructJob(), clang::driver::Driver::CreateOffloadingDeviceToolChains(), clang::driver::Driver::generateCompilationDiagnostics(), getArchNameForCompilerRTLib(), clang::driver::Compilation::getArgsForToolChain(), clang::driver::toolchains::HIPToolChain::getAuxTriple(), clang::driver::toolchains::CudaToolChain::getAuxTriple(), getCompilerRT(), clang::driver::toolchains::Linux::GetDefaultCXXStdlibType(), clang::driver::toolchains::NetBSD::GetDefaultCXXStdlibType(), clang::driver::toolchains::FreeBSD::GetDefaultCXXStdlibType(), clang::driver::toolchains::Linux::getDynamicLinker(), clang::driver::toolchains::FreeBSD::GetExceptionModel(), clang::driver::toolchains::NetBSD::GetExceptionModel(), clang::driver::toolchains::Darwin::GetExceptionModel(), clang::driver::toolchains::MachO::getMachOArchName(), clang::driver::toolchains::Contiki::getSupportedSanitizers(), clang::driver::toolchains::Linux::getSupportedSanitizers(), clang::driver::toolchains::Solaris::getSupportedSanitizers(), clang::driver::toolchains::FreeBSD::getSupportedSanitizers(), clang::driver::toolchains::NetBSD::getSupportedSanitizers(), clang::driver::toolchains::Darwin::getSupportedSanitizers(), getSupportedSanitizers(), GetTriplePlusArchString(), clang::driver::toolchains::Generic_GCC::IsIntegratedAssemblerDefault(), clang::driver::toolchains::Linux::IsMathErrnoDefault(), clang::driver::toolchains::Generic_GCC::isPICDefault(), clang::driver::toolchains::Generic_GCC::isPICDefaultForced(), clang::driver::toolchains::Linux::isPIEDefault(), clang::driver::toolchains::CloudABI::isPIEDefault(), clang::driver::toolchains::MSVCToolChain::IsUnwindTablesDefault(), clang::driver::tools::isUseSeparateSections(), clang::driver::toolchains::MSP430ToolChain::MSP430ToolChain(), PrintActions1(), clang::driver::SanitizerArgs::SanitizerArgs(), clang::driver::toolchains::MyriadToolChain::SelectTool(), ShouldDisableAutolink(), clang::driver::toolchains::AMDGPUToolChain::TranslateArgs(), clang::driver::XRayArgs::XRayArgs(), and clang::driver::tools::Clang::~Clang().

## ◆ getTripleString()

std::string clang::driver::ToolChain::getTripleString | ( |  | ) | const
| inline

Definition at line 211 of file ToolChain.h.

Referenced by clang::driver::Driver::BuildJobsForAction(), checkDebugInfoOption(), ComputeLLVMTriple(), clang::driver::Driver::HandleImmediateArgs(), and clang::driver::Driver::PrintVersion().

## ◆ getVFS()

llvm::vfs::FileSystem & ToolChain::getVFS | ( |  | ) | const

Definition at line 102 of file ToolChain.cpp.

References getDriver(), and clang::driver::Driver::getVFS().

Referenced by clang::driver::toolchains::DarwinClang::AddCCKextLibArgs(), clang::driver::toolchains::BareMetal::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::DarwinClang::AddCXXStdlibLibArgs(), clang::driver::toolchains::Linux::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibStdCXXIncludePaths(), clang::driver::toolchains::MachO::AddLinkRuntimeLib(), clang::driver::toolchains::Linux::computeSysRoot(), getCompilerRT(), clang::driver::toolchains::Linux::getDynamicLinker(), clang::driver::tools::isUseSeparateSections(), and ToolChain().

## ◆ getXRayArgs()

const XRayArgs & ToolChain::getXRayArgs | ( |  | ) | const

Definition at line 122 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs().

## ◆ hasBlocksRuntime()

virtual bool clang::driver::ToolChain::hasBlocksRuntime | ( |  | ) | const
| inline virtual

hasBlocksRuntime - Given that the user is compiling with -fblocks, does this tool chain guarantee the existence of a blocks runtime?

FIXME: this really belongs on some sort of DeploymentTarget abstraction

Reimplemented in clang::driver::toolchains::Darwin, and clang::driver::toolchains::XCoreToolChain.

Definition at line 488 of file ToolChain.h.

## ◆ HasNativeLLVMSupport()

bool ToolChain::HasNativeLLVMSupport | ( |  | ) | const
| virtual

HasNativeLTOLinker - Check whether the linker and related tools have native LLVM support.

Reimplemented in clang::driver::toolchains::MachO, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::MinGW, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::CloudABI, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::Hurd, and clang::driver::toolchains::Linux.

Definition at line 475 of file ToolChain.cpp.

## ◆ IsBlocksDefault()

virtual bool clang::driver::ToolChain::IsBlocksDefault | ( |  | ) | const
| inline virtual

IsBlocksDefault - Does this tool chain enable -fblocks by default.

Reimplemented in clang::driver::toolchains::MachO.

Definition at line 320 of file ToolChain.h.

## ◆ isCrossCompiling()

bool ToolChain::isCrossCompiling | ( |  | ) | const
| virtual

Returns true if the toolchain is targeting a non-native architecture.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, and clang::driver::toolchains::BareMetal.

Definition at line 479 of file ToolChain.cpp.

References getArch().

## ◆ IsEncodeExtendedBlockSignatureDefault()

virtual bool clang::driver::ToolChain::IsEncodeExtendedBlockSignatureDefault | ( |  | ) | const
| inline virtual

IsEncodeExtendedBlockSignatureDefault - Does this tool chain enable -fencode-extended-block-signature by default.

Reimplemented in clang::driver::toolchains::MachO.

Definition at line 334 of file ToolChain.h.

## ◆ IsIntegratedAssemblerDefault()

virtual bool clang::driver::ToolChain::IsIntegratedAssemblerDefault | ( |  | ) | const
| inline virtual

IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.

Reimplemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MachO, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::MinGW, clang::driver::toolchains::AMDGPUToolChain, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::LanaiToolChain, and clang::driver::toolchains::RISCVToolChain.

Definition at line 324 of file ToolChain.h.

Referenced by useIntegratedAs().

## ◆ IsMathErrnoDefault()

virtual bool clang::driver::ToolChain::IsMathErrnoDefault | ( |  | ) | const
| inline virtual

IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.

Reimplemented in clang::driver::toolchains::MachO, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::NetBSD, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::DragonFly, clang::driver::toolchains::CloudABI, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::Linux, and clang::driver::toolchains::TCEToolChain.

Definition at line 330 of file ToolChain.h.

Referenced by clang::driver::toolchains::Linux::IsMathErrnoDefault(), and RenderFloatingPointOptions().

## ◆ IsObjCNonFragileABIDefault()

virtual bool clang::driver::ToolChain::IsObjCNonFragileABIDefault | ( |  | ) | const
| inline virtual

IsObjCNonFragileABIDefault - Does this tool chain set -fobjc-nonfragile-abi by default.

Reimplemented in clang::driver::toolchains::MachO, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::NetBSD, clang::driver::toolchains::OpenBSD, and clang::driver::toolchains::CloudABI.

Definition at line 338 of file ToolChain.h.

Referenced by clang::driver::tools::Clang::~Clang().

## ◆ isPICDefault()

virtual bool clang::driver::ToolChain::isPICDefault | ( |  | ) | const
| pure virtual

Test whether this toolchain defaults to PIC.

Implemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MachO, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::PS4CPU, clang::driver::toolchains::MinGW, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::BareMetal, and clang::driver::toolchains::TCEToolChain.

## ◆ isPICDefaultForced()

virtual bool clang::driver::ToolChain::isPICDefaultForced | ( |  | ) | const
| pure virtual

Tests whether this toolchain forces its default for PIC, PIE or non-PIC.

If this returns true, any PIC related flags should be ignored and instead the results of `isPICDefault()` and `isPIEDefault()` are used exclusively.

Implemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MachO, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::MinGW, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::BareMetal, and clang::driver::toolchains::TCEToolChain.

## ◆ isPIEDefault()

virtual bool clang::driver::ToolChain::isPIEDefault | ( |  | ) | const
| pure virtual

Test whether this toolchain defaults to PIE.

Implemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MachO, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::MinGW, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::CloudABI, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::Linux, clang::driver::toolchains::BareMetal, clang::driver::toolchains::TCEToolChain, and clang::driver::toolchains::Haiku.

Referenced by clang::driver::tools::cloudabi::Linker::ConstructJob().

## ◆ isThreadModelSupported()

bool ToolChain::isThreadModelSupported | ( | const StringRef | Model | ) | const
| virtual

isThreadModelSupported() - Does this target support a thread model?

Definition at line 505 of file ToolChain.cpp.

Referenced by clang::driver::Driver::PrintVersion().

## ◆ IsUnwindTablesDefault()

bool ToolChain::IsUnwindTablesDefault | ( | const llvm::opt::ArgList & | Args | ) | const
| virtual

IsUnwindTablesDefault - Does this tool chain use -funwind-tables by default.

Reimplemented in clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MachO, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::NetBSD, clang::driver::toolchains::MinGW, clang::driver::toolchains::CrossWindowsToolChain, and clang::driver::toolchains::Fuchsia.

Definition at line 247 of file ToolChain.cpp.

## ◆ LookupTypeForExtension()

types::ID ToolChain::LookupTypeForExtension | ( | StringRef | Ext | ) | const
| virtual

LookupTypeForExtension - Return the default language type to use for the given extension.

Reimplemented in clang::driver::toolchains::MachO.

Definition at line 471 of file ToolChain.cpp.

References clang::driver::types::lookupTypeForExtension().

Referenced by clang::driver::Driver::BuildInputs().

## ◆ needsGCovInstrumentation()

bool ToolChain::needsGCovInstrumentation | ( | const llvm::opt::ArgList & | Args | ) |
| static

Returns true if gcov instrumentation (-fprofile-arcs or –coverage) is on.

Definition at line 417 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::Darwin::addProfileRTLibs(), and needsProfileRT().

## ◆ needsProfileRT()

bool ToolChain::needsProfileRT | ( | const llvm::opt::ArgList & | Args | ) |
| static

needsProfileRT - returns true if instrumentation profile is on.

Definition at line 405 of file ToolChain.cpp.

References needsGCovInstrumentation().

Referenced by clang::driver::toolchains::Linux::addProfileRTLibs(), clang::driver::toolchains::Darwin::addProfileRTLibs(), and addProfileRTLibs().

## ◆ printVerboseInfo()

virtual void clang::driver::ToolChain::printVerboseInfo | ( | raw_ostream & | OS | ) | const
| inline virtual

Dispatch to the specific toolchain for verbose printing.

This is used when handling the verbose option to print detailed, toolchain-specific information useful for understanding the behavior of the driver on a specific platform.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MSVCToolChain, and clang::driver::toolchains::MinGW.

Definition at line 303 of file ToolChain.h.

Referenced by clang::driver::Driver::HandleImmediateArgs().

## ◆ SelectTool()

Tool * ToolChain::SelectTool | ( | const JobAction & | JA | ) | const
| virtual

Choose a tool to use to handle the action `JA`.

This can be overridden when a particular ToolChain needs to use a compiler other than Clang.

Reimplemented in clang::driver::toolchains::MyriadToolChain.

Definition at line 423 of file ToolChain.cpp.

References clang::driver::Action::AssembleJobClass, getDriver(), clang::driver::Action::getKind(), getTool(), and useIntegratedAs().

Referenced by clang::driver::Driver::BuildJobs(), and clang::driver::toolchains::MyriadToolChain::SelectTool().

## ◆ setTripleEnvironment()

void ToolChain::setTripleEnvironment | ( | llvm::Triple::EnvironmentType | Env | ) |
| protected

Definition at line 94 of file ToolChain.cpp.

References ~ToolChain().

## ◆ ShouldLinkCXXStdlib()

bool ToolChain::ShouldLinkCXXStdlib | ( | const llvm::opt::ArgList & | Args | ) | const

Returns if the C++ standard library should be linked in.

Note that e.g. -lm should still be linked even if this returns false.

Definition at line 755 of file ToolChain.cpp.

References clang::driver::Driver::CCCIsCXX(), and getDriver().

Referenced by ConstructGoldLinkJob(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::ananas::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::RISCV::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().

## ◆ supportsDebugInfoOption()

virtual bool clang::driver::ToolChain::supportsDebugInfoOption | ( | const llvm::opt::Arg * |  | ) | const
| inline virtual

Does this toolchain supports given debug info option or not.

Reimplemented in clang::driver::toolchains::CudaToolChain.

Definition at line 441 of file ToolChain.h.

Referenced by checkDebugInfoOption().

## ◆ SupportsEmbeddedBitcode()

virtual bool clang::driver::ToolChain::SupportsEmbeddedBitcode | ( |  | ) | const
| inline virtual

SupportsEmbeddedBitcode - Does this tool chain support embedded bitcode.

Reimplemented in clang::driver::toolchains::Darwin.

Definition at line 454 of file ToolChain.h.

Referenced by shouldLinkerNotDedup().

## ◆ SupportsProfiling()

virtual bool clang::driver::ToolChain::SupportsProfiling | ( |  | ) | const
| inline virtual

SupportsProfiling - Does this tool chain support -pg.

Reimplemented in clang::driver::toolchains::MachO, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::XCoreToolChain, and clang::driver::toolchains::BareMetal.

Definition at line 411 of file ToolChain.h.

## ◆ TranslateArgs()

virtual llvm::opt::DerivedArgList* clang::driver::ToolChain::TranslateArgs | ( | const llvm::opt::DerivedArgList & | Args,
|  | StringRef | BoundArch,
|  | Action::OffloadKind | DeviceOffloadKind
| ) |  | const
| inline virtual

TranslateArgs - Create a new derived argument list for any argument translations this ToolChain may wish to perform, or 0 if no tool chain specific translations are needed.

If `DeviceOffloadKind` is specified the translation specific for that offload kind is performed.

Parameters

  BoundArch | - The bound architecture name, or 0.
  DeviceOffloadKind | - The device offload kind used for the translation.

Reimplemented in clang::driver::toolchains::Darwin, clang::driver::toolchains::Generic_GCC, clang::driver::toolchains::MachO, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, clang::driver::toolchains::MSVCToolChain, and clang::driver::toolchains::AMDGPUToolChain.

Definition at line 271 of file ToolChain.h.

Referenced by clang::driver::Compilation::getArgsForToolChain(), clang::driver::toolchains::HIPToolChain::TranslateArgs(), and clang::driver::toolchains::CudaToolChain::TranslateArgs().

## ◆ TranslateOpenMPTargetArgs()

llvm::opt::DerivedArgList * ToolChain::TranslateOpenMPTargetArgs | ( | const llvm::opt::DerivedArgList & | Args,
|  | bool | SameTripleAsHost,
|  | SmallVectorImpl< llvm::opt::Arg *> & | AllocatedArgs
| ) |  | const
| virtual

TranslateOpenMPTargetArgs - Create a new derived argument list for that contains the OpenMP target specific flags passed via -Xopenmp-target -opt=val OR -Xopenmp-target=<triple> -opt=val.

Definition at line 900 of file ToolChain.cpp.

References getDriver(), and clang::driver::Driver::getOpts().

Referenced by clang::driver::Compilation::getArgsForToolChain().

## ◆ UseDwarfDebugFlags()

virtual bool clang::driver::ToolChain::UseDwarfDebugFlags | ( |  | ) | const
| inline virtual

UseDwarfDebugFlags - Embed the compile options to clang into the Dwarf compile unit information.

Reimplemented in clang::driver::toolchains::MachO.

Definition at line 423 of file ToolChain.h.

## ◆ useIntegratedAs()

bool ToolChain::useIntegratedAs | ( |  | ) | const
| virtual

Check if the toolchain should use the integrated assembler.

Reimplemented in clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HIPToolChain, and clang::driver::toolchains::BareMetal.

Definition at line 106 of file ToolChain.cpp.

References IsIntegratedAssemblerDefault().

Referenced by SelectTool(), ShouldDisableAutolink(), and ShouldDisableDwarfDirectory().

## ◆ UseObjCMixedDispatch()

virtual bool clang::driver::ToolChain::UseObjCMixedDispatch | ( |  | ) | const
| inline virtual

UseObjCMixedDispatchDefault - When using non-legacy dispatch, should the mixed dispatch method be used?

Reimplemented in clang::driver::toolchains::Darwin, and clang::driver::toolchains::MachO.

Definition at line 342 of file ToolChain.h.

Referenced by RenderObjCOptions().

## ◆ useRelaxRelocations()

bool ToolChain::useRelaxRelocations | ( |  | ) | const
| virtual

Check whether to enable x86 relax relocations by default.

Reimplemented in clang::driver::toolchains::Fuchsia.

Definition at line 112 of file ToolChain.cpp.

Referenced by CollectArgsForIntegratedAssembler().

## Friends And Related Function Documentation

## ◆ RegisterEffectiveTriple

friend class RegisterEffectiveTriple
| friend

Definition at line 109 of file ToolChain.h.

## Member Data Documentation

## ◆ Multilibs

MultilibSet clang::driver::ToolChain::Multilibs
| protected

Definition at line 152 of file ToolChain.h.

Referenced by clang::driver::toolchains::Linux::Linux(), and clang::driver::toolchains::MipsLLVMToolChain::MipsLLVMToolChain().

## ◆ SelectedMultilib

Multilib clang::driver::ToolChain::SelectedMultilib
| protected

Definition at line 153 of file ToolChain.h.

Referenced by clang::driver::toolchains::Linux::Linux().

The documentation for this class was generated from the following files:

- include/clang/Driver/ToolChain.h
- lib/Driver/ToolChain.cpp