clang  17.0.0git
Classes | 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:
Inheritance graph
[legend]
Collaboration diagram for clang::driver::ToolChain:
Collaboration graph
[legend]

Classes

struct  BitCodeLibraryInfo
 

Public Types

enum  CXXStdlibType { CST_Libcxx, CST_Libstdcxx }
 
enum  RuntimeLibType { RLT_CompilerRT, RLT_Libgcc }
 
enum  UnwindLibType { UNW_None, UNW_CompilerRT, UNW_Libgcc }
 
enum  UnwindTableLevel { UnwindTableLevel::None, UnwindTableLevel::Synchronous, UnwindTableLevel::Asynchronous }
 
enum  RTTIMode { RM_Enabled, RM_Disabled }
 
enum  FileType { FT_Object, FT_Static, FT_Shared }
 
using path_list = SmallVector< std::string, 16 >
 

Public Member Functions

virtual ~ToolChain ()
 
const DrivergetDriver () 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...
 
bool hasEffectiveTriple () const
 
path_listgetLibraryPaths ()
 
const path_listgetLibraryPaths () const
 
path_listgetFilePaths ()
 
const path_listgetFilePaths () const
 
path_listgetProgramPaths ()
 
const path_listgetProgramPaths () const
 
const MultilibSetgetMultilibs () const
 
const MultilibgetMultilib () const
 
SanitizerArgs getSanitizerArgs (const llvm::opt::ArgList &JobArgs) const
 
const XRayArgsgetXRayArgs () 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 void TranslateXarchArgs (const llvm::opt::DerivedArgList &Args, llvm::opt::Arg *&A, llvm::opt::DerivedArgList *DAL, SmallVectorImpl< llvm::opt::Arg * > *AllocatedArgs=nullptr) const
 Append the argument following A to DAL assuming A is an Xarch argument. More...
 
virtual llvm::opt::DerivedArgList * TranslateXarchArgs (const llvm::opt::DerivedArgList &Args, StringRef BoundArch, Action::OffloadKind DeviceOffloadKind, SmallVectorImpl< llvm::opt::Arg * > *AllocatedArgs) const
 Translate -Xarch_ arguments. More...
 
virtual ToolSelectTool (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 (bool *LinkerIsLLD=nullptr) const
 Returns the linker path, respecting the -fuse-ld= argument to determine the linker suffix or name. More...
 
std::string GetStaticLibToolPath () const
 Returns the linker path for emitting a static library. 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 IsIntegratedBackendDefault () const
 IsIntegratedBackendDefault - Does this tool chain enable -fintegrated-objemitter by default. More...
 
virtual bool IsIntegratedBackendSupported () const
 IsIntegratedBackendSupported - Does this tool chain support -fintegrated-objemitter. More...
 
virtual bool IsNonIntegratedBackendSupported () const
 IsNonIntegratedBackendSupported - Does this tool chain support -fno-integrated-objemitter. More...
 
virtual bool useIntegratedAs () const
 Check if the toolchain should use the integrated assembler. More...
 
virtual bool useIntegratedBackend () const
 Check if the toolchain should use the integrated backend. More...
 
virtual bool parseInlineAsmUsingAsmParser () const
 Check if the toolchain should use AsmParser to parse inlineAsm when integrated assembler is not default. 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...
 
bool defaultToIEEELongDouble () const
 Check whether use IEEE binary128 as long double format by default. More...
 
virtual LangOptions::StackProtectorMode GetDefaultStackProtectorLevel (bool KernelOrKext) const
 GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain. 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 UnwindLibType GetDefaultUnwindLibType () const
 
virtual std::string getCompilerRTPath () const
 
virtual std::string getCompilerRT (const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
 
const char * getCompilerRTArgString (const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
 
std::string getCompilerRTBasename (const llvm::opt::ArgList &Args, StringRef Component, FileType Type=ToolChain::FT_Static) const
 
path_list getRuntimePaths () const
 
path_list getStdlibPaths () const
 
std::string getArchSpecificLibPath () const
 
virtual StringRef getOSLibName () const
 
virtual UnwindTableLevel getDefaultUnwindTableLevel (const llvm::opt::ArgList &Args) const
 How detailed should the unwind tables be by default. More...
 
virtual bool IsAArch64OutlineAtomicsDefault (const llvm::opt::ArgList &Args) const
 Test whether this toolchain supports outline atomics by default. More...
 
virtual bool isPICDefault () const =0
 Test whether this toolchain defaults to PIC. More...
 
virtual bool isPIEDefault (const llvm::opt::ArgList &Args) 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 std::string GetGlobalDebugPathRemapping () const
 Add an additional -fdebug-prefix-map entry. More...
 
virtual unsigned GetDefaultDwarfVersion () const
 
virtual unsigned getMaxDwarfVersion () 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 bool isBareMetal () const
 isBareMetal - Is this a bare metal target. More...
 
virtual std::string getMultiarchTriple (const Driver &D, const llvm::Triple &TargetTriple, StringRef SysRoot) const
 
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 std::string computeSysRoot () const
 Return the sysroot, possibly searching for a default sysroot using target-specific logic. 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 addClangCC1ASTargetOptions (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CC1ASArgs) const
 Add options that need to be passed to cc1as 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 UnwindLibType GetUnwindLibType (const llvm::opt::ArgList &Args) const
 
virtual std::string detectLibcxxVersion (StringRef IncludePath) 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...
 
void AddClangCXXStdlibIsystemArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
 AddClangCXXStdlibIsystemArgs - Add the clang -cc1 level arguments to set the specified include paths for the C++ standard library. 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 isFastMathRuntimeAvailable (const llvm::opt::ArgList &Args, std::string &Path) const
 If a runtime library exists that sets global flags for unsafe floating point math, return true. More...
 
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 Expected< SmallVector< std::string > > getSystemGPUArchs (const llvm::opt::ArgList &Args) const
 getSystemGPUArchs - Use a tool to detect the user's availible GPUs. 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 AddHIPIncludeArgs (const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
 Add arguments to use system-specific HIP 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 llvm::SmallVector< BitCodeLibraryInfo, 12 > getDeviceLibs (const llvm::opt::ArgList &Args) const
 Get paths for device libraries. More...
 
virtual void AddHIPRuntimeLibArgs (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
 Add the system specific linker arguments to use for the given HIP runtime library type. 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...
 
virtual bool canSplitThinLTOUnit () const
 Returns true when it's possible to split LTO unit to use whole program devirtualization and CFI santiizers. More...
 
virtual llvm::DenormalMode getDefaultDenormalModeForType (const llvm::opt::ArgList &DriverArgs, const JobAction &JA, const llvm::fltSemantics *FPType=nullptr) const
 Returns the output denormal handling type in the default floating point environment for the given FPType if given. 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...
 
static llvm::Triple getOpenMPTriple (StringRef TripleStr)
 

Protected Member Functions

 ToolChain (const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args)
 
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > executeToolChainProgram (StringRef Executable) const
 Executes the given Executable and returns the stdout. More...
 
void setTripleEnvironment (llvm::Triple::EnvironmentType Env)
 
virtual ToolbuildAssembler () const
 
virtual ToolbuildLinker () const
 
virtual ToolbuildStaticLibTool () const
 
virtual ToolgetTool (Action::ActionClass AC) const
 
virtual std::string buildCompilerRTBasename (const llvm::opt::ArgList &Args, StringRef Component, FileType Type, bool AddArch) 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...
 
static std::string concat (StringRef Path, const Twine &A, const Twine &B="", const Twine &C="", const Twine &D="")
 

Protected Attributes

MultilibSet Multilibs
 
Multilib SelectedMultilib
 

Friends

class RegisterEffectiveTriple
 

Detailed Description

ToolChain - Access to tools for a single platform.

Definition at line 91 of file ToolChain.h.

Member Typedef Documentation

◆ path_list

Definition at line 93 of file ToolChain.h.

Member Enumeration Documentation

◆ CXXStdlibType

Enumerator
CST_Libcxx 
CST_Libstdcxx 

Definition at line 95 of file ToolChain.h.

◆ FileType

Enumerator
FT_Object 
FT_Static 
FT_Shared 

Definition at line 129 of file ToolChain.h.

◆ RTTIMode

Enumerator
RM_Enabled 
RM_Disabled 

Definition at line 117 of file ToolChain.h.

◆ RuntimeLibType

Enumerator
RLT_CompilerRT 
RLT_Libgcc 

Definition at line 100 of file ToolChain.h.

◆ UnwindLibType

Enumerator
UNW_None 
UNW_CompilerRT 
UNW_Libgcc 

Definition at line 105 of file ToolChain.h.

◆ UnwindTableLevel

Enumerator
None 
Synchronous 
Asynchronous 

Definition at line 111 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 76 of file ToolChain.cpp.

◆ ~ToolChain()

ToolChain::~ToolChain ( )
virtualdefault

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 1081 of file ToolChain.cpp.

◆ addClangCC1ASTargetOptions()

void ToolChain::addClangCC1ASTargetOptions ( const llvm::opt::ArgList &  Args,
llvm::opt::ArgStringList &  CC1ASArgs 
) const
virtual

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

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

Definition at line 846 of file ToolChain.cpp.

Referenced by clang::driver::tools::ClangAs::ConstructJob().

◆ AddClangCXXStdlibIncludeArgs()

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

◆ AddClangCXXStdlibIsystemArgs()

void ToolChain::AddClangCXXStdlibIsystemArgs ( const llvm::opt::ArgList &  DriverArgs,
llvm::opt::ArgStringList &  CC1Args 
) const

AddClangCXXStdlibIsystemArgs - Add the clang -cc1 level arguments to set the specified include paths for the C++ standard library.

Definition at line 1031 of file ToolChain.cpp.

References addSystemInclude(), and P.

◆ 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::DarwinClang, clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::MinGW, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::MyriadToolChain, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::AIX, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::HIPAMDToolChain, clang::driver::toolchains::XCoreToolChain, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::HIPSPVToolChain, clang::driver::toolchains::NetBSD, clang::driver::toolchains::BareMetal, clang::driver::toolchains::Solaris, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::AMDGPUOpenMPToolChain, clang::driver::toolchains::VEToolChain, clang::driver::toolchains::MSP430ToolChain, clang::driver::toolchains::RISCVToolChain, clang::driver::toolchains::Linux, clang::driver::toolchains::CSKYToolChain, clang::driver::toolchains::MipsLLVMToolChain, clang::driver::toolchains::Hurd, clang::driver::toolchains::AVRToolChain, clang::driver::toolchains::PPCFreeBSDToolChain, and clang::driver::toolchains::PPCLinuxToolChain.

Definition at line 837 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::AMDGPUOpenMPToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HIPSPVToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HIPAMDToolChain::AddClangSystemIncludeArgs(), and clang::driver::toolchains::CudaToolChain::AddClangSystemIncludeArgs().

◆ addClangTargetOptions()

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

◆ addClangWarningOptions()

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

◆ AddCudaIncludeArgs()

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

◆ AddCXXStdlibLibArgs()

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

◆ addExternCSystemInclude()

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

◆ addExternCSystemIncludeIfExists()

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

Definition at line 969 of file ToolChain.cpp.

References addExternCSystemInclude().

◆ addFastMathRuntimeIfAvailable()

bool ToolChain::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.

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

Definition at line 1106 of file ToolChain.cpp.

References isFastMathRuntimeAvailable(), and string().

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

◆ AddHIPIncludeArgs()

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

◆ AddHIPRuntimeLibArgs()

virtual void clang::driver::ToolChain::AddHIPRuntimeLibArgs ( const llvm::opt::ArgList &  Args,
llvm::opt::ArgStringList &  CmdArgs 
) const
inlinevirtual

Add the system specific linker arguments to use for the given HIP runtime library type.

Reimplemented in clang::driver::toolchains::MSVCToolChain, and clang::driver::toolchains::Linux.

Definition at line 742 of file ToolChain.h.

Referenced by clang::driver::tools::addHIPRuntimeLibArgs().

◆ AddIAMCUIncludeArgs()

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

◆ addProfileRTLibs()

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

◆ addSystemInclude()

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

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

Definition at line 947 of file ToolChain.cpp.

Referenced by clang::driver::toolchains::BareMetal::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::AIX::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::DarwinClang::AddClangCXXStdlibIncludeArgs(), AddClangCXXStdlibIsystemArgs(), clang::driver::toolchains::PPCLinuxToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::AVRToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::MipsLLVMToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::CSKYToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Linux::AddClangSystemIncludeArgs(), clang::driver::toolchains::RISCVToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::MSP430ToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::VEToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Solaris::AddClangSystemIncludeArgs(), clang::driver::toolchains::BareMetal::AddClangSystemIncludeArgs(), clang::driver::toolchains::NetBSD::AddClangSystemIncludeArgs(), clang::driver::toolchains::FreeBSD::AddClangSystemIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::AIX::AddClangSystemIncludeArgs(), clang::driver::toolchains::OpenBSD::AddClangSystemIncludeArgs(), clang::driver::toolchains::MyriadToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HexagonToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::MSVCToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangSystemIncludeArgs(), clang::driver::toolchains::DarwinClang::AddClangSystemIncludeArgs(), clang::driver::toolchains::Haiku::addLibCxxIncludePaths(), clang::driver::toolchains::CloudABI::addLibCxxIncludePaths(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::NetBSD::addLibCxxIncludePaths(), clang::driver::toolchains::FreeBSD::addLibCxxIncludePaths(), clang::driver::toolchains::OpenBSD::addLibCxxIncludePaths(), clang::driver::toolchains::MyriadToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibStdCXXIncludePaths(), clang::driver::toolchains::Generic_GCC::AddMultilibIncludeArgs(), and clang::driver::toolchains::MSVCToolChain::AddSystemIncludeWithSubfolder().

◆ addSystemIncludes()

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

◆ adjustDebugInfoKind()

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

Adjust debug information kind considering all passed options.

Reimplemented in clang::driver::toolchains::NVPTXToolChain, and clang::driver::toolchains::HIPSPVToolChain.

Definition at line 574 of file ToolChain.h.

Referenced by renderDebugOptions().

◆ buildAssembler()

Tool * ToolChain::buildAssembler ( ) const
protectedvirtual

◆ buildCompilerRTBasename()

std::string ToolChain::buildCompilerRTBasename ( const llvm::opt::ArgList &  Args,
StringRef  Component,
FileType  Type,
bool  AddArch 
) const
protectedvirtual

◆ buildLinker()

Tool * ToolChain::buildLinker ( ) const
protectedvirtual

◆ buildStaticLibTool()

Tool * ToolChain::buildStaticLibTool ( ) const
protectedvirtual

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

Definition at line 350 of file ToolChain.cpp.

◆ canSplitThinLTOUnit()

virtual bool clang::driver::ToolChain::canSplitThinLTOUnit ( ) const
inlinevirtual

Returns true when it's possible to split LTO unit to use whole program devirtualization and CFI santiizers.

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

Definition at line 755 of file ToolChain.h.

◆ CheckObjCARC()

virtual void clang::driver::ToolChain::CheckObjCARC ( ) const
inlinevirtual

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

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

Definition at line 534 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 828 of file ToolChain.cpp.

References ComputeLLVMTriple().

Referenced by 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

◆ computeMSVCVersion()

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

◆ computeSysRoot()

std::string ToolChain::computeSysRoot ( ) const
virtual

◆ concat()

std::string ToolChain::concat ( StringRef  Path,
const Twine &  A,
const Twine &  B = "",
const Twine &  C = "",
const Twine &  D = "" 
)
staticprotected

◆ defaultToIEEELongDouble()

bool ToolChain::defaultToIEEELongDouble ( ) const

Check whether use IEEE binary128 as long double format by default.

Definition at line 169 of file ToolChain.cpp.

References getTriple().

◆ detectLibcxxVersion()

std::string ToolChain::detectLibcxxVersion ( StringRef  IncludePath) const
virtual

◆ executeToolChainProgram()

llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > ToolChain::executeToolChainProgram ( StringRef  Executable) const
protected

Executes the given Executable and returns the stdout.

Definition at line 93 of file ToolChain.cpp.

References string().

Referenced by clang::driver::toolchains::AMDGPUToolChain::getSystemGPUArchs(), and clang::driver::toolchains::CudaToolChain::getSystemGPUArchs().

◆ getArch()

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

Definition at line 252 of file ToolChain.h.

Referenced by clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), addDefaultCRTLinkArgs(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::DarwinClang::AddLinkARCArgs(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), clang::driver::toolchains::NaClToolChain::buildAssembler(), clang::driver::toolchains::HIPAMDToolChain::buildLinker(), clang::driver::toolchains::HIPSPVToolChain::buildLinker(), ComputeLLVMTriple(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::RISCV::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::Clang::ConstructJob(), getArchNameForCompilerRTLib(), getArchSpecificLibPath(), clang::driver::toolchains::NetBSD::GetDefaultCXXStdlibType(), clang::driver::toolchains::Linux::getDefaultDenormalModeForType(), clang::driver::toolchains::Fuchsia::getDefaultSanitizers(), clang::driver::toolchains::MSVCToolChain::getDefaultUnwindTableLevel(), clang::driver::toolchains::CrossWindowsToolChain::getDefaultUnwindTableLevel(), clang::driver::toolchains::OpenBSD::getDefaultUnwindTableLevel(), clang::driver::toolchains::MachO::getDefaultUnwindTableLevel(), clang::driver::toolchains::Generic_GCC::getDefaultUnwindTableLevel(), clang::driver::toolchains::Hurd::getDynamicLinker(), clang::driver::toolchains::Linux::getDynamicLinker(), clang::driver::toolchains::FreeBSD::GetExceptionModel(), clang::driver::toolchains::Darwin::GetExceptionModel(), clang::driver::toolchains::MachO::getMachOArchName(), clang::driver::toolchains::MSVCToolChain::getSubDirectoryPath(), clang::driver::toolchains::MSVCToolChain::getUniversalCRTLibraryPath(), clang::driver::toolchains::MSVCToolChain::getWindowsSDKLibraryPath(), isCrossCompiling(), clang::driver::toolchains::Generic_GCC::IsIntegratedAssemblerDefault(), clang::driver::toolchains::MSVCToolChain::isPICDefault(), clang::driver::toolchains::CrossWindowsToolChain::isPICDefault(), clang::driver::toolchains::Generic_GCC::isPICDefault(), clang::driver::toolchains::MSVCToolChain::isPICDefaultForced(), clang::driver::toolchains::CrossWindowsToolChain::isPICDefaultForced(), clang::driver::toolchains::MachO::isPICDefaultForced(), clang::driver::toolchains::Generic_GCC::isPICDefaultForced(), clang::driver::toolchains::CloudABI::isPIEDefault(), clang::driver::toolchains::CrossWindowsToolChain::isPIEDefault(), RenderBuiltinOptions(), RenderFloatingPointOptions(), RenderObjCOptions(), clang::driver::toolchains::AMDGPUOpenMPToolChain::TranslateArgs(), clang::driver::toolchains::MSVCToolChain::TranslateArgs(), clang::driver::toolchains::CudaToolChain::TranslateArgs(), and clang::driver::toolchains::MSVCToolChain::useUniversalCRT().

◆ getArchName()

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

◆ getArchSpecificLibPath()

std::string ToolChain::getArchSpecificLibPath ( ) const

◆ getAuxTriple()

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

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, clang::driver::toolchains::HIPAMDToolChain, clang::driver::toolchains::HIPSPVToolChain, and clang::driver::toolchains::AMDGPUOpenMPToolChain.

Definition at line 245 of file ToolChain.h.

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

◆ getCompilerRT()

std::string ToolChain::getCompilerRT ( const llvm::opt::ArgList &  Args,
StringRef  Component,
FileType  Type = ToolChain::FT_Static 
) const
virtual

◆ getCompilerRTArgString()

const char * ToolChain::getCompilerRTArgString ( const llvm::opt::ArgList &  Args,
StringRef  Component,
FileType  Type = ToolChain::FT_Static 
) const

◆ getCompilerRTBasename()

std::string ToolChain::getCompilerRTBasename ( const llvm::opt::ArgList &  Args,
StringRef  Component,
FileType  Type = ToolChain::FT_Static 
) const

Definition at line 503 of file ToolChain.cpp.

References getCompilerRT(), and string().

Referenced by clang::driver::SanitizerArgs::addArgs(), and addPGOAndCoverageFlags().

◆ getCompilerRTPath()

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

◆ GetCXXStdlibType()

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

Reimplemented in clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::HexagonToolChain, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::HIPAMDToolChain, clang::driver::toolchains::HIPSPVToolChain, clang::driver::toolchains::NaClToolChain, clang::driver::toolchains::VEToolChain, clang::driver::toolchains::CloudABI, clang::driver::toolchains::AMDGPUOpenMPToolChain, and clang::driver::toolchains::MipsLLVMToolChain.

Definition at line 921 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::AIX::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::AIX::AddCXXStdlibLibArgs(), clang::driver::toolchains::DarwinClang::AddCXXStdlibLibArgs(), AddCXXStdlibLibArgs(), clang::driver::toolchains::AMDGPUOpenMPToolChain::GetCXXStdlibType(), clang::driver::toolchains::HIPSPVToolChain::GetCXXStdlibType(), clang::driver::toolchains::HIPAMDToolChain::GetCXXStdlibType(), clang::driver::toolchains::CudaToolChain::GetCXXStdlibType(), and RenderObjCOptions().

◆ GetDefaultCXXStdlibType()

virtual CXXStdlibType clang::driver::ToolChain::GetDefaultCXXStdlibType ( ) const
inlinevirtual

◆ getDefaultDebugFormat()

virtual codegenoptions::DebugInfoFormat clang::driver::ToolChain::getDefaultDebugFormat ( ) const
inlinevirtual

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

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

Definition at line 537 of file ToolChain.h.

References clang::codegenoptions::DIF_DWARF.

Referenced by renderDebugOptions().

◆ getDefaultDebuggerTuning()

virtual llvm::DebuggerKind clang::driver::ToolChain::getDefaultDebuggerTuning ( ) const
inlinevirtual

◆ getDefaultDenormalModeForType()

virtual llvm::DenormalMode clang::driver::ToolChain::getDefaultDenormalModeForType ( const llvm::opt::ArgList &  DriverArgs,
const JobAction JA,
const llvm::fltSemantics *  FPType = nullptr 
) const
inlinevirtual

Returns the output denormal handling type in the default floating point environment for the given FPType if given.

Otherwise, the default assumed mode for any floating point type.

Reimplemented in clang::driver::toolchains::CudaToolChain, clang::driver::toolchains::AMDGPUToolChain, clang::driver::toolchains::Linux, and clang::driver::toolchains::PS4PS5Base.

Definition at line 760 of file ToolChain.h.

Referenced by RenderFloatingPointOptions().

◆ GetDefaultDwarfVersion()

virtual unsigned clang::driver::ToolChain::GetDefaultDwarfVersion ( ) const
inlinevirtual

◆ getDefaultLinker()

virtual const char* clang::driver::ToolChain::getDefaultLinker ( ) const
inlinevirtual

◆ 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 757 of file ToolChain.cpp.

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

◆ GetDefaultRuntimeLibType()

virtual RuntimeLibType clang::driver::ToolChain::GetDefaultRuntimeLibType ( ) const
inlinevirtual

◆ getDefaultSanitizers()

virtual SanitizerMask clang::driver::ToolChain::getDefaultSanitizers ( ) const
inlinevirtual

Return sanitizers which are enabled by default.

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

Definition at line 749 of file ToolChain.h.

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

◆ GetDefaultStackProtectorLevel()

virtual LangOptions::StackProtectorMode clang::driver::ToolChain::GetDefaultStackProtectorLevel ( bool  KernelOrKext) const
inlinevirtual

GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain.

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

Definition at line 449 of file ToolChain.h.

References clang::LangOptions::SSPOff.

Referenced by RenderSSPOptions().

◆ GetDefaultStandaloneDebug()

virtual bool clang::driver::ToolChain::GetDefaultStandaloneDebug ( ) const
inlinevirtual

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

Definition at line 561 of file ToolChain.h.

Referenced by renderDebugOptions().

◆ GetDefaultTrivialAutoVarInit()

virtual LangOptions::TrivialAutoVarInitKind clang::driver::ToolChain::GetDefaultTrivialAutoVarInit ( ) const
inlinevirtual

Get the default trivial automatic variable initialization.

Definition at line 455 of file ToolChain.h.

References clang::LangOptions::Uninitialized.

Referenced by RenderTrivialAutoVarInitOptions().

◆ getDefaultUniversalArchName()

StringRef ToolChain::getDefaultUniversalArchName ( ) const

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

Definition at line 296 of file ToolChain.cpp.

References getTriple().

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

◆ GetDefaultUnwindLibType()

virtual UnwindLibType clang::driver::ToolChain::GetDefaultUnwindLibType ( ) const
inlinevirtual

Definition at line 471 of file ToolChain.h.

References UNW_None.

Referenced by GetUnwindLibType().

◆ getDefaultUnwindTableLevel()

ToolChain::UnwindTableLevel ToolChain::getDefaultUnwindTableLevel ( const llvm::opt::ArgList &  Args) const
virtual

◆ getDeviceLibs()

llvm::SmallVector< ToolChain::BitCodeLibraryInfo, 12 > ToolChain::getDeviceLibs ( const llvm::opt::ArgList &  Args) const
virtual

◆ getDriver()

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

Definition at line 236 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::PPCLinuxToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::MipsLLVMToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Linux::AddClangSystemIncludeArgs(), clang::driver::toolchains::RISCVToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::VEToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Solaris::AddClangSystemIncludeArgs(), clang::driver::toolchains::BareMetal::AddClangSystemIncludeArgs(), clang::driver::toolchains::FreeBSD::AddClangSystemIncludeArgs(), clang::driver::toolchains::NetBSD::AddClangSystemIncludeArgs(), clang::driver::toolchains::CrossWindowsToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::AIX::AddClangSystemIncludeArgs(), clang::driver::toolchains::OpenBSD::AddClangSystemIncludeArgs(), clang::driver::toolchains::MyriadToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HexagonToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::MSVCToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::Fuchsia::AddClangSystemIncludeArgs(), clang::driver::toolchains::DarwinClang::AddClangSystemIncludeArgs(), clang::driver::toolchains::AMDGPUOpenMPToolChain::addClangTargetOptions(), clang::driver::toolchains::ROCMToolChain::addClangTargetOptions(), clang::driver::toolchains::CudaToolChain::addClangTargetOptions(), clang::driver::toolchains::HIPSPVToolChain::AddHIPIncludeArgs(), clang::driver::toolchains::Haiku::addLibCxxIncludePaths(), clang::driver::toolchains::CloudABI::addLibCxxIncludePaths(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::NetBSD::addLibCxxIncludePaths(), clang::driver::toolchains::FreeBSD::addLibCxxIncludePaths(), clang::driver::toolchains::OpenBSD::addLibCxxIncludePaths(), clang::driver::toolchains::MyriadToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::HexagonToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibCxxIncludePaths(), clang::driver::toolchains::Haiku::addLibStdCxxIncludePaths(), clang::driver::toolchains::NetBSD::addLibStdCxxIncludePaths(), clang::driver::toolchains::FreeBSD::addLibStdCxxIncludePaths(), clang::driver::toolchains::HexagonToolChain::addLibStdCxxIncludePaths(), clang::driver::toolchains::DarwinClang::AddLinkARCArgs(), clang::driver::tools::addLinkerCompressDebugSectionsOption(), clang::driver::toolchains::MachO::AddLinkRuntimeLib(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), addPgProfilingLinkArgs(), clang::driver::tools::ClangAs::AddX86TargetArgs(), clang::driver::toolchains::AIX::AIX(), clang::driver::toolchains::AMDGPUOpenMPToolChain::AMDGPUOpenMPToolChain(), clang::driver::toolchains::Ananas::Ananas(), clang::driver::toolchains::BareMetal::BareMetal(), clang::driver::toolchains::MSVCToolChain::buildAssembler(), clang::driver::toolchains::Darwin::CheckObjCARC(), clang::driver::toolchains::HIPAMDToolChain::checkTargetID(), clang::driver::toolchains::AMDGPUToolChain::checkTargetID(), clang::driver::toolchains::CloudABI::CloudABI(), CollectARMPACBTIOptions(), ComputeLLVMTriple(), clang::driver::toolchains::MipsLLVMToolChain::computeSysRoot(), clang::driver::toolchains::Linux::computeSysRoot(), clang::driver::toolchains::BareMetal::computeSysRoot(), constructHexagonLinkArgs(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::aix::Linker::ConstructJob(), clang::driver::tools::ananas::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::PScpu::Linker::ConstructJob(), clang::driver::tools::CSKY::Linker::ConstructJob(), clang::driver::tools::RISCV::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::msp430::Linker::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::OffloadPackager::ConstructJob(), clang::driver::tools::LinkerWrapper::ConstructJob(), clang::driver::toolchains::DragonFly::DragonFly(), clang::driver::CC1Command::Execute(), clang::driver::toolchains::AVRToolChain::findAVRLibcInstallation(), clang::driver::toolchains::FreeBSD::FreeBSD(), clang::driver::toolchains::Fuchsia::Fuchsia(), clang::driver::toolchains::Generic_GCC::Generic_GCC(), getArchSpecificLibPath(), clang::driver::toolchains::ROCMToolChain::getCommonDeviceLibNames(), clang::driver::toolchains::MipsLLVMToolChain::getCompilerRT(), clang::driver::toolchains::OpenBSD::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::AMDGPUOpenMPToolChain::getDeviceLibs(), clang::driver::toolchains::HIPSPVToolChain::getDeviceLibs(), clang::driver::toolchains::HIPAMDToolChain::getDeviceLibs(), clang::driver::toolchains::Linux::getDynamicLinker(), clang::driver::toolchains::CudaToolChain::getInputFilename(), clang::driver::tools::wasm::Linker::getLinkerPath(), GetLinkerPath(), clang::driver::toolchains::MachO::getLinkerVersion(), clang::driver::toolchains::Fuchsia::GetRuntimeLibType(), clang::driver::toolchains::DarwinClang::GetRuntimeLibType(), GetRuntimeLibType(), getStaticPIE(), GetUnwindLibType(), getVFS(), clang::driver::toolchains::HIPAMDToolChain::HIPAMDToolChain(), clang::driver::toolchains::HIPSPVToolChain::HIPSPVToolChain(), clang::driver::toolchains::MachO::MachO(), clang::driver::toolchains::MinGW::MinGW(), clang::driver::toolchains::Minix::Minix(), clang::driver::toolchains::MSVCToolChain::MSVCToolChain(), clang::driver::toolchains::NaClToolChain::NaClToolChain(), clang::driver::toolchains::OpenBSD::OpenBSD(), ParseDebugDefaultVersion(), clang::driver::SanitizerArgs::SanitizerArgs(), SelectTool(), SetRISCVSmallDataLimit(), ShouldLinkCXXStdlib(), shouldSkipSanitizeOption(), clang::driver::toolchains::TCEToolChain::TCEToolChain(), clang::driver::toolchains::HLSLToolChain::TranslateArgs(), clang::driver::toolchains::AMDGPUOpenMPToolChain::TranslateArgs(), clang::driver::toolchains::MSVCToolChain::TranslateArgs(), clang::driver::toolchains::HIPAMDToolChain::TranslateArgs(), clang::driver::toolchains::AMDGPUToolChain::TranslateArgs(), clang::driver::toolchains::CudaToolChain::TranslateArgs(), clang::driver::toolchains::MachO::TranslateArgs(), clang::driver::toolchains::Generic_GCC::TranslateArgs(), clang::driver::toolchains::Darwin::TranslateArgs(), TranslateOpenMPTargetArgs(), TranslateXarchArgs(), and clang::driver::XRayArgs::XRayArgs().

◆ getEffectiveTriple()

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

◆ GetExceptionModel()

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

◆ GetFilePath()

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

◆ getFilePaths() [1/2]

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

◆ getFilePaths() [2/2]

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

Definition at line 279 of file ToolChain.h.

◆ GetGlobalDebugPathRemapping()

virtual std::string clang::driver::ToolChain::GetGlobalDebugPathRemapping ( ) const
inlinevirtual

Add an additional -fdebug-prefix-map entry.

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

Definition at line 546 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 321 of file ToolChain.cpp.

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

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

◆ getLibraryPaths() [1/2]

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

◆ getLibraryPaths() [2/2]

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

Definition at line 276 of file ToolChain.h.

◆ GetLinkerPath()

std::string ToolChain::GetLinkerPath ( bool LinkerIsLLD = nullptr) const

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

If LinkerIsLLD is non-nullptr, it is set to true if the returned linker is LLD. If it's set, it can be assumed that the linker is LLD built at the same revision as clang, and clang can make assumptions about LLD's supported flags, error output, etc.

Definition at line 646 of file ToolChain.cpp.

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

Referenced by constructHexagonLinkArgs(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::aix::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(), and clang::driver::tools::gnutools::Linker::ConstructJob().

◆ getMaxDwarfVersion()

virtual unsigned clang::driver::ToolChain::getMaxDwarfVersion ( ) const
inlinevirtual

Reimplemented in clang::driver::toolchains::NVPTXToolChain.

Definition at line 555 of file ToolChain.h.

References UINT_MAX.

Referenced by renderDebugOptions().

◆ getMultiarchTriple()

virtual std::string clang::driver::ToolChain::getMultiarchTriple ( const Driver D,
const llvm::Triple &  TargetTriple,
StringRef  SysRoot 
) const
inlinevirtual

Reimplemented in clang::driver::toolchains::Hurd, and clang::driver::toolchains::Linux.

Definition at line 593 of file ToolChain.h.

◆ getMultilib()

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

Definition at line 286 of file ToolChain.h.

References SelectedMultilib.

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

◆ getMultilibs()

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

Definition at line 284 of file ToolChain.h.

References Multilibs.

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

◆ getOpenMPTriple()

static llvm::Triple clang::driver::ToolChain::getOpenMPTriple ( StringRef  TripleStr)
inlinestatic

◆ getOS()

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

◆ getOSLibName()

StringRef ToolChain::getOSLibName ( ) const
virtual

Reimplemented in clang::driver::toolchains::BareMetal.

Definition at line 470 of file ToolChain.cpp.

References getOS().

Referenced by getArchSpecificLibPath(), and getCompilerRTPath().

◆ getPlatform()

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

Definition at line 254 of file ToolChain.h.

◆ GetProgramPath()

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

◆ getProgramPaths() [1/2]

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

◆ getProgramPaths() [2/2]

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

Definition at line 282 of file ToolChain.h.

◆ getRTTIArg()

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

Definition at line 293 of file ToolChain.h.

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

◆ getRTTIMode()

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

Definition at line 296 of file ToolChain.h.

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

◆ GetRuntimeLibType()

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

◆ getRuntimePaths()

ToolChain::path_list ToolChain::getRuntimePaths ( ) const

Definition at line 571 of file ToolChain.cpp.

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

◆ getSanitizerArgs()

SanitizerArgs ToolChain::getSanitizerArgs ( const llvm::opt::ArgList &  JobArgs) const

◆ GetStaticLibToolPath()

std::string ToolChain::GetStaticLibToolPath ( ) const

Returns the linker path for emitting a static library.

Definition at line 718 of file ToolChain.cpp.

References GetProgramPath().

◆ getStdlibPaths()

ToolChain::path_list ToolChain::getStdlibPaths ( ) const

◆ 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::PS5CPU, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::OpenBSD, clang::driver::toolchains::PS4PS5Base, clang::driver::toolchains::MyriadToolChain, clang::driver::toolchains::FreeBSD, clang::driver::toolchains::HIPAMDToolChain, clang::driver::toolchains::NetBSD, clang::driver::toolchains::CrossWindowsToolChain, clang::driver::toolchains::MinGW, clang::driver::toolchains::Fuchsia, clang::driver::toolchains::HIPSPVToolChain, clang::driver::toolchains::Solaris, clang::driver::toolchains::CloudABI, clang::driver::toolchains::AMDGPUOpenMPToolChain, clang::driver::toolchains::Linux, and clang::driver::toolchains::Contiki.

Definition at line 1122 of file ToolChain.cpp.

References getTriple().

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

◆ getSystemGPUArchs()

Expected< SmallVector< std::string > > ToolChain::getSystemGPUArchs ( const llvm::opt::ArgList &  Args) const
virtual

getSystemGPUArchs - Use a tool to detect the user's availible GPUs.

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

Definition at line 1118 of file ToolChain.cpp.

◆ 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
ProgNameThe 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 272 of file ToolChain.cpp.

References normalizeProgramName(), parseDriverSuffix(), and string().

Referenced by clang::tooling::addTargetAndModeForProgramName(), and clang::driver::getDriverMode().

◆ getThreadModel()

virtual std::string clang::driver::ToolChain::getThreadModel ( ) const
inlinevirtual

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

Definition at line 585 of file ToolChain.h.

Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::Driver::PrintVersion().

◆ getTool()

Tool * ToolChain::getTool ( Action::ActionClass  AC) const
protectedvirtual

◆ getTriple()

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

Definition at line 238 of file ToolChain.h.

Referenced by clang::driver::SanitizerArgs::addArgs(), clang::driver::toolchains::DarwinClang::AddClangCXXStdlibIncludeArgs(), clang::driver::toolchains::Hurd::AddClangSystemIncludeArgs(), clang::driver::toolchains::Linux::AddClangSystemIncludeArgs(), clang::driver::toolchains::NaClToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HexagonToolChain::AddClangSystemIncludeArgs(), clang::driver::toolchains::HexagonToolChain::addClangTargetOptions(), clang::driver::toolchains::NetBSD::addClangTargetOptions(), clang::driver::toolchains::FreeBSD::addClangTargetOptions(), clang::driver::toolchains::CudaToolChain::addClangTargetOptions(), clang::driver::toolchains::DarwinClang::addClangWarningOptions(), clang::driver::toolchains::FreeBSD::AddCXXStdlibLibArgs(), addExceptionArgs(), clang::driver::tools::addFortranRuntimeLibs(), addIncludeLinkerOption(), clang::driver::toolchains::CloudABI::addLibCxxIncludePaths(), clang::driver::toolchains::NaClToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::HexagonToolChain::addLibCxxIncludePaths(), clang::driver::toolchains::Generic_GCC::addLibCxxIncludePaths(), clang::driver::toolchains::Haiku::addLibStdCxxIncludePaths(), clang::driver::toolchains::DarwinClang::AddLinkARCArgs(), clang::driver::toolchains::DarwinClang::AddLinkRuntimeLibArgs(), clang::driver::tools::ClangAs::AddMIPSTargetArgs(), addPGOAndCoverageFlags(), clang::driver::toolchains::Darwin::addPlatformVersionArgs(), clang::driver::tools::ClangAs::AddRISCVTargetArgs(), addSanitizerDynamicList(), AddUnwindLibrary(), clang::driver::toolchains::NaClToolChain::buildAssembler(), clang::driver::toolchains::MSVCToolChain::buildAssembler(), clang::driver::Driver::BuildCompilation(), buildCompilerRTBasename(), clang::driver::toolchains::AVRToolChain::buildLinker(), clang::driver::toolchains::HIPAMDToolChain::buildLinker(), clang::driver::toolchains::HIPSPVToolChain::buildLinker(), clang::driver::toolchains::CloudABI::CloudABI(), collectSanitizerRuntimes(), ComputeLLVMTriple(), clang::driver::toolchains::MSVCToolChain::computeMSVCVersion(), clang::driver::toolchains::Linux::computeSysRoot(), constructHexagonLinkArgs(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::aix::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::CrossWindows::Linker::ConstructJob(), clang::driver::tools::PScpu::Linker::ConstructJob(), clang::driver::tools::Myriad::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::OffloadBundler::ConstructJob(), clang::driver::tools::OffloadPackager::ConstructJob(), clang::driver::tools::LinkerWrapper::ConstructJob(), clang::driver::Driver::ConstructPhaseAction(), clang::driver::Driver::CreateOffloadingDeviceToolChains(), defaultToIEEELongDouble(), clang::driver::Driver::generateCompilationDiagnostics(), getArchNameForCompilerRTLib(), clang::driver::Compilation::getArgsForToolChain(), clang::driver::tools::getAsNeededOption(), clang::driver::toolchains::AMDGPUOpenMPToolChain::getAuxTriple(), clang::driver::toolchains::HIPSPVToolChain::getAuxTriple(), clang::driver::toolchains::HIPAMDToolChain::getAuxTriple(), clang::driver::toolchains::CudaToolChain::getAuxTriple(), clang::driver::toolchains::HexagonToolChain::GetCXXStdlibType(), clang::driver::toolchains::Linux::GetDefaultCXXStdlibType(), clang::driver::toolchains::NetBSD::GetDefaultCXXStdlibType(), clang::driver::toolchains::FreeBSD::GetDefaultCXXStdlibType(), clang::driver::toolchains::Linux::getDefaultDenormalModeForType(), clang::driver::toolchains::AMDGPUToolChain::getDefaultDenormalModeForType(), clang::driver::toolchains::Linux::GetDefaultDwarfVersion(), clang::driver::toolchains::FreeBSD::GetDefaultDwarfVersion(), clang::driver::toolchains::Linux::getDefaultLinker(), clang::driver::toolchains::Linux::GetDefaultRuntimeLibType(), clang::driver::toolchains::Fuchsia::getDefaultSanitizers(), getDefaultUniversalArchName(), clang::driver::toolchains::MSVCToolChain::getDefaultUnwindTableLevel(), clang::driver::toolchains::AMDGPUOpenMPToolChain::getDeviceLibs(), clang::driver::toolchains::HIPSPVToolChain::getDeviceLibs(), clang::driver::toolchains::Linux::getDynamicLinker(), clang::driver::toolchains::NetBSD::GetExceptionModel(), clang::driver::toolchains::FreeBSD::GetExceptionModel(), clang::driver::toolchains::Darwin::GetExceptionModel(), clang::driver::toolchains::AMDGPUToolChain::getGPUArch(), getLibGccType(), clang::driver::toolchains::MachO::getMachOArchName(), clang::driver::Driver::GetNamedOutputPath(), clang::driver::Driver::getOffloadArchs(), clang::driver::toolchains::AMDGPUToolChain::getParsedTargetID(), clang::driver::tools::GetSDLFromOffloadArchive(), clang::driver::toolchains::Contiki::getSupportedSanitizers(), clang::driver::toolchains::Linux::getSupportedSanitizers(), clang::driver::toolchains::Solaris::getSupportedSanitizers(), clang::driver::toolchains::NetBSD::getSupportedSanitizers(), clang::driver::toolchains::FreeBSD::getSupportedSanitizers(), clang::driver::toolchains::Darwin::getSupportedSanitizers(), getSupportedSanitizers(), GetTriplePlusArchString(), GetUnwindLibType(), clang::driver::toolchains::HIPAMDToolChain::HIPAMDToolChain(), clang::driver::toolchains::Linux::IsAArch64OutlineAtomicsDefault(), 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::MinGW::MinGW(), clang::driver::SanitizerArgs::SanitizerArgs(), clang::driver::toolchains::MyriadToolChain::SelectTool(), SetRISCVSmallDataLimit(), ShouldEnableAutolink(), shouldSkipSanitizeOption(), clang::driver::toolchains::MachO::SupportsProfiling(), clang::driver::toolchains::AMDGPUToolChain::TranslateArgs(), and clang::driver::XRayArgs::XRayArgs().

◆ getTripleString()

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

◆ GetUnwindLibType()

ToolChain::UnwindLibType ToolChain::GetUnwindLibType ( const llvm::opt::ArgList &  Args) const
virtual

◆ getVFS()

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

◆ getXRayArgs()

const XRayArgs & ToolChain::getXRayArgs ( ) const

◆ hasBlocksRuntime()

virtual bool clang::driver::ToolChain::hasBlocksRuntime ( ) const
inlinevirtual

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, clang::driver::toolchains::XCoreToolChain, and clang::driver::toolchains::VEToolChain.

Definition at line 625 of file ToolChain.h.

◆ hasEffectiveTriple()

bool clang::driver::ToolChain::hasEffectiveTriple ( ) const
inline

Definition at line 271 of file ToolChain.h.

◆ HasNativeLLVMSupport()

bool ToolChain::HasNativeLLVMSupport ( ) const
virtual

◆ IsAArch64OutlineAtomicsDefault()

virtual bool clang::driver::ToolChain::IsAArch64OutlineAtomicsDefault ( const llvm::opt::ArgList &  Args) const
inlinevirtual

Test whether this toolchain supports outline atomics by default.

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

Definition at line 514 of file ToolChain.h.

◆ isBareMetal()

virtual bool clang::driver::ToolChain::isBareMetal ( ) const
inlinevirtual

isBareMetal - Is this a bare metal target.

Reimplemented in clang::driver::toolchains::BareMetal.

Definition at line 591 of file ToolChain.h.

Referenced by getArchNameForCompilerRTLib(), and getCompilerRTPath().

◆ IsBlocksDefault()

virtual bool clang::driver::ToolChain::IsBlocksDefault ( ) const
inlinevirtual

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

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

Definition at line 397 of file ToolChain.h.

◆ isCrossCompiling()

bool ToolChain::isCrossCompiling ( ) const
virtual

◆ IsEncodeExtendedBlockSignatureDefault()

virtual bool clang::driver::ToolChain::IsEncodeExtendedBlockSignatureDefault ( ) const
inlinevirtual

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

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

Definition at line 430 of file ToolChain.h.

◆ isFastMathRuntimeAvailable()

bool ToolChain::isFastMathRuntimeAvailable ( const llvm::opt::ArgList &  Args,
std::string Path 
) const
virtual

If a runtime library exists that sets global flags for unsafe floating point math, return true.

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

Definition at line 1086 of file ToolChain.cpp.

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

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

◆ IsIntegratedAssemblerDefault()

virtual bool clang::driver::ToolChain::IsIntegratedAssemblerDefault ( ) const
inlinevirtual

◆ IsIntegratedBackendDefault()

virtual bool clang::driver::ToolChain::IsIntegratedBackendDefault ( ) const
inlinevirtual

IsIntegratedBackendDefault - Does this tool chain enable -fintegrated-objemitter by default.

Reimplemented in clang::driver::toolchains::SPIRVToolChain.

Definition at line 405 of file ToolChain.h.

Referenced by useIntegratedBackend().

◆ IsIntegratedBackendSupported()

virtual bool clang::driver::ToolChain::IsIntegratedBackendSupported ( ) const
inlinevirtual

IsIntegratedBackendSupported - Does this tool chain support -fintegrated-objemitter.

Definition at line 409 of file ToolChain.h.

Referenced by useIntegratedBackend().

◆ IsMathErrnoDefault()

virtual bool clang::driver::ToolChain::IsMathErrnoDefault ( ) const
inlinevirtual

◆ IsNonIntegratedBackendSupported()

virtual bool clang::driver::ToolChain::IsNonIntegratedBackendSupported ( ) const
inlinevirtual

IsNonIntegratedBackendSupported - Does this tool chain support -fno-integrated-objemitter.

Reimplemented in clang::driver::toolchains::SPIRVToolChain.

Definition at line 413 of file ToolChain.h.

Referenced by useIntegratedBackend().

◆ IsObjCNonFragileABIDefault()

virtual bool clang::driver::ToolChain::IsObjCNonFragileABIDefault ( ) const
inlinevirtual

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

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

Definition at line 434 of file ToolChain.h.

◆ isPICDefault()

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

◆ isPICDefaultForced()

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

◆ isPIEDefault()

virtual bool clang::driver::ToolChain::isPIEDefault ( const llvm::opt::ArgList &  Args) const
pure virtual

◆ isThreadModelSupported()

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

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

Definition at line 767 of file ToolChain.cpp.

Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::Driver::PrintVersion().

◆ 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 725 of file ToolChain.cpp.

References clang::driver::Driver::IsFlangMode(), and clang::driver::types::lookupTypeForExtension().

Referenced by clang::driver::Driver::BuildInputs(), and clang::driver::toolchains::MachO::LookupTypeForExtension().

◆ needsGCovInstrumentation()

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

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

Definition at line 623 of file ToolChain.cpp.

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

◆ needsProfileRT()

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

◆ parseInlineAsmUsingAsmParser()

virtual bool clang::driver::ToolChain::parseInlineAsmUsingAsmParser ( ) const
inlinevirtual

Check if the toolchain should use AsmParser to parse inlineAsm when integrated assembler is not default.

Reimplemented in clang::driver::toolchains::AIX.

Definition at line 423 of file ToolChain.h.

◆ printVerboseInfo()

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

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 380 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, and clang::driver::toolchains::SPIRVToolChain.

Definition at line 629 of file ToolChain.cpp.

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

Referenced by clang::driver::toolchains::MyriadToolChain::SelectTool().

◆ setTripleEnvironment()

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

Definition at line 119 of file ToolChain.cpp.

◆ ShouldLinkCXXStdlib()

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

◆ supportsDebugInfoOption()

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

Does this toolchain supports given debug info option or not.

Reimplemented in clang::driver::toolchains::NVPTXToolChain.

Definition at line 569 of file ToolChain.h.

Referenced by checkDebugInfoOption().

◆ SupportsEmbeddedBitcode()

virtual bool clang::driver::ToolChain::SupportsEmbeddedBitcode ( ) const
inlinevirtual

SupportsEmbeddedBitcode - Does this tool chain support embedded bitcode.

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

Definition at line 582 of file ToolChain.h.

◆ SupportsProfiling()

virtual bool clang::driver::ToolChain::SupportsProfiling ( ) const
inlinevirtual

◆ TranslateArgs()

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

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::NVPTXToolChain, clang::driver::toolchains::AMDGPUToolChain, clang::driver::toolchains::HIPAMDToolChain, clang::driver::toolchains::MSVCToolChain, clang::driver::toolchains::AMDGPUOpenMPToolChain, and clang::driver::toolchains::HLSLToolChain.

Definition at line 325 of file ToolChain.h.

Referenced by clang::driver::Compilation::getArgsForToolChain(), clang::driver::toolchains::AMDGPUOpenMPToolChain::TranslateArgs(), clang::driver::toolchains::HIPAMDToolChain::TranslateArgs(), clang::driver::toolchains::NVPTXToolChain::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 1215 of file ToolChain.cpp.

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

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

◆ TranslateXarchArgs() [1/2]

void ToolChain::TranslateXarchArgs ( const llvm::opt::DerivedArgList &  Args,
llvm::opt::Arg *&  A,
llvm::opt::DerivedArgList *  DAL,
SmallVectorImpl< llvm::opt::Arg * > *  AllocatedArgs = nullptr 
) const
virtual

Append the argument following A to DAL assuming A is an Xarch argument.

If AllocatedArgs is null pointer, synthesized arguments are added to DAL, otherwise they are appended to AllocatedArgs.

Definition at line 1287 of file ToolChain.cpp.

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

Referenced by clang::driver::Compilation::getArgsForToolChain(), clang::driver::toolchains::MachO::TranslateArgs(), and TranslateXarchArgs().

◆ TranslateXarchArgs() [2/2]

llvm::opt::DerivedArgList * ToolChain::TranslateXarchArgs ( const llvm::opt::DerivedArgList &  Args,
StringRef  BoundArch,
Action::OffloadKind  DeviceOffloadKind,
SmallVectorImpl< llvm::opt::Arg * > *  AllocatedArgs 
) const
virtual

Translate -Xarch_ arguments.

If there are no such arguments, return a null pointer, otherwise return a DerivedArgList containing the translated arguments.

Definition at line 1329 of file ToolChain.cpp.

References clang::driver::Action::OFK_Host, clang::driver::Action::OFK_None, and TranslateXarchArgs().

◆ UseDwarfDebugFlags()

virtual bool clang::driver::ToolChain::UseDwarfDebugFlags ( ) const
inlinevirtual

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

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

Definition at line 543 of file ToolChain.h.

◆ useIntegratedAs()

bool ToolChain::useIntegratedAs ( ) const
virtual

◆ useIntegratedBackend()

bool ToolChain::useIntegratedBackend ( ) const
virtual

Check if the toolchain should use the integrated backend.

Definition at line 137 of file ToolChain.cpp.

References clang::driver::Driver::Diag(), IsIntegratedBackendDefault(), IsIntegratedBackendSupported(), and IsNonIntegratedBackendSupported().

◆ UseObjCMixedDispatch()

virtual bool clang::driver::ToolChain::UseObjCMixedDispatch ( ) const
inlinevirtual

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 438 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::PS4PS5Base, and clang::driver::toolchains::Fuchsia.

Definition at line 165 of file ToolChain.cpp.

Friends And Related Function Documentation

◆ RegisterEffectiveTriple

friend class RegisterEffectiveTriple
friend

Definition at line 132 of file ToolChain.h.

Member Data Documentation

◆ Multilibs

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

◆ SelectedMultilib

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

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