[Driver] Compute effective target triples once per job (NFCI)

Compute an effective target triple exactly once in ConstructJob(), and
then simply pass around references to it. This eliminates wasteful
re-computation of effective triples (e.g in getARMFloatABI()).

Differential Revision: https://reviews.llvm.org/D22290

llvm-svn: 275895
This commit is contained in:
Vedant Kumar 2016-07-18 19:56:38 +00:00
parent f2030b931c
commit bf51e703cf
11 changed files with 353 additions and 191 deletions

View File

@ -121,7 +121,8 @@ These are major API changes that have happened since the 3.8 release of
Clang. If upgrading an external codebase that uses Clang as a library,
this section should help get you past the largest hurdles of upgrading.
- ...
- Classes which inherit from ``driver::Tool`` must be updated to use effective
target triples when constructing jobs.
AST Matchers
------------

View File

@ -16,6 +16,10 @@
#include <string>
#include <vector>
namespace llvm {
class Triple;
}
namespace clang {
namespace driver {
@ -66,7 +70,8 @@ class SanitizerArgs {
bool requiresPIE() const;
bool needsUnwindTables() const;
bool linkCXXRuntimes() const { return LinkCXXRuntimes; }
void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
void addArgs(const ToolChain &TC, const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
};

View File

@ -14,6 +14,7 @@
#include "llvm/Support/Program.h"
namespace llvm {
class Triple;
namespace opt {
class ArgList;
}
@ -127,6 +128,7 @@ public:
virtual void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const = 0;
};

View File

@ -260,11 +260,13 @@ public:
return ToolChain::CST_Libstdcxx;
}
virtual std::string getCompilerRT(const llvm::opt::ArgList &Args,
virtual std::string getCompilerRT(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
StringRef Component,
bool Shared = false) const;
const char *getCompilerRTArgString(const llvm::opt::ArgList &Args,
const char *getCompilerRTArgString(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
StringRef Component,
bool Shared = false) const;
/// needsProfileRT - returns true if instrumentation profile is on.
@ -410,7 +412,8 @@ public:
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.
virtual void addProfileRTLibs(const llvm::opt::ArgList &Args,
virtual void addProfileRTLibs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
/// \brief Add arguments to use system-specific CUDA includes.

View File

@ -2256,7 +2256,21 @@ InputInfo Driver::BuildJobsForActionNoCache(
TC->getTriple().normalize()),
BaseInput);
llvm::Triple EffectiveTriple;
const ArgList &Args = C.getArgsForToolChain(TC, BoundArch);
if (InputInfos.size() != 1) {
EffectiveTriple = llvm::Triple(
T->getToolChain().ComputeEffectiveClangTriple(Args));
} else {
// Pass along the input type if it can be unambiguously determined.
EffectiveTriple =
llvm::Triple(T->getToolChain().ComputeEffectiveClangTriple(
Args, InputInfos[0].getType()));
}
if (CCCPrintBindings && !CCGenDiagnostics) {
// FIXME: We should be able to use the effective triple here, but doing so
// breaks some multi-arch tests.
llvm::errs() << "# \"" << T->getToolChain().getTripleString() << '"'
<< " - \"" << T->getName() << "\", inputs: [";
for (unsigned i = 0, e = InputInfos.size(); i != e; ++i) {
@ -2266,7 +2280,7 @@ InputInfo Driver::BuildJobsForActionNoCache(
}
llvm::errs() << "], output: " << Result.getAsString() << "\n";
} else {
T->ConstructJob(C, *JA, Result, InputInfos,
T->ConstructJob(C, *JA, Result, InputInfos, EffectiveTriple,
C.getArgsForToolChain(TC, BoundArch), LinkingOutput);
}
return Result;

View File

@ -602,7 +602,9 @@ static void addIncludeLinkerOption(const ToolChain &TC,
CmdArgs.push_back(Args.MakeArgString(LinkerOptionFlag));
}
void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
void SanitizerArgs::addArgs(const ToolChain &TC,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs,
types::ID InputType) const {
// Translate available CoverageFeatures to corresponding clang-cc1 flags.
@ -626,21 +628,24 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
// Instruct the code generator to embed linker directives in the object file
// that cause the required runtime libraries to be linked.
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" + TC.getCompilerRT(Args, "ubsan_standalone")));
"--dependent-lib=" +
TC.getCompilerRT(EffectiveTriple, Args, "ubsan_standalone")));
if (types::isCXX(InputType))
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" + TC.getCompilerRT(Args, "ubsan_standalone_cxx")));
"--dependent-lib=" +
TC.getCompilerRT(EffectiveTriple, Args, "ubsan_standalone_cxx")));
}
if (TC.getTriple().isOSWindows() && needsStatsRt()) {
CmdArgs.push_back(Args.MakeArgString("--dependent-lib=" +
TC.getCompilerRT(Args, "stats_client")));
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" +
TC.getCompilerRT(EffectiveTriple, Args, "stats_client")));
// The main executable must export the stats runtime.
// FIXME: Only exporting from the main executable (e.g. based on whether the
// translation unit defines main()) would save a little space, but having
// multiple copies of the runtime shouldn't hurt.
CmdArgs.push_back(Args.MakeArgString("--dependent-lib=" +
TC.getCompilerRT(Args, "stats")));
CmdArgs.push_back(Args.MakeArgString(
"--dependent-lib=" + TC.getCompilerRT(EffectiveTriple, Args, "stats")));
addIncludeLinkerOption(TC, Args, CmdArgs, "__sanitizer_stats_register");
}

View File

@ -267,46 +267,52 @@ Tool *ToolChain::getTool(Action::ActionClass AC) const {
llvm_unreachable("Invalid tool kind.");
}
static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
const ArgList &Args) {
const llvm::Triple &Triple = TC.getTriple();
bool IsWindows = Triple.isOSWindows();
static StringRef
getArchNameForCompilerRTLib(const ToolChain &TC,
const llvm::Triple &EffectiveTriple,
const ArgList &Args) {
bool IsWindows = EffectiveTriple.isOSWindows();
if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
if (EffectiveTriple.isWindowsMSVCEnvironment() &&
TC.getArch() == llvm::Triple::x86)
return "i386";
if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
return (arm::getARMFloatABI(TC, EffectiveTriple, Args) ==
arm::FloatABI::Hard &&
!IsWindows)
? "armhf"
: "arm";
return TC.getArchName();
}
std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
std::string ToolChain::getCompilerRT(const llvm::Triple &EffectiveTriple,
const ArgList &Args, StringRef Component,
bool Shared) const {
const llvm::Triple &TT = getTriple();
const char *Env = TT.isAndroid() ? "-android" : "";
bool IsITANMSVCWindows =
TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment();
const char *Env = EffectiveTriple.isAndroid() ? "-android" : "";
bool IsITANMSVCWindows = EffectiveTriple.isWindowsMSVCEnvironment() ||
EffectiveTriple.isWindowsItaniumEnvironment();
StringRef Arch = getArchNameForCompilerRTLib(*this, Args);
StringRef Arch = getArchNameForCompilerRTLib(*this, EffectiveTriple, Args);
const char *Prefix = IsITANMSVCWindows ? "" : "lib";
const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so")
const char *Suffix = Shared ? (EffectiveTriple.isOSWindows() ? ".dll" : ".so")
: (IsITANMSVCWindows ? ".lib" : ".a");
SmallString<128> Path(getDriver().ResourceDir);
StringRef OSLibName = Triple.isOSFreeBSD() ? "freebsd" : getOS();
StringRef OSLibName = EffectiveTriple.isOSFreeBSD() ? "freebsd" : getOS();
llvm::sys::path::append(Path, "lib", OSLibName);
llvm::sys::path::append(Path, Prefix + Twine("clang_rt.") + Component + "-" +
Arch + Env + Suffix);
return Path.str();
}
const char *ToolChain::getCompilerRTArgString(const llvm::opt::ArgList &Args,
StringRef Component,
bool Shared) const {
return Args.MakeArgString(getCompilerRT(Args, Component, Shared));
const char *
ToolChain::getCompilerRTArgString(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
StringRef Component, bool Shared) const {
return Args.MakeArgString(
getCompilerRT(EffectiveTriple, Args, Component, Shared));
}
bool ToolChain::needsProfileRT(const ArgList &Args) {
@ -517,11 +523,13 @@ void ToolChain::addClangTargetOptions(const ArgList &DriverArgs,
void ToolChain::addClangWarningOptions(ArgStringList &CC1Args) const {}
void ToolChain::addProfileRTLibs(const llvm::opt::ArgList &Args,
void ToolChain::addProfileRTLibs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const {
if (!needsProfileRT(Args)) return;
if (!needsProfileRT(Args))
return;
CmdArgs.push_back(getCompilerRTArgString(Args, "profile"));
CmdArgs.push_back(getCompilerRTArgString(EffectiveTriple, Args, "profile"));
}
ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType(

View File

@ -380,13 +380,16 @@ StringRef Darwin::getOSLibraryNameSuffix() const {
llvm_unreachable("Unsupported platform");
}
void Darwin::addProfileRTLibs(const ArgList &Args,
void Darwin::addProfileRTLibs(const llvm::Triple &EffectiveTriple,
const ArgList &Args,
ArgStringList &CmdArgs) const {
if (!needsProfileRT(Args)) return;
if (!needsProfileRT(Args))
return;
AddLinkRuntimeLib(Args, CmdArgs, (Twine("libclang_rt.profile_") +
getOSLibraryNameSuffix() + ".a").str(),
/*AlwaysLink*/ true);
AddLinkRuntimeLib(
Args, CmdArgs,
(Twine("libclang_rt.profile_") + getOSLibraryNameSuffix() + ".a").str(),
/*AlwaysLink*/ true);
}
void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args,
@ -400,7 +403,8 @@ void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args,
/*AddRPath*/ true);
}
void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
void DarwinClang::AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
const ArgList &Args,
ArgStringList &CmdArgs) const {
// Darwin only supports the compiler-rt based runtime libraries.
switch (GetRuntimeLibType(Args)) {
@ -1012,16 +1016,17 @@ DerivedArgList *MachO::TranslateArgs(const DerivedArgList &Args,
return DAL;
}
void MachO::AddLinkRuntimeLibArgs(const ArgList &Args,
void MachO::AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
const ArgList &Args,
ArgStringList &CmdArgs) const {
// Embedded targets are simple at the moment, not supporting sanitizers and
// with different libraries for each member of the product { static, PIC } x
// { hard-float, soft-float }
llvm::SmallString<32> CompilerRT = StringRef("libclang_rt.");
CompilerRT +=
(tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard)
? "hard"
: "soft";
CompilerRT += (tools::arm::getARMFloatABI(*this, EffectiveTriple, Args) ==
tools::arm::FloatABI::Hard)
? "hard"
: "soft";
CompilerRT += Args.hasArg(options::OPT_fPIC) ? "_pic.a" : "_static.a";
AddLinkRuntimeLib(Args, CmdArgs, CompilerRT, false, true);
@ -2858,9 +2863,10 @@ void MipsLLVMToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
CmdArgs.push_back("-lunwind");
}
std::string MipsLLVMToolChain::getCompilerRT(const ArgList &Args,
StringRef Component,
bool Shared) const {
std::string
MipsLLVMToolChain::getCompilerRT(const llvm::Triple &EffectiveTriple,
const ArgList &Args, StringRef Component,
bool Shared) const {
SmallString<128> Path(getDriver().ResourceDir);
llvm::sys::path::append(Path, SelectedMultilib.osSuffix(), "lib" + LibSuffix,
getOS());
@ -4237,9 +4243,9 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
case llvm::Triple::thumb:
case llvm::Triple::armeb:
case llvm::Triple::thumbeb: {
const bool HF =
Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard;
const bool HF = Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
tools::arm::getARMFloatABI(*this, Triple, Args) ==
tools::arm::FloatABI::Hard;
LibDir = "lib";
Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3";
@ -4631,16 +4637,18 @@ SanitizerMask Linux::getSupportedSanitizers() const {
return Res;
}
void Linux::addProfileRTLibs(const llvm::opt::ArgList &Args,
void Linux::addProfileRTLibs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const {
if (!needsProfileRT(Args)) return;
if (!needsProfileRT(Args))
return;
// Add linker option -u__llvm_runtime_variable to cause runtime
// initialization module to be linked in.
if (!Args.hasArg(options::OPT_coverage))
CmdArgs.push_back(Args.MakeArgString(
Twine("-u", llvm::getInstrProfRuntimeHookVarName())));
ToolChain::addProfileRTLibs(Args, CmdArgs);
ToolChain::addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
}
/// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.

View File

@ -279,7 +279,8 @@ public:
llvm::opt::ArgStringList &CmdArgs) const {}
/// Add the linker arguments to link the compiler runtime library.
virtual void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
virtual void AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
virtual void addStartObjectFileArgs(const llvm::opt::ArgList &Args,
@ -303,7 +304,8 @@ public:
/// Add any profiling runtime libraries that are needed. This is essentially a
/// MachO specific version of addProfileRT in Tools.cpp.
void addProfileRTLibs(const llvm::opt::ArgList &Args,
void addProfileRTLibs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override {
// There aren't any profiling libs for embedded targets currently.
}
@ -417,7 +419,8 @@ public:
!isTargetWatchOS());
}
void addProfileRTLibs(const llvm::opt::ArgList &Args,
void addProfileRTLibs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
protected:
@ -572,7 +575,8 @@ public:
/// @name Apple ToolChain Implementation
/// {
void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
void AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
@ -838,7 +842,8 @@ public:
llvm::opt::ArgStringList &CC1Args) const override;
bool isPIEDefault() const override;
SanitizerMask getSupportedSanitizers() const override;
void addProfileRTLibs(const llvm::opt::ArgList &Args,
void addProfileRTLibs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
virtual std::string computeSysRoot() const;
@ -902,7 +907,8 @@ public:
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,
std::string getCompilerRT(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args, StringRef Component,
bool Shared = false) const override;
std::string computeSysRoot() const override;

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,8 @@ private:
const InputInfo &Output,
const InputInfoList &Inputs) const;
void AddAArch64TargetArgs(const llvm::opt::ArgList &Args,
void AddAArch64TargetArgs(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
void AddARMTargetArgs(const llvm::Triple &Triple,
const llvm::opt::ArgList &Args,
@ -114,6 +115,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -133,6 +135,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -160,6 +163,7 @@ public:
bool hasIntegratedAssembler() const override { return true; }
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
@ -219,6 +223,7 @@ public:
llvm::opt::ArgStringList &CmdArgs) const;
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -234,6 +239,7 @@ public:
llvm::opt::ArgStringList &CmdArgs) const;
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -248,6 +254,7 @@ public:
bool hasIntegratedCPP() const override { return false; }
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -263,6 +270,7 @@ public:
bool hasIntegratedCPP() const override;
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -324,6 +332,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -363,6 +372,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -383,6 +393,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -395,6 +406,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -409,6 +421,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -422,6 +435,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -438,6 +452,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -451,6 +466,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -467,6 +483,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -480,6 +497,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -496,6 +514,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -509,6 +528,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -525,6 +545,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -538,6 +559,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -553,6 +575,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -566,6 +589,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -578,6 +602,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -591,6 +616,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -607,6 +633,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -620,6 +647,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -636,6 +664,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -649,6 +678,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -665,6 +695,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -678,6 +709,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -700,6 +732,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -716,6 +749,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
@ -737,6 +771,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -750,11 +785,13 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
private:
void AddLibGCC(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs) const;
void AddLibGCC(const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args, ArgStringList &CmdArgs) const;
};
} // end namespace MinGW
@ -766,7 +803,9 @@ enum class FloatABI {
Hard,
};
FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args);
FloatABI getARMFloatABI(const ToolChain &TC,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &Args);
} // end namespace arm
namespace ppc {
@ -800,6 +839,7 @@ public:
bool hasIntegratedCPP() const override { return false; }
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -812,6 +852,7 @@ public:
bool isLinkJob() const override { return true; }
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -826,6 +867,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -840,6 +882,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -855,6 +898,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -867,6 +911,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -884,6 +929,7 @@ public:
bool isLinkJob() const override { return true; }
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -898,8 +944,8 @@ public:
bool hasIntegratedCPP() const override { return false; }
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -914,6 +960,7 @@ public:
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -932,6 +979,7 @@ class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@ -948,6 +996,7 @@ class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
void ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
const llvm::Triple &EffectiveTriple,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};