clang
3.9.0
|
#include "Tools.h"
#include "InputInfo.h"
#include "ToolChains.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/ObjCRuntime.h"
#include "clang/Basic/Version.h"
#include "clang/Config/config.h"
#include "clang/Driver/Action.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Job.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/SanitizerArgs.h"
#include "clang/Driver/ToolChain.h"
#include "clang/Driver/Util.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/Compression.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/TargetParser.h"
Go to the source code of this file.
Enumerations | |
enum | OpenMPRuntimeKind |
Functions | |
static void | handleTargetFeaturesGroup (const ArgList &Args, std::vector< const char * > &Features, OptSpecifier Group) |
static const char * | getSparcAsmModeForCPU (StringRef Name, const llvm::Triple &Triple) |
static void | CheckPreprocessingOptions (const Driver &D, const ArgList &Args) |
CheckPreprocessingOptions - Perform some validation of preprocessing arguments that is shared with gcc. More... | |
static void | CheckCodeGenerationOptions (const Driver &D, const ArgList &Args) |
CheckCodeGenerationOptions - Perform some validation of code generation arguments that is shared with gcc. More... | |
static void | EscapeSpacesAndBackslashes (const char *Arg, SmallVectorImpl< char > &Res) |
static void | QuoteTarget (StringRef Target, SmallVectorImpl< char > &Res) |
static void | addDirectoryList (const ArgList &Args, ArgStringList &CmdArgs, const char *ArgName, const char *EnvVar) |
static void | AddLinkerInputs (const ToolChain &TC, const InputInfoList &Inputs, const ArgList &Args, ArgStringList &CmdArgs) |
static bool | isObjCAutoRefCount (const ArgList &Args) |
Determine whether Objective-C automated reference counting is enabled. More... | |
static bool | isObjCRuntimeLinked (const ArgList &Args) |
Determine whether we are linking the ObjC runtime. More... | |
static bool | forwardToGCC (const Option &O) |
static void | addExtraOffloadCXXStdlibIncludeArgs (Compilation &C, const JobAction &JA, const ArgList &Args, ArgStringList &CmdArgs) |
Add the C++ include args of other offloading toolchains. More... | |
static void | addExtraOffloadSpecificIncludeArgs (Compilation &C, const JobAction &JA, const ArgList &Args, ArgStringList &CmdArgs) |
Add the include args that are specific of each offloading programming model. More... | |
static bool | isSignedCharDefault (const llvm::Triple &Triple) |
static bool | isNoCommonDefault (const llvm::Triple &Triple) |
static int | getARMSubArchVersionNumber (const llvm::Triple &Triple) |
static bool | isARMMProfile (const llvm::Triple &Triple) |
static void | getARMArchCPUFromArgs (const ArgList &Args, llvm::StringRef &Arch, llvm::StringRef &CPU, bool FromAs=false) |
static void | getARMHWDivFeatures (const Driver &D, const Arg *A, const ArgList &Args, StringRef HWDiv, std::vector< const char * > &Features) |
static void | getARMFPUFeatures (const Driver &D, const Arg *A, const ArgList &Args, StringRef FPU, std::vector< const char * > &Features) |
static bool | DecodeARMFeatures (const Driver &D, StringRef text, std::vector< const char * > &Features) |
static void | checkARMArchName (const Driver &D, const Arg *A, const ArgList &Args, llvm::StringRef ArchName, std::vector< const char * > &Features, const llvm::Triple &Triple) |
static void | checkARMCPUName (const Driver &D, const Arg *A, const ArgList &Args, llvm::StringRef CPUName, llvm::StringRef ArchName, std::vector< const char * > &Features, const llvm::Triple &Triple) |
static bool | useAAPCSForMachO (const llvm::Triple &T) |
static void | getARMTargetFeatures (const ToolChain &TC, const llvm::Triple &Triple, const ArgList &Args, std::vector< const char * > &Features, bool ForAS) |
static std::string | getAArch64TargetCPU (const ArgList &Args) |
getAArch64TargetCPU - Get the (LLVM) name of the AArch64 cpu we are targeting. More... | |
static StringRef | getGnuCompatibleMipsABIName (StringRef ABI) |
static mips::FloatABI | getMipsFloatABI (const Driver &D, const ArgList &Args) |
static void | AddTargetFeature (const ArgList &Args, std::vector< const char * > &Features, OptSpecifier OnOpt, OptSpecifier OffOpt, StringRef FeatureName) |
static void | getMIPSTargetFeatures (const Driver &D, const llvm::Triple &Triple, const ArgList &Args, std::vector< const char * > &Features) |
static std::string | getPPCTargetCPU (const ArgList &Args) |
getPPCTargetCPU - Get the (LLVM) name of the PowerPC cpu we are targeting. More... | |
static void | getPPCTargetFeatures (const Driver &D, const llvm::Triple &Triple, const ArgList &Args, std::vector< const char * > &Features) |
static std::string | getR600TargetGPU (const ArgList &Args) |
Get the (LLVM) name of the R600 gpu we are targeting. More... | |
static std::string | getLanaiTargetCPU (const ArgList &Args) |
static void | getSparcTargetFeatures (const Driver &D, const ArgList &Args, std::vector< const char * > &Features) |
static const char * | getSystemZTargetCPU (const ArgList &Args) |
static void | getSystemZTargetFeatures (const ArgList &Args, std::vector< const char * > &Features) |
static const char * | getX86TargetCPU (const ArgList &Args, const llvm::Triple &Triple) |
static StringRef | getWebAssemblyTargetCPU (const ArgList &Args) |
Get the (LLVM) name of the WebAssembly cpu we are targeting. More... | |
static std::string | getCPUName (const ArgList &Args, const llvm::Triple &T, bool FromAs=false) |
static void | AddGoldPlugin (const ToolChain &ToolChain, const ArgList &Args, ArgStringList &CmdArgs, bool IsThinLTO) |
static bool | getRefinementStep (StringRef In, const Driver &D, const Arg &A, size_t &Position) |
This is a helper function for validating the optional refinement step parameter in reciprocal argument strings. More... | |
static void | ParseMRecip (const Driver &D, const ArgList &Args, ArgStringList &OutStrings) |
The -mrecip flag requires processing of many optional parameters. More... | |
static void | getX86TargetFeatures (const Driver &D, const llvm::Triple &Triple, const ArgList &Args, std::vector< const char * > &Features) |
static bool | DecodeAArch64Features (const Driver &D, StringRef text, std::vector< const char * > &Features) |
static bool | DecodeAArch64Mcpu (const Driver &D, StringRef Mcpu, StringRef &CPU, std::vector< const char * > &Features) |
static bool | getAArch64ArchFeaturesFromMarch (const Driver &D, StringRef March, const ArgList &Args, std::vector< const char * > &Features) |
static bool | getAArch64ArchFeaturesFromMcpu (const Driver &D, StringRef Mcpu, const ArgList &Args, std::vector< const char * > &Features) |
static bool | getAArch64MicroArchFeaturesFromMtune (const Driver &D, StringRef Mtune, const ArgList &Args, std::vector< const char * > &Features) |
static bool | getAArch64MicroArchFeaturesFromMcpu (const Driver &D, StringRef Mcpu, const ArgList &Args, std::vector< const char * > &Features) |
static void | getAArch64TargetFeatures (const Driver &D, const ArgList &Args, std::vector< const char * > &Features) |
static void | getHexagonTargetFeatures (const ArgList &Args, std::vector< const char * > &Features) |
static void | getWebAssemblyTargetFeatures (const ArgList &Args, std::vector< const char * > &Features) |
static void | getAMDGPUTargetFeatures (const Driver &D, const ArgList &Args, std::vector< const char * > &Features) |
static void | getTargetFeatures (const ToolChain &TC, const llvm::Triple &Triple, const ArgList &Args, ArgStringList &CmdArgs, bool ForAS) |
static bool | shouldUseExceptionTablesForObjCExceptions (const ObjCRuntime &runtime, const llvm::Triple &Triple) |
static void | addExceptionArgs (const ArgList &Args, types::ID InputType, const ToolChain &TC, bool KernelOrKext, const ObjCRuntime &objcRuntime, ArgStringList &CmdArgs) |
Adds exception related arguments to the driver command arguments. More... | |
static bool | ShouldDisableAutolink (const ArgList &Args, const ToolChain &TC) |
static bool | ShouldDisableDwarfDirectory (const ArgList &Args, const ToolChain &TC) |
static bool | ContainsCompileAction (const Action *A) |
Check whether the given input tree contains any compilation actions. More... | |
static bool | UseRelaxAll (Compilation &C, const ArgList &Args) |
Check if -relax-all should be passed to the internal assembler. More... | |
static codegenoptions::DebugInfoKind | DebugLevelToInfoKind (const Arg &A) |
static unsigned | DwarfVersionNum (StringRef ArgValue) |
static void | RenderDebugEnablingArgs (const ArgList &Args, ArgStringList &CmdArgs, codegenoptions::DebugInfoKind DebugInfoKind, unsigned DwarfVersion, llvm::DebuggerKind DebuggerTuning) |
static void | CollectArgsForIntegratedAssembler (Compilation &C, const ArgList &Args, ArgStringList &CmdArgs, const Driver &D) |
static void | addClangRT (const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) |
static OpenMPRuntimeKind | getOpenMPRuntime (const ToolChain &TC, const ArgList &Args) |
Compute the desired OpenMP runtime from the flag provided. More... | |
static void | addOpenMPRuntime (ArgStringList &CmdArgs, const ToolChain &TC, const ArgList &Args) |
static void | addSanitizerRuntime (const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs, StringRef Sanitizer, bool IsShared, bool IsWhole) |
static bool | addSanitizerDynamicList (const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs, StringRef Sanitizer) |
static void | linkSanitizerRuntimeDeps (const ToolChain &TC, ArgStringList &CmdArgs) |
static void | collectSanitizerRuntimes (const ToolChain &TC, const ArgList &Args, SmallVectorImpl< StringRef > &SharedRuntimes, SmallVectorImpl< StringRef > &StaticRuntimes, SmallVectorImpl< StringRef > &NonWholeStaticRuntimes, SmallVectorImpl< StringRef > &HelperStaticRuntimes, SmallVectorImpl< StringRef > &RequiredSymbols) |
static bool | addSanitizerRuntimes (const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) |
static bool | addXRayRuntime (const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) |
static void | linkXRayRuntimeDeps (const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) |
static bool | areOptimizationsEnabled (const ArgList &Args) |
static bool | shouldUseFramePointerForTarget (const ArgList &Args, const llvm::Triple &Triple) |
static bool | shouldUseFramePointer (const ArgList &Args, const llvm::Triple &Triple) |
static bool | shouldUseLeafFramePointer (const ArgList &Args, const llvm::Triple &Triple) |
static void | addDebugCompDirArg (const ArgList &Args, ArgStringList &CmdArgs) |
Add a CC1 option to specify the debug compilation directory. More... | |
static const char * | SplitDebugName (const ArgList &Args, const InputInfo &Input) |
static void | SplitDebugInfo (const ToolChain &TC, Compilation &C, const Tool &T, const JobAction &JA, const ArgList &Args, const InputInfo &Output, const char *OutFile) |
static bool | shouldEnableVectorizerAtOLevel (const ArgList &Args, bool isSlpVec) |
Vectorize at all optimization levels greater than 1 except for -Oz. More... | |
static void | addDashXForInput (const ArgList &Args, const InputInfo &Input, ArgStringList &CmdArgs) |
Add -x lang to CmdArgs for Input . More... | |
static VersionTuple | getMSCompatibilityVersion (unsigned Version) |
static void | claimNoWarnArgs (const ArgList &Args) |
static void | appendUserToPath (SmallVectorImpl< char > &Result) |
static void | addPGOAndCoverageFlags (Compilation &C, const Driver &D, const InputInfo &Output, const ArgList &Args, ArgStringList &CmdArgs) |
static void | addPS4ProfileRTArgs (const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) |
static std::tuple < llvm::Reloc::Model, unsigned, bool > | ParsePICArgs (const ToolChain &ToolChain, const llvm::Triple &Triple, const ArgList &Args) |
Parses the various -fpic/-fPIC/-fpie/-fPIE arguments. More... | |
static const char * | RelocationModelName (llvm::Reloc::Model Model) |
static void | AddAssemblerKPIC (const ToolChain &ToolChain, const ArgList &Args, ArgStringList &CmdArgs) |
static bool | maybeConsumeDash (const std::string &EH, size_t &I) |
static EHFlags | parseClangCLEHFlags (const Driver &D, const ArgList &Args) |
/EH controls whether to run destructor cleanups when exceptions are thrown. More... | |
static void | constructHexagonLinkArgs (Compilation &C, const JobAction &JA, const toolchains::HexagonToolChain &HTC, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, ArgStringList &CmdArgs, const char *LinkingOutput) |
static void | AddLibgcc (const llvm::Triple &Triple, const Driver &D, ArgStringList &CmdArgs, const ArgList &Args) |
static void | AddRunTimeLibs (const ToolChain &TC, const Driver &D, ArgStringList &CmdArgs, const ArgList &Args) |
static const char * | getLDMOption (const llvm::Triple &T, const ArgList &Args) |
static std::string | FindVisualStudioExecutable (const ToolChain &TC, const char *Exe, const char *ClangProgramPath) |
static void | AddPS4SanitizerArgs (const ToolChain &TC, ArgStringList &CmdArgs) |
static void | ConstructPS4LinkJob (const Tool &T, Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) |
static void | ConstructGoldLinkJob (const Tool &T, Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) |
enum OpenMPRuntimeKind |
|
static |
Definition at line 3814 of file Tools.cpp.
References clang::driver::ToolChain::getTriple(), and ParsePICArgs().
Referenced by clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::freebsd::Assembler::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), and clang::driver::tools::gnutools::Assembler::ConstructJob().
|
static |
Definition at line 3002 of file Tools.cpp.
References clang::driver::ToolChain::getCompilerRTArgString().
Referenced by AddRunTimeLibs().
|
static |
Add -x lang to CmdArgs
for Input
.
Definition at line 3405 of file Tools.cpp.
References clang::driver::InputInfo::getType(), and clang::driver::types::getTypeName().
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Add a CC1 option to specify the debug compilation directory.
Definition at line 3323 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
|
static |
|
static |
Adds exception related arguments to the driver command arguments.
There's a master flag, -fexceptions and also language specific flags to enable/disable C++ and Objective-C exceptions. This makes it possible to for example disable C++ exceptions but enable Objective-C exceptions.
Definition at line 2666 of file Tools.cpp.
References clang::driver::Driver::Diag(), clang::driver::ToolChain::getDriver(), clang::driver::ToolChain::getRTTIArg(), clang::driver::ToolChain::getRTTIMode(), clang::driver::ToolChain::getTriple(), clang::driver::types::isCXX(), clang::driver::types::isObjC(), clang::driver::ToolChain::RM_DisabledExplicitly, clang::driver::ToolChain::RM_DisabledImplicitly, clang::driver::ToolChain::RM_EnabledImplicitly, and shouldUseExceptionTablesForObjCExceptions().
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Add the C++ include args of other offloading toolchains.
If this is a host job, the device toolchains are added. If this is a device job, the host toolchains will be added.
Definition at line 302 of file Tools.cpp.
References clang::driver::Compilation::getSingleOffloadToolChain(), clang::driver::Action::isDeviceOffloading(), clang::driver::Action::isHostOffloading(), clang::driver::Action::OFK_Cuda, and clang::driver::Action::OFK_Host.
|
static |
Add the include args that are specific of each offloading programming model.
Definition at line 318 of file Tools.cpp.
References clang::driver::Compilation::getSingleOffloadToolChain(), clang::driver::Action::isDeviceOffloading(), clang::driver::Action::isHostOffloading(), clang::driver::Action::OFK_Cuda, and clang::driver::Action::OFK_Host.
|
static |
Definition at line 2010 of file Tools.cpp.
References clang::driver::Driver::Dir, getCPUName(), clang::driver::ToolChain::getDriver(), and clang::driver::ToolChain::getTriple().
Referenced by clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().
|
static |
Definition at line 9229 of file Tools.cpp.
References clang::driver::Driver::CCCIsCXX().
Referenced by AddRunTimeLibs().
|
static |
Definition at line 235 of file Tools.cpp.
References clang::driver::ToolChain::AddCCKextLibArgs(), clang::driver::ToolChain::AddCXXStdlibLibArgs(), addDirectoryList(), clang::driver::Driver::Diag(), clang::driver::ToolChain::getDriver(), clang::driver::ToolChain::getTripleString(), clang::driver::ToolChain::HasNativeLLVMSupport(), clang::driver::ToolChain::isCrossCompiling(), and clang::driver::types::isLLVMIR().
Referenced by ConstructGoldLinkJob(), constructHexagonLinkArgs(), clang::driver::tools::amdgpu::Linker::ConstructJob(), clang::driver::tools::wasm::Linker::ConstructJob(), clang::driver::tools::cloudabi::Linker::ConstructJob(), clang::driver::tools::darwin::Linker::ConstructJob(), clang::driver::tools::openbsd::Linker::ConstructJob(), clang::driver::tools::bitrig::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), clang::driver::tools::netbsd::Linker::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::nacltools::Linker::ConstructJob(), clang::driver::tools::minix::Linker::ConstructJob(), clang::driver::tools::solaris::Linker::ConstructJob(), clang::driver::tools::dragonfly::Linker::ConstructJob(), clang::driver::tools::MinGW::Linker::ConstructJob(), clang::driver::tools::XCore::Linker::ConstructJob(), clang::driver::tools::CrossWindows::Linker::ConstructJob(), clang::driver::tools::Myriad::Linker::ConstructJob(), and ConstructPS4LinkJob().
|
static |
Definition at line 3056 of file Tools.cpp.
References getOpenMPRuntime().
Referenced by clang::driver::tools::darwin::Linker::ConstructJob(), clang::driver::tools::freebsd::Linker::ConstructJob(), and clang::driver::tools::netbsd::Linker::ConstructJob().
|
static |
Definition at line 3529 of file Tools.cpp.
References clang::driver::Driver::Diag(), clang::driver::Compilation::getArgs(), clang::driver::InputInfo::getBaseInput(), and clang::driver::InputInfo::isFilename().
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 3647 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 10967 of file Tools.cpp.
References clang::driver::ToolChain::getSanitizerArgs(), clang::driver::SanitizerArgs::needsAsanRt(), and clang::driver::SanitizerArgs::needsUbsanRt().
Referenced by ConstructGoldLinkJob(), and ConstructPS4LinkJob().
|
static |
Definition at line 9264 of file Tools.cpp.
References addClangRT(), AddLibgcc(), clang::driver::Driver::Diag(), clang::driver::ToolChain::getDriver(), clang::driver::ToolChain::GetRuntimeLibType(), clang::driver::ToolChain::getTriple(), clang::driver::ToolChain::RLT_CompilerRT, and clang::driver::ToolChain::RLT_Libgcc.
Referenced by clang::driver::tools::gnutools::Linker::ConstructJob(), clang::driver::tools::visualstudio::Linker::ConstructJob(), and clang::driver::tools::CrossWindows::Linker::ConstructJob().
|
static |
Definition at line 3090 of file Tools.cpp.
References clang::driver::ToolChain::getCompilerRT().
Referenced by addSanitizerRuntimes().
|
static |
Definition at line 3078 of file Tools.cpp.
References clang::driver::ToolChain::getCompilerRTArgString().
Referenced by addSanitizerRuntimes().
|
static |
Definition at line 3182 of file Tools.cpp.
References addSanitizerDynamicList(), addSanitizerRuntime(), collectSanitizerRuntimes(), and S.
Referenced by clang::driver::tools::freebsd::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().
|
static |
Definition at line 1375 of file Tools.cpp.
Referenced by getMIPSTargetFeatures(), and getPPCTargetFeatures().
|
static |
Definition at line 3213 of file Tools.cpp.
References clang::driver::ToolChain::getCompilerRTArgString().
Referenced by clang::driver::tools::gnutools::Linker::ConstructJob().
|
static |
Definition at line 3443 of file Tools.cpp.
References clang::isAlphanumeric(), and P.
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 3240 of file Tools.cpp.
Referenced by clang::driver::tools::wasm::Linker::ConstructJob(), and shouldUseFramePointerForTarget().
|
static |
Definition at line 740 of file Tools.cpp.
References DecodeARMFeatures(), clang::driver::Driver::Diag(), and clang::driver::tools::arm::getARMArch().
Referenced by getARMTargetFeatures().
|
static |
Definition at line 753 of file Tools.cpp.
References DecodeARMFeatures(), clang::driver::Driver::Diag(), clang::driver::tools::arm::getARMTargetCPU(), and clang::driver::tools::arm::getLLVMArchSuffixForARM().
Referenced by getARMTargetFeatures().
|
static |
CheckCodeGenerationOptions - Perform some validation of code generation arguments that is shared with gcc.
Definition at line 126 of file Tools.cpp.
References clang::driver::Driver::Diag().
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
CheckPreprocessingOptions - Perform some validation of preprocessing arguments that is shared with gcc.
Definition at line 113 of file Tools.cpp.
References clang::driver::Driver::CCCIsCPP(), clang::driver::Driver::Diag(), and clang::driver::Driver::IsCLMode().
|
static |
Definition at line 3435 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::hexagon::Assembler::ConstructJob(), clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::bitrig::Assembler::ConstructJob(), clang::driver::tools::freebsd::Assembler::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), clang::driver::tools::gnutools::Assembler::ConstructJob(), clang::driver::tools::minix::Assembler::ConstructJob(), clang::driver::tools::solaris::Assembler::ConstructJob(), clang::driver::tools::dragonfly::Assembler::ConstructJob(), clang::driver::tools::MinGW::Assembler::ConstructJob(), clang::driver::tools::XCore::Assembler::ConstructJob(), clang::driver::tools::CrossWindows::Assembler::ConstructJob(), and clang::driver::tools::PS4cpu::Assemble::ConstructJob().
|
static |
Definition at line 2851 of file Tools.cpp.
References clang::driver::Driver::Diag(), DwarfVersionNum(), clang::driver::ToolChain::getArch(), clang::driver::Compilation::getDefaultToolChain(), clang::driver::ToolChain::getTriple(), clang::codegenoptions::LimitedDebugInfo, RenderDebugEnablingArgs(), and UseRelaxAll().
Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
|
static |
Definition at line 3115 of file Tools.cpp.
References clang::driver::ToolChain::getSanitizerArgs(), clang::driver::ToolChain::getTriple(), clang::driver::SanitizerArgs::linkCXXRuntimes(), clang::driver::SanitizerArgs::needsAsanRt(), clang::driver::SanitizerArgs::needsCfiDiagRt(), clang::driver::SanitizerArgs::needsCfiRt(), clang::driver::SanitizerArgs::needsDfsanRt(), clang::driver::SanitizerArgs::needsEsanRt(), clang::driver::SanitizerArgs::needsLsanRt(), clang::driver::SanitizerArgs::needsMsanRt(), clang::driver::SanitizerArgs::needsSafeStackRt(), clang::driver::SanitizerArgs::needsSharedAsanRt(), clang::driver::SanitizerArgs::needsStatsRt(), clang::driver::SanitizerArgs::needsTsanRt(), and clang::driver::SanitizerArgs::needsUbsanRt().
Referenced by addSanitizerRuntimes().
|
static |
Definition at line 11036 of file Tools.cpp.
References clang::driver::Compilation::addCommand(), clang::driver::toolchains::FreeBSD::AddCXXStdlibLibArgs(), clang::driver::ToolChain::AddFilePathLibArgs(), AddLinkerInputs(), AddPS4SanitizerArgs(), clang::driver::Driver::CCCIsCXX(), clang::driver::ToolChain::getDriver(), clang::driver::InputInfo::getFilename(), clang::driver::ToolChain::GetFilePath(), clang::driver::ToolChain::GetProgramPath(), clang::driver::Tool::getToolChain(), clang::driver::InputInfo::isFilename(), clang::driver::InputInfo::isNothing(), and clang::driver::Driver::SysRoot.
Referenced by clang::driver::tools::PS4cpu::Link::ConstructJob().
|
static |
Definition at line 6890 of file Tools.cpp.
References clang::driver::ToolChain::AddCXXStdlibLibArgs(), AddLinkerInputs(), clang::driver::Driver::CCCIsCXX(), clang::driver::toolchains::Linux::ExtraOpts, clang::driver::ToolChain::getDriver(), clang::driver::InputInfo::getFilename(), clang::driver::ToolChain::GetFilePath(), clang::driver::ToolChain::getFilePaths(), clang::driver::toolchains::HexagonToolChain::getHexagonTargetDir(), clang::driver::toolchains::HexagonToolChain::getSmallDataThreshold(), clang::driver::toolchains::HexagonToolChain::GetTargetCPUVersion(), clang::driver::Driver::InstalledDir, clang::Name, and clang::driver::Driver::PrefixDirs.
Referenced by clang::driver::tools::hexagon::Linker::ConstructJob().
|
static |
Definition at line 10977 of file Tools.cpp.
References clang::driver::Compilation::addCommand(), AddLinkerInputs(), AddPS4SanitizerArgs(), clang::driver::ToolChain::getDriver(), clang::driver::InputInfo::getFilename(), clang::driver::ToolChain::GetProgramPath(), clang::driver::Tool::getToolChain(), clang::driver::InputInfo::isFilename(), clang::driver::InputInfo::isNothing(), and clang::driver::Driver::SysRoot.
Referenced by clang::driver::tools::PS4cpu::Link::ConstructJob().
Check whether the given input tree contains any compilation actions.
Definition at line 2757 of file Tools.cpp.
References clang::driver::Action::inputs().
Referenced by UseRelaxAll().
|
static |
Definition at line 2792 of file Tools.cpp.
References clang::codegenoptions::DebugLineTablesOnly, clang::codegenoptions::LimitedDebugInfo, and clang::codegenoptions::NoDebugInfo.
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 2347 of file Tools.cpp.
References clang::driver::Driver::Diag().
Referenced by DecodeAArch64Mcpu(), and getAArch64ArchFeaturesFromMarch().
|
static |
Definition at line 2381 of file Tools.cpp.
References DecodeAArch64Features().
Referenced by getAArch64ArchFeaturesFromMcpu(), and getAArch64MicroArchFeaturesFromMcpu().
|
static |
Definition at line 722 of file Tools.cpp.
Referenced by checkARMArchName(), and checkARMCPUName().
|
static |
Definition at line 2807 of file Tools.cpp.
Referenced by CollectArgsForIntegratedAssembler(), clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
|
static |
Definition at line 138 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
|
static |
Definition at line 9990 of file Tools.cpp.
References FilePath.
Referenced by clang::driver::tools::visualstudio::Linker::ConstructJob(), and clang::driver::tools::visualstudio::Compiler::GetCommand().
|
static |
Definition at line 292 of file Tools.cpp.
References clang::driver::options::DriverOption, and clang::driver::options::LinkerInput.
Referenced by clang::driver::tools::gcc::Common::ConstructJob().
|
static |
Definition at line 2407 of file Tools.cpp.
References DecodeAArch64Features().
Referenced by getAArch64TargetFeatures().
|
static |
Definition at line 2430 of file Tools.cpp.
References DecodeAArch64Mcpu().
Referenced by getAArch64TargetFeatures().
|
static |
Definition at line 2457 of file Tools.cpp.
References DecodeAArch64Mcpu(), and getAArch64MicroArchFeaturesFromMtune().
Referenced by getAArch64TargetFeatures().
|
static |
Definition at line 2442 of file Tools.cpp.
Referenced by getAArch64MicroArchFeaturesFromMcpu(), and getAArch64TargetFeatures().
|
static |
getAArch64TargetCPU - Get the (LLVM) name of the AArch64 cpu we are targeting.
Definition at line 1150 of file Tools.cpp.
Referenced by getAArch64TargetFeatures(), and getCPUName().
|
static |
Definition at line 2469 of file Tools.cpp.
References clang::driver::Driver::Diag(), getAArch64ArchFeaturesFromMarch(), getAArch64ArchFeaturesFromMcpu(), getAArch64MicroArchFeaturesFromMcpu(), getAArch64MicroArchFeaturesFromMtune(), and getAArch64TargetCPU().
Referenced by getTargetFeatures().
|
static |
Definition at line 2550 of file Tools.cpp.
References clang::driver::Driver::Diag(), and handleTargetFeaturesGroup().
Referenced by getTargetFeatures().
|
static |
Definition at line 683 of file Tools.cpp.
Referenced by clang::driver::tools::netbsd::Assembler::ConstructJob(), and getCPUName().
|
static |
Definition at line 713 of file Tools.cpp.
References clang::driver::Driver::Diag().
Referenced by getARMTargetFeatures().
|
static |
Definition at line 704 of file Tools.cpp.
References clang::driver::Driver::Diag().
Referenced by getARMTargetFeatures().
|
static |
Definition at line 670 of file Tools.cpp.
Referenced by getARMTargetFeatures().
|
static |
Definition at line 876 of file Tools.cpp.
References checkARMArchName(), checkARMCPUName(), clang::driver::Driver::Diag(), clang::driver::tools::arm::getARMFloatABI(), getARMFPUFeatures(), getARMHWDivFeatures(), getARMSubArchVersionNumber(), clang::driver::ToolChain::getDriver(), clang::driver::tools::arm::Hard, and clang::driver::tools::arm::Soft.
Referenced by getTargetFeatures().
|
static |
Definition at line 1927 of file Tools.cpp.
References getAArch64TargetCPU(), getARMArchCPUFromArgs(), clang::driver::tools::arm::getARMTargetCPU(), getLanaiTargetCPU(), clang::driver::tools::mips::getMipsCPUAndABI(), getPPCTargetCPU(), getR600TargetGPU(), getSystemZTargetCPU(), clang::driver::toolchains::HexagonToolChain::GetTargetCPUVersion(), getWebAssemblyTargetCPU(), and getX86TargetCPU().
Referenced by AddGoldPlugin(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::freebsd::Assembler::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), and clang::driver::tools::gnutools::Assembler::ConstructJob().
|
static |
Definition at line 1333 of file Tools.cpp.
Referenced by clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::freebsd::Assembler::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), clang::driver::tools::gnutools::Assembler::ConstructJob(), and getMIPSTargetFeatures().
|
static |
Definition at line 2519 of file Tools.cpp.
Referenced by getTargetFeatures().
|
static |
Definition at line 1727 of file Tools.cpp.
Referenced by getCPUName().
|
static |
Definition at line 9295 of file Tools.cpp.
References clang::driver::tools::mips::hasMipsAbiArg().
Referenced by clang::driver::tools::gnutools::Linker::ConstructJob().
|
static |
Definition at line 1342 of file Tools.cpp.
References clang::driver::Driver::Diag(), clang::driver::tools::mips::Hard, clang::driver::tools::mips::Invalid, and clang::driver::tools::mips::Soft.
Referenced by clang::driver::tools::gnutools::Assembler::ConstructJob(), and getMIPSTargetFeatures().
|
static |
Definition at line 1387 of file Tools.cpp.
References AddTargetFeature(), clang::driver::Driver::Diag(), getGnuCompatibleMipsABIName(), clang::driver::tools::mips::getMipsCPUAndABI(), getMipsFloatABI(), clang::driver::tools::mips::getSupportedNanEncoding(), clang::driver::tools::mips::isFP64ADefault(), clang::driver::tools::mips::Nan2008, clang::driver::tools::mips::NanLegacy, clang::driver::tools::mips::shouldUseFPXX(), and clang::driver::tools::mips::Soft.
Referenced by getTargetFeatures().
|
static |
Definition at line 3419 of file Tools.cpp.
Referenced by clang::driver::tools::visualstudio::getMSVCVersion().
|
static |
Compute the desired OpenMP runtime from the flag provided.
Definition at line 3030 of file Tools.cpp.
References clang::driver::Driver::Diag(), and clang::driver::ToolChain::getDriver().
Referenced by addOpenMPRuntime(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::gnutools::Linker::ConstructJob(), and clang::driver::tools::visualstudio::Linker::ConstructJob().
|
static |
getPPCTargetCPU - Get the (LLVM) name of the PowerPC cpu we are targeting.
Definition at line 1533 of file Tools.cpp.
Referenced by getCPUName().
|
static |
Definition at line 1598 of file Tools.cpp.
References AddTargetFeature(), clang::driver::Driver::Diag(), clang::driver::tools::ppc::getPPCFloatABI(), handleTargetFeaturesGroup(), and clang::driver::tools::ppc::Soft.
Referenced by getTargetFeatures().
|
static |
Get the (LLVM) name of the R600 gpu we are targeting.
Definition at line 1711 of file Tools.cpp.
Referenced by getCPUName().
|
static |
This is a helper function for validating the optional refinement step parameter in reciprocal argument strings.
Return false if there is an error parsing the refinement step. Otherwise, return true and set the Position of the refinement step in the input string.
Definition at line 2060 of file Tools.cpp.
References clang::driver::Driver::Diag().
Referenced by ParseMRecip().
|
static |
Definition at line 73 of file Tools.cpp.
References clang::Name.
Referenced by clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::freebsd::Assembler::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), and clang::driver::tools::gnutools::Assembler::ConstructJob().
|
static |
Definition at line 1769 of file Tools.cpp.
References clang::driver::tools::sparc::getSparcFloatABI(), and clang::driver::tools::sparc::Soft.
Referenced by getTargetFeatures().
|
static |
Definition at line 1800 of file Tools.cpp.
Referenced by clang::driver::tools::gnutools::Assembler::ConstructJob(), and getCPUName().
|
static |
Definition at line 1806 of file Tools.cpp.
Referenced by getTargetFeatures().
|
static |
Definition at line 2567 of file Tools.cpp.
References getAArch64TargetFeatures(), getAMDGPUTargetFeatures(), getARMTargetFeatures(), clang::driver::ToolChain::getDriver(), getHexagonTargetFeatures(), getMIPSTargetFeatures(), getPPCTargetFeatures(), getSparcTargetFeatures(), getSystemZTargetFeatures(), getWebAssemblyTargetFeatures(), getX86TargetFeatures(), I, clang::LangAS::Last, and clang::Name.
Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
|
static |
Get the (LLVM) name of the WebAssembly cpu we are targeting.
Definition at line 1909 of file Tools.cpp.
Referenced by getCPUName().
|
static |
Definition at line 2545 of file Tools.cpp.
References handleTargetFeaturesGroup().
Referenced by getTargetFeatures().
|
static |
Definition at line 1824 of file Tools.cpp.
Referenced by getCPUName().
|
static |
Definition at line 2187 of file Tools.cpp.
References clang::driver::Driver::Diag(), and handleTargetFeaturesGroup().
Referenced by getTargetFeatures().
|
static |
Definition at line 55 of file Tools.cpp.
References clang::IdentifierInfo::getName(), and clang::Name.
Referenced by getAMDGPUTargetFeatures(), getPPCTargetFeatures(), getWebAssemblyTargetFeatures(), and getX86TargetFeatures().
|
static |
Definition at line 676 of file Tools.cpp.
References clang::Profile().
Referenced by useAAPCSForMachO().
|
static |
Definition at line 655 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Determine whether Objective-C automated reference counting is enabled.
Definition at line 279 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob(), and isObjCRuntimeLinked().
|
static |
Determine whether we are linking the ObjC runtime.
Definition at line 284 of file Tools.cpp.
References isObjCAutoRefCount().
Referenced by clang::driver::tools::darwin::Linker::ConstructJob().
|
static |
Definition at line 626 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 3101 of file Tools.cpp.
References clang::driver::ToolChain::getTriple().
Referenced by clang::driver::tools::freebsd::Linker::ConstructJob(), and clang::driver::tools::gnutools::Linker::ConstructJob().
|
static |
Definition at line 3225 of file Tools.cpp.
References clang::driver::ToolChain::CST_Libcxx, clang::driver::ToolChain::GetCXXStdlibType(), and clang::driver::ToolChain::getTriple().
Referenced by clang::driver::tools::gnutools::Linker::ConstructJob().
Definition at line 6224 of file Tools.cpp.
Referenced by parseClangCLEHFlags().
|
static |
/EH controls whether to run destructor cleanups when exceptions are thrown.
There are three modifiers:
Definition at line 6245 of file Tools.cpp.
References clang::driver::Driver::Diag(), E, I, and maybeConsumeDash().
|
static |
The -mrecip flag requires processing of many optional parameters.
Definition at line 2088 of file Tools.cpp.
References clang::driver::Driver::Diag(), and getRefinementStep().
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Parses the various -fpic/-fPIC/-fpie/-fPIE arguments.
Then, smooshes them together with platform defaults, to decide whether this compile should be using PIC mode or not. Returns a tuple of (RelocationModel, PICLevel, IsPIE).
Definition at line 3669 of file Tools.cpp.
References clang::driver::Driver::Diag(), clang::driver::ToolChain::getArch(), clang::driver::ToolChain::getDriver(), clang::driver::ToolChain::getTriple(), clang::driver::ToolChain::isPICDefault(), clang::driver::ToolChain::isPICDefaultForced(), and clang::driver::ToolChain::isPIEDefault().
Referenced by AddAssemblerKPIC(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), and clang::driver::tools::gnutools::Assembler::ConstructJob().
|
static |
|
static |
Definition at line 3802 of file Tools.cpp.
Referenced by clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
|
static |
Definition at line 2816 of file Tools.cpp.
References clang::codegenoptions::DebugLineTablesOnly, clang::codegenoptions::FullDebugInfo, and clang::codegenoptions::LimitedDebugInfo.
Referenced by CollectArgsForIntegratedAssembler(), clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::ClangAs::ConstructJob().
Definition at line 2737 of file Tools.cpp.
References clang::driver::ToolChain::getTriple(), and clang::driver::ToolChain::useIntegratedAs().
Referenced by clang::driver::tools::Clang::ConstructJob().
Definition at line 2748 of file Tools.cpp.
References clang::driver::ToolChain::useIntegratedAs().
Referenced by clang::driver::tools::Clang::ConstructJob().
Vectorize at all optimization levels greater than 1 except for -Oz.
For -Oz the loop vectorizer is disable, while the slp vectorizer is enabled.
Definition at line 3374 of file Tools.cpp.
References S.
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 2646 of file Tools.cpp.
References clang::ObjCRuntime::isNonFragile().
Referenced by addExceptionArgs().
|
static |
Definition at line 3297 of file Tools.cpp.
References shouldUseFramePointerForTarget().
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 3248 of file Tools.cpp.
References areOptimizationsEnabled().
Referenced by shouldUseFramePointer(), and shouldUseLeafFramePointer().
|
static |
Definition at line 3308 of file Tools.cpp.
References shouldUseFramePointerForTarget().
Referenced by clang::driver::tools::Clang::ConstructJob().
|
static |
Definition at line 3348 of file Tools.cpp.
References clang::driver::Compilation::addCommand(), clang::driver::InputInfo::getFilename(), and clang::driver::ToolChain::GetProgramPath().
Referenced by clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::gnutools::Assembler::ConstructJob(), and clang::driver::tools::MinGW::Assembler::ConstructJob().
|
static |
Definition at line 3331 of file Tools.cpp.
References clang::driver::InputInfo::getBaseInput().
Referenced by clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::gnutools::Assembler::ConstructJob(), and clang::driver::tools::MinGW::Assembler::ConstructJob().
|
static |
Definition at line 765 of file Tools.cpp.
References isARMMProfile().
|
static |
Check if -relax-all should be passed to the internal assembler.
This is done by default when compiling non-assembler source with -O0.
Definition at line 2770 of file Tools.cpp.
References ContainsCompileAction(), and clang::driver::Compilation::getActions().
Referenced by CollectArgsForIntegratedAssembler().