r276936 - Revert "[Driver] Compute effective target triples once per job (NFCI)"
Vedant Kumar via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 27 16:01:55 PDT 2016
Author: vedantk
Date: Wed Jul 27 18:01:55 2016
New Revision: 276936
URL: http://llvm.org/viewvc/llvm-project?rev=276936&view=rev
Log:
Revert "[Driver] Compute effective target triples once per job (NFCI)"
This reverts commit r275895 in order to address some post-commit review
feedback from Eric Christopher (see: the list thread for r275895).
Modified:
cfe/trunk/docs/ReleaseNotes.rst
cfe/trunk/include/clang/Driver/SanitizerArgs.h
cfe/trunk/include/clang/Driver/Tool.h
cfe/trunk/include/clang/Driver/ToolChain.h
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/SanitizerArgs.cpp
cfe/trunk/lib/Driver/ToolChain.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/lib/Driver/Tools.h
Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Wed Jul 27 18:01:55 2016
@@ -121,8 +121,7 @@ These are major API changes that have ha
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
------------
Modified: cfe/trunk/include/clang/Driver/SanitizerArgs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/SanitizerArgs.h?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/SanitizerArgs.h (original)
+++ cfe/trunk/include/clang/Driver/SanitizerArgs.h Wed Jul 27 18:01:55 2016
@@ -16,10 +16,6 @@
#include <string>
#include <vector>
-namespace llvm {
-class Triple;
-}
-
namespace clang {
namespace driver {
@@ -70,8 +66,7 @@ class SanitizerArgs {
bool requiresPIE() const;
bool needsUnwindTables() const;
bool linkCXXRuntimes() const { return LinkCXXRuntimes; }
- void addArgs(const ToolChain &TC, const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
};
Modified: cfe/trunk/include/clang/Driver/Tool.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Tool.h?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Tool.h (original)
+++ cfe/trunk/include/clang/Driver/Tool.h Wed Jul 27 18:01:55 2016
@@ -14,7 +14,6 @@
#include "llvm/Support/Program.h"
namespace llvm {
-class Triple;
namespace opt {
class ArgList;
}
@@ -128,7 +127,6 @@ 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;
};
Modified: cfe/trunk/include/clang/Driver/ToolChain.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/ToolChain.h (original)
+++ cfe/trunk/include/clang/Driver/ToolChain.h Wed Jul 27 18:01:55 2016
@@ -260,13 +260,11 @@ public:
return ToolChain::CST_Libstdcxx;
}
- virtual std::string getCompilerRT(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ virtual std::string getCompilerRT(const llvm::opt::ArgList &Args,
StringRef Component,
bool Shared = false) const;
- const char *getCompilerRTArgString(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ const char *getCompilerRTArgString(const llvm::opt::ArgList &Args,
StringRef Component,
bool Shared = false) const;
/// needsProfileRT - returns true if instrumentation profile is on.
@@ -412,8 +410,7 @@ 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::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ virtual void addProfileRTLibs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
/// \brief Add arguments to use system-specific CUDA includes.
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Jul 27 18:01:55 2016
@@ -2257,21 +2257,7 @@ InputInfo Driver::BuildJobsForActionNoCa
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) {
@@ -2281,7 +2267,7 @@ InputInfo Driver::BuildJobsForActionNoCa
}
llvm::errs() << "], output: " << Result.getAsString() << "\n";
} else {
- T->ConstructJob(C, *JA, Result, InputInfos, EffectiveTriple,
+ T->ConstructJob(C, *JA, Result, InputInfos,
C.getArgsForToolChain(TC, BoundArch), LinkingOutput);
}
return Result;
Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Jul 27 18:01:55 2016
@@ -602,9 +602,7 @@ static void addIncludeLinkerOption(const
CmdArgs.push_back(Args.MakeArgString(LinkerOptionFlag));
}
-void SanitizerArgs::addArgs(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs,
types::ID InputType) const {
// Translate available CoverageFeatures to corresponding clang-cc1 flags.
@@ -628,24 +626,21 @@ void SanitizerArgs::addArgs(const ToolCh
// 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(EffectiveTriple, Args, "ubsan_standalone")));
+ "--dependent-lib=" + TC.getCompilerRT(Args, "ubsan_standalone")));
if (types::isCXX(InputType))
CmdArgs.push_back(Args.MakeArgString(
- "--dependent-lib=" +
- TC.getCompilerRT(EffectiveTriple, Args, "ubsan_standalone_cxx")));
+ "--dependent-lib=" + TC.getCompilerRT(Args, "ubsan_standalone_cxx")));
}
if (TC.getTriple().isOSWindows() && needsStatsRt()) {
- CmdArgs.push_back(Args.MakeArgString(
- "--dependent-lib=" +
- TC.getCompilerRT(EffectiveTriple, Args, "stats_client")));
+ CmdArgs.push_back(Args.MakeArgString("--dependent-lib=" +
+ TC.getCompilerRT(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(EffectiveTriple, Args, "stats")));
+ CmdArgs.push_back(Args.MakeArgString("--dependent-lib=" +
+ TC.getCompilerRT(Args, "stats")));
addIncludeLinkerOption(TC, Args, CmdArgs, "__sanitizer_stats_register");
}
Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Wed Jul 27 18:01:55 2016
@@ -267,52 +267,46 @@ Tool *ToolChain::getTool(Action::ActionC
llvm_unreachable("Invalid tool kind.");
}
-static StringRef
-getArchNameForCompilerRTLib(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const ArgList &Args) {
- bool IsWindows = EffectiveTriple.isOSWindows();
+static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
+ const ArgList &Args) {
+ const llvm::Triple &Triple = TC.getTriple();
+ bool IsWindows = Triple.isOSWindows();
- if (EffectiveTriple.isWindowsMSVCEnvironment() &&
- TC.getArch() == llvm::Triple::x86)
+ if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
return "i386";
if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
- return (arm::getARMFloatABI(TC, EffectiveTriple, Args) ==
- arm::FloatABI::Hard &&
- !IsWindows)
+ return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
? "armhf"
: "arm";
return TC.getArchName();
}
-std::string ToolChain::getCompilerRT(const llvm::Triple &EffectiveTriple,
- const ArgList &Args, StringRef Component,
+std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
bool Shared) const {
- const char *Env = EffectiveTriple.isAndroid() ? "-android" : "";
- bool IsITANMSVCWindows = EffectiveTriple.isWindowsMSVCEnvironment() ||
- EffectiveTriple.isWindowsItaniumEnvironment();
+ const llvm::Triple &TT = getTriple();
+ const char *Env = TT.isAndroid() ? "-android" : "";
+ bool IsITANMSVCWindows =
+ TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment();
- StringRef Arch = getArchNameForCompilerRTLib(*this, EffectiveTriple, Args);
+ StringRef Arch = getArchNameForCompilerRTLib(*this, Args);
const char *Prefix = IsITANMSVCWindows ? "" : "lib";
- const char *Suffix = Shared ? (EffectiveTriple.isOSWindows() ? ".dll" : ".so")
+ const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so")
: (IsITANMSVCWindows ? ".lib" : ".a");
SmallString<128> Path(getDriver().ResourceDir);
- StringRef OSLibName = EffectiveTriple.isOSFreeBSD() ? "freebsd" : getOS();
+ StringRef OSLibName = Triple.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::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
- StringRef Component, bool Shared) const {
- return Args.MakeArgString(
- getCompilerRT(EffectiveTriple, Args, Component, Shared));
+const char *ToolChain::getCompilerRTArgString(const llvm::opt::ArgList &Args,
+ StringRef Component,
+ bool Shared) const {
+ return Args.MakeArgString(getCompilerRT(Args, Component, Shared));
}
bool ToolChain::needsProfileRT(const ArgList &Args) {
@@ -525,13 +519,11 @@ void ToolChain::addClangTargetOptions(co
void ToolChain::addClangWarningOptions(ArgStringList &CC1Args) const {}
-void ToolChain::addProfileRTLibs(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+void ToolChain::addProfileRTLibs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const {
- if (!needsProfileRT(Args))
- return;
+ if (!needsProfileRT(Args)) return;
- CmdArgs.push_back(getCompilerRTArgString(EffectiveTriple, Args, "profile"));
+ CmdArgs.push_back(getCompilerRTArgString(Args, "profile"));
}
ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType(
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Jul 27 18:01:55 2016
@@ -380,16 +380,13 @@ StringRef Darwin::getOSLibraryNameSuffix
llvm_unreachable("Unsupported platform");
}
-void Darwin::addProfileRTLibs(const llvm::Triple &EffectiveTriple,
- const ArgList &Args,
+void Darwin::addProfileRTLibs(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,
@@ -415,8 +412,7 @@ ToolChain::RuntimeLibType DarwinClang::G
return ToolChain::RLT_CompilerRT;
}
-void DarwinClang::AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
- const ArgList &Args,
+void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
// Call once to ensure diagnostic is printed if wrong value was specified
GetRuntimeLibType(Args);
@@ -1021,17 +1017,16 @@ DerivedArgList *MachO::TranslateArgs(con
return DAL;
}
-void MachO::AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
- const ArgList &Args,
+void MachO::AddLinkRuntimeLibArgs(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, EffectiveTriple, Args) ==
- tools::arm::FloatABI::Hard)
- ? "hard"
- : "soft";
+ CompilerRT +=
+ (tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard)
+ ? "hard"
+ : "soft";
CompilerRT += Args.hasArg(options::OPT_fPIC) ? "_pic.a" : "_static.a";
AddLinkRuntimeLib(Args, CmdArgs, CompilerRT, false, true);
@@ -2923,10 +2918,9 @@ void MipsLLVMToolChain::AddCXXStdlibLibA
CmdArgs.push_back("-lunwind");
}
-std::string
-MipsLLVMToolChain::getCompilerRT(const llvm::Triple &EffectiveTriple,
- const ArgList &Args, StringRef Component,
- bool Shared) const {
+std::string MipsLLVMToolChain::getCompilerRT(const ArgList &Args,
+ StringRef Component,
+ bool Shared) const {
SmallString<128> Path(getDriver().ResourceDir);
llvm::sys::path::append(Path, SelectedMultilib.osSuffix(), "lib" + LibSuffix,
getOS());
@@ -4314,9 +4308,9 @@ std::string Linux::getDynamicLinker(cons
case llvm::Triple::thumb:
case llvm::Triple::armeb:
case llvm::Triple::thumbeb: {
- const bool HF = Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
- tools::arm::getARMFloatABI(*this, Triple, Args) ==
- tools::arm::FloatABI::Hard;
+ const bool HF =
+ Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
+ tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard;
LibDir = "lib";
Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3";
@@ -4708,18 +4702,16 @@ SanitizerMask Linux::getSupportedSanitiz
return Res;
}
-void Linux::addProfileRTLibs(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+void Linux::addProfileRTLibs(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(EffectiveTriple, Args, CmdArgs);
+ ToolChain::addProfileRTLibs(Args, CmdArgs);
}
/// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Wed Jul 27 18:01:55 2016
@@ -279,8 +279,7 @@ public:
llvm::opt::ArgStringList &CmdArgs) const {}
/// Add the linker arguments to link the compiler runtime library.
- virtual void AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ virtual void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
virtual void addStartObjectFileArgs(const llvm::opt::ArgList &Args,
@@ -304,8 +303,7 @@ 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::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ void addProfileRTLibs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override {
// There aren't any profiling libs for embedded targets currently.
}
@@ -419,8 +417,7 @@ public:
!isTargetWatchOS());
}
- void addProfileRTLibs(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ void addProfileRTLibs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
protected:
@@ -577,8 +574,7 @@ public:
RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
- void AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
@@ -844,8 +840,7 @@ public:
llvm::opt::ArgStringList &CC1Args) const override;
bool isPIEDefault() const override;
SanitizerMask getSupportedSanitizers() const override;
- void addProfileRTLibs(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ void addProfileRTLibs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
virtual std::string computeSysRoot() const;
@@ -909,8 +904,7 @@ public:
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;
- std::string getCompilerRT(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args, StringRef Component,
+ std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,
bool Shared = false) const override;
std::string computeSysRoot() const override;
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jul 27 18:01:55 2016
@@ -762,11 +762,10 @@ static bool useAAPCSForMachO(const llvm:
// Select the float ABI as determined by -msoft-float, -mhard-float, and
// -mfloat-abi=.
-arm::FloatABI arm::getARMFloatABI(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const ArgList &Args) {
+arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) {
const Driver &D = TC.getDriver();
- auto SubArch = getARMSubArchVersionNumber(EffectiveTriple);
+ const llvm::Triple Triple(TC.ComputeEffectiveClangTriple(Args));
+ auto SubArch = getARMSubArchVersionNumber(Triple);
arm::FloatABI ABI = FloatABI::Invalid;
if (Arg *A =
Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float,
@@ -789,23 +788,23 @@ arm::FloatABI arm::getARMFloatABI(const
// It is incorrect to select hard float ABI on MachO platforms if the ABI is
// "apcs-gnu".
- if (EffectiveTriple.isOSBinFormatMachO() &&
- !useAAPCSForMachO(EffectiveTriple) && ABI == FloatABI::Hard) {
- D.Diag(diag::err_drv_unsupported_opt_for_target)
- << A->getAsString(Args) << EffectiveTriple.getArchName();
+ if (Triple.isOSBinFormatMachO() && !useAAPCSForMachO(Triple) &&
+ ABI == FloatABI::Hard) {
+ D.Diag(diag::err_drv_unsupported_opt_for_target) << A->getAsString(Args)
+ << Triple.getArchName();
}
}
// If unspecified, choose the default based on the platform.
if (ABI == FloatABI::Invalid) {
- switch (EffectiveTriple.getOS()) {
+ switch (Triple.getOS()) {
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
case llvm::Triple::IOS:
case llvm::Triple::TvOS: {
// Darwin defaults to "softfp" for v6 and v7.
ABI = (SubArch == 6 || SubArch == 7) ? FloatABI::SoftFP : FloatABI::Soft;
- ABI = EffectiveTriple.isWatchABI() ? FloatABI::Hard : ABI;
+ ABI = Triple.isWatchABI() ? FloatABI::Hard : ABI;
break;
}
case llvm::Triple::WatchOS:
@@ -818,7 +817,7 @@ arm::FloatABI arm::getARMFloatABI(const
break;
case llvm::Triple::FreeBSD:
- switch (EffectiveTriple.getEnvironment()) {
+ switch (Triple.getEnvironment()) {
case llvm::Triple::GNUEABIHF:
ABI = FloatABI::Hard;
break;
@@ -830,7 +829,7 @@ arm::FloatABI arm::getARMFloatABI(const
break;
default:
- switch (EffectiveTriple.getEnvironment()) {
+ switch (Triple.getEnvironment()) {
case llvm::Triple::GNUEABIHF:
case llvm::Triple::MuslEABIHF:
case llvm::Triple::EABIHF:
@@ -847,14 +846,14 @@ arm::FloatABI arm::getARMFloatABI(const
break;
default:
// Assume "soft", but warn the user we are guessing.
- if (EffectiveTriple.isOSBinFormatMachO() &&
- EffectiveTriple.getSubArch() == llvm::Triple::ARMSubArch_v7em)
+ if (Triple.isOSBinFormatMachO() &&
+ Triple.getSubArch() == llvm::Triple::ARMSubArch_v7em)
ABI = FloatABI::Hard;
else
ABI = FloatABI::Soft;
- if (EffectiveTriple.getOS() != llvm::Triple::UnknownOS ||
- !EffectiveTriple.isOSBinFormatMachO())
+ if (Triple.getOS() != llvm::Triple::UnknownOS ||
+ !Triple.isOSBinFormatMachO())
D.Diag(diag::warn_drv_assuming_mfloat_abi_is) << "soft";
break;
}
@@ -874,7 +873,7 @@ static void getARMTargetFeatures(const T
bool KernelOrKext =
Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext);
- arm::FloatABI ABI = arm::getARMFloatABI(TC, Triple, Args);
+ arm::FloatABI ABI = arm::getARMFloatABI(TC, Args);
const Arg *WaCPU = nullptr, *WaFPU = nullptr;
const Arg *WaHDiv = nullptr, *WaArch = nullptr;
@@ -1003,7 +1002,7 @@ static void getARMTargetFeatures(const T
Features.push_back("+long-calls");
} else if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6)) &&
!Triple.isWatchOS()) {
- Features.push_back("+long-calls");
+ Features.push_back("+long-calls");
}
// Kernel code has more strict alignment requirements.
@@ -1017,8 +1016,7 @@ static void getARMTargetFeatures(const T
D.Diag(diag::err_target_unsupported_unaligned) << "v6m";
// v8M Baseline follows on from v6M, so doesn't support unaligned memory
// access either.
- else if (Triple.getSubArch() ==
- llvm::Triple::SubArchType::ARMSubArch_v8m_baseline)
+ else if (Triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v8m_baseline)
D.Diag(diag::err_target_unsupported_unaligned) << "v8m.base";
} else
Features.push_back("+strict-align");
@@ -1104,7 +1102,7 @@ void Clang::AddARMTargetArgs(const llvm:
CmdArgs.push_back(ABIName);
// Determine floating point ABI from the options & target defaults.
- arm::FloatABI ABI = arm::getARMFloatABI(getToolChain(), Triple, Args);
+ arm::FloatABI ABI = arm::getARMFloatABI(getToolChain(), Args);
if (ABI == arm::FloatABI::Soft) {
// Floating point operations and argument passing are soft.
// FIXME: This changes CPP defines, we need -target-soft-float.
@@ -1165,9 +1163,11 @@ static std::string getAArch64TargetCPU(c
return "generic";
}
-void Clang::AddAArch64TargetArgs(const llvm::Triple &EffectiveTriple,
- const ArgList &Args,
+void Clang::AddAArch64TargetArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
+ std::string TripleStr = getToolChain().ComputeEffectiveClangTriple(Args);
+ llvm::Triple Triple(TripleStr);
+
if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true) ||
Args.hasArg(options::OPT_mkernel) ||
Args.hasArg(options::OPT_fapple_kext))
@@ -1180,7 +1180,7 @@ void Clang::AddAArch64TargetArgs(const l
const char *ABIName = nullptr;
if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ))
ABIName = A->getValue();
- else if (EffectiveTriple.isOSDarwin())
+ else if (Triple.isOSDarwin())
ABIName = "darwinpcs";
else
ABIName = "aapcs";
@@ -1195,7 +1195,7 @@ void Clang::AddAArch64TargetArgs(const l
CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1");
else
CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=0");
- } else if (EffectiveTriple.isAndroid()) {
+ } else if (Triple.isAndroid()) {
// Enabled A53 errata (835769) workaround by default on android
CmdArgs.push_back("-backend-option");
CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1");
@@ -3011,10 +3011,9 @@ static void CollectArgsForIntegratedAsse
// This adds the static libclang_rt.builtins-arch.a directly to the command line
// FIXME: Make sure we can also emit shared objects if they're requested
// and available, check for possible errors, etc.
-static void addClangRT(const ToolChain &TC, const llvm::Triple &EffectiveTriple,
- const ArgList &Args, ArgStringList &CmdArgs) {
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, "builtins"));
+static void addClangRT(const ToolChain &TC, const ArgList &Args,
+ ArgStringList &CmdArgs) {
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins"));
}
namespace {
@@ -3088,27 +3087,22 @@ static void addOpenMPRuntime(ArgStringLi
}
}
-static void addSanitizerRuntime(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const ArgList &Args, ArgStringList &CmdArgs,
- StringRef Sanitizer, bool IsShared,
- bool IsWhole) {
+static void addSanitizerRuntime(const ToolChain &TC, const ArgList &Args,
+ ArgStringList &CmdArgs, StringRef Sanitizer,
+ bool IsShared, bool IsWhole) {
// Wrap any static runtimes that must be forced into executable in
// whole-archive.
if (IsWhole) CmdArgs.push_back("-whole-archive");
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, Sanitizer, IsShared));
- if (IsWhole)
- CmdArgs.push_back("-no-whole-archive");
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, Sanitizer, IsShared));
+ if (IsWhole) CmdArgs.push_back("-no-whole-archive");
}
// Tries to use a file with the list of dynamic symbols that need to be exported
// from the runtime library. Returns true if the file was found.
-static bool addSanitizerDynamicList(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const ArgList &Args, ArgStringList &CmdArgs,
+static bool addSanitizerDynamicList(const ToolChain &TC, const ArgList &Args,
+ ArgStringList &CmdArgs,
StringRef Sanitizer) {
- SmallString<128> SanRT(TC.getCompilerRT(EffectiveTriple, Args, Sanitizer));
+ SmallString<128> SanRT(TC.getCompilerRT(Args, Sanitizer));
if (llvm::sys::fs::exists(SanRT + ".syms")) {
CmdArgs.push_back(Args.MakeArgString("--dynamic-list=" + SanRT + ".syms"));
return true;
@@ -3197,28 +3191,25 @@ collectSanitizerRuntimes(const ToolChain
// Should be called before we add system libraries (C++ ABI, libstdc++/libc++,
// C runtime, etc). Returns true if sanitizer system deps need to be linked in.
-static bool addSanitizerRuntimes(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const ArgList &Args, ArgStringList &CmdArgs) {
+static bool addSanitizerRuntimes(const ToolChain &TC, const ArgList &Args,
+ ArgStringList &CmdArgs) {
SmallVector<StringRef, 4> SharedRuntimes, StaticRuntimes,
NonWholeStaticRuntimes, HelperStaticRuntimes, RequiredSymbols;
collectSanitizerRuntimes(TC, Args, SharedRuntimes, StaticRuntimes,
NonWholeStaticRuntimes, HelperStaticRuntimes,
RequiredSymbols);
for (auto RT : SharedRuntimes)
- addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, true, false);
+ addSanitizerRuntime(TC, Args, CmdArgs, RT, true, false);
for (auto RT : HelperStaticRuntimes)
- addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, false, true);
+ addSanitizerRuntime(TC, Args, CmdArgs, RT, false, true);
bool AddExportDynamic = false;
for (auto RT : StaticRuntimes) {
- addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, false, true);
- AddExportDynamic |=
- !addSanitizerDynamicList(TC, EffectiveTriple, Args, CmdArgs, RT);
+ addSanitizerRuntime(TC, Args, CmdArgs, RT, false, true);
+ AddExportDynamic |= !addSanitizerDynamicList(TC, Args, CmdArgs, RT);
}
for (auto RT : NonWholeStaticRuntimes) {
- addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, false, false);
- AddExportDynamic |=
- !addSanitizerDynamicList(TC, EffectiveTriple, Args, CmdArgs, RT);
+ addSanitizerRuntime(TC, Args, CmdArgs, RT, false, false);
+ AddExportDynamic |= !addSanitizerDynamicList(TC, Args, CmdArgs, RT);
}
for (auto S : RequiredSymbols) {
CmdArgs.push_back("-u");
@@ -3231,14 +3222,12 @@ static bool addSanitizerRuntimes(const T
return !StaticRuntimes.empty();
}
-static bool addXRayRuntime(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const ArgList &Args, ArgStringList &CmdArgs) {
+static bool addXRayRuntime(const ToolChain &TC, const ArgList &Args,
+ ArgStringList &CmdArgs) {
if (Args.hasFlag(options::OPT_fxray_instrument,
options::OPT_fnoxray_instrument, false)) {
CmdArgs.push_back("-whole-archive");
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, "xray", false));
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, "xray", false));
CmdArgs.push_back("-no-whole-archive");
return true;
}
@@ -3848,9 +3837,9 @@ static void AddAssemblerKPIC(const ToolC
void Clang::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args, const char *LinkingOutput) const {
- std::string TripleStr = EffectiveTriple.str();
+ std::string TripleStr = getToolChain().ComputeEffectiveClangTriple(Args);
+ const llvm::Triple Triple(TripleStr);
bool KernelOrKext =
Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext);
@@ -3903,14 +3892,13 @@ void Clang::ConstructJob(Compilation &C,
CmdArgs.push_back(Args.MakeArgString(NormalizedTriple));
}
- if (EffectiveTriple.isOSWindows() &&
- (EffectiveTriple.getArch() == llvm::Triple::arm ||
- EffectiveTriple.getArch() == llvm::Triple::thumb)) {
- unsigned Offset = EffectiveTriple.getArch() == llvm::Triple::arm ? 4 : 6;
+ if (Triple.isOSWindows() && (Triple.getArch() == llvm::Triple::arm ||
+ Triple.getArch() == llvm::Triple::thumb)) {
+ unsigned Offset = Triple.getArch() == llvm::Triple::arm ? 4 : 6;
unsigned Version;
- EffectiveTriple.getArchName().substr(Offset).getAsInteger(10, Version);
+ Triple.getArchName().substr(Offset).getAsInteger(10, Version);
if (Version < 7)
- D.Diag(diag::err_target_unsupported_arch) << EffectiveTriple.getArchName()
+ D.Diag(diag::err_target_unsupported_arch) << Triple.getArchName()
<< TripleStr;
}
@@ -4112,7 +4100,7 @@ void Clang::ConstructJob(Compilation &C,
unsigned PICLevel;
bool IsPIE;
std::tie(RelocationModel, PICLevel, IsPIE) =
- ParsePICArgs(getToolChain(), EffectiveTriple, Args);
+ ParsePICArgs(getToolChain(), Triple, Args);
const char *RMName = RelocationModelName(RelocationModel);
if (RMName) {
@@ -4215,7 +4203,8 @@ void Clang::ConstructJob(Compilation &C,
false))
CmdArgs.push_back("-fstrict-enums");
if (Args.hasFlag(options::OPT_fstrict_vtable_pointers,
- options::OPT_fno_strict_vtable_pointers, false))
+ options::OPT_fno_strict_vtable_pointers,
+ false))
CmdArgs.push_back("-fstrict-vtable-pointers");
if (!Args.hasFlag(options::OPT_foptimize_sibling_calls,
options::OPT_fno_optimize_sibling_calls))
@@ -4430,7 +4419,7 @@ void Clang::ConstructJob(Compilation &C,
}
// Add the target cpu
- std::string CPU = getCPUName(Args, EffectiveTriple, /*FromAs*/ false);
+ std::string CPU = getCPUName(Args, Triple, /*FromAs*/ false);
if (!CPU.empty()) {
CmdArgs.push_back("-target-cpu");
CmdArgs.push_back(Args.MakeArgString(CPU));
@@ -4442,7 +4431,7 @@ void Clang::ConstructJob(Compilation &C,
}
// Add the target features
- getTargetFeatures(getToolChain(), EffectiveTriple, Args, CmdArgs, false);
+ getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, false);
// Add target specific flags.
switch (getToolChain().getArch()) {
@@ -4454,12 +4443,12 @@ void Clang::ConstructJob(Compilation &C,
case llvm::Triple::thumb:
case llvm::Triple::thumbeb:
// Use the effective triple, which takes into account the deployment target.
- AddARMTargetArgs(EffectiveTriple, Args, CmdArgs, KernelOrKext);
+ AddARMTargetArgs(Triple, Args, CmdArgs, KernelOrKext);
break;
case llvm::Triple::aarch64:
case llvm::Triple::aarch64_be:
- AddAArch64TargetArgs(EffectiveTriple, Args, CmdArgs);
+ AddAArch64TargetArgs(Args, CmdArgs);
break;
case llvm::Triple::mips:
@@ -4580,8 +4569,8 @@ void Clang::ConstructJob(Compilation &C,
}
// If a debugger tuning argument appeared, remember it.
- if (Arg *A =
- Args.getLastArg(options::OPT_gTune_Group, options::OPT_ggdbN_Group)) {
+ if (Arg *A = Args.getLastArg(options::OPT_gTune_Group,
+ options::OPT_ggdbN_Group)) {
if (A->getOption().matches(options::OPT_glldb))
DebuggerTuning = llvm::DebuggerKind::LLDB;
else if (A->getOption().matches(options::OPT_gsce))
@@ -4610,7 +4599,7 @@ void Clang::ConstructJob(Compilation &C,
// PS4 defaults to no column info
if (Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info,
- /*Default=*/!IsPS4CPU))
+ /*Default=*/ !IsPS4CPU))
CmdArgs.push_back("-dwarf-column-info");
// FIXME: Move backend command line options to the module.
@@ -4664,10 +4653,9 @@ void Clang::ConstructJob(Compilation &C,
// CloudABI and WebAssembly use -ffunction-sections and -fdata-sections by
// default.
- bool UseSeparateSections =
- EffectiveTriple.getOS() == llvm::Triple::CloudABI ||
- EffectiveTriple.getArch() == llvm::Triple::wasm32 ||
- EffectiveTriple.getArch() == llvm::Triple::wasm64;
+ bool UseSeparateSections = Triple.getOS() == llvm::Triple::CloudABI ||
+ Triple.getArch() == llvm::Triple::wasm32 ||
+ Triple.getArch() == llvm::Triple::wasm64;
if (Args.hasFlag(options::OPT_ffunction_sections,
options::OPT_fno_function_sections, UseSeparateSections)) {
@@ -5036,8 +5024,7 @@ void Clang::ConstructJob(Compilation &C,
Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
// Emulated TLS is enabled by default on Android, and can be enabled manually
// with -femulated-tls.
- bool EmulatedTLSDefault = EffectiveTriple.isAndroid() ||
- EffectiveTriple.isWindowsCygwinEnvironment();
+ bool EmulatedTLSDefault = Triple.isAndroid() || Triple.isWindowsCygwinEnvironment();
if (Args.hasFlag(options::OPT_femulated_tls, options::OPT_fno_emulated_tls,
EmulatedTLSDefault))
CmdArgs.push_back("-femulated-tls");
@@ -5078,7 +5065,7 @@ void Clang::ConstructJob(Compilation &C,
}
const SanitizerArgs &Sanitize = getToolChain().getSanitizerArgs();
- Sanitize.addArgs(getToolChain(), EffectiveTriple, Args, CmdArgs, InputType);
+ Sanitize.addArgs(getToolChain(), Args, CmdArgs, InputType);
// Report an error for -faltivec on anything other than PowerPC.
if (const Arg *A = Args.getLastArg(options::OPT_faltivec)) {
@@ -5220,9 +5207,9 @@ void Clang::ConstructJob(Compilation &C,
CmdArgs.push_back("-backend-option");
CmdArgs.push_back("-arm-no-restrict-it");
}
- } else if (EffectiveTriple.isOSWindows() &&
- (EffectiveTriple.getArch() == llvm::Triple::arm ||
- EffectiveTriple.getArch() == llvm::Triple::thumb)) {
+ } else if (Triple.isOSWindows() &&
+ (Triple.getArch() == llvm::Triple::arm ||
+ Triple.getArch() == llvm::Triple::thumb)) {
// Windows on ARM expects restricted IT blocks
CmdArgs.push_back("-backend-option");
CmdArgs.push_back("-arm-restrict-it");
@@ -5576,7 +5563,7 @@ void Clang::ConstructJob(Compilation &C,
if (Args.hasArg(options::OPT_fno_inline))
CmdArgs.push_back("-fno-inline");
- if (Arg *InlineArg = Args.getLastArg(options::OPT_finline_functions,
+ if (Arg* InlineArg = Args.getLastArg(options::OPT_finline_functions,
options::OPT_finline_hint_functions,
options::OPT_fno_inline_functions))
InlineArg->render(Args, CmdArgs);
@@ -5638,6 +5625,7 @@ void Clang::ConstructJob(Compilation &C,
options::OPT_fno_objc_arc_exceptions,
/*default*/ types::isCXX(InputType)))
CmdArgs.push_back("-fobjc-arc-exceptions");
+
}
// -fobjc-infer-related-result-type is the default, except in the Objective-C
@@ -5663,8 +5651,8 @@ void Clang::ConstructJob(Compilation &C,
// Pass down -fobjc-weak or -fno-objc-weak if present.
if (types::isObjC(InputType)) {
- auto WeakArg =
- Args.getLastArg(options::OPT_fobjc_weak, options::OPT_fno_objc_weak);
+ auto WeakArg = Args.getLastArg(options::OPT_fobjc_weak,
+ options::OPT_fno_objc_weak);
if (!WeakArg) {
// nothing to do
} else if (GCArg) {
@@ -5834,7 +5822,7 @@ void Clang::ConstructJob(Compilation &C,
StringRef Value(A->getValue());
if (Value != "always" && Value != "never" && Value != "auto")
getToolChain().getDriver().Diag(diag::err_drv_clang_unsupported)
- << ("-fdiagnostics-color=" + Value).str();
+ << ("-fdiagnostics-color=" + Value).str();
}
A->claim();
}
@@ -6505,7 +6493,6 @@ void ClangAs::AddX86TargetArgs(const Arg
void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output, const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -6513,7 +6500,9 @@ void ClangAs::ConstructJob(Compilation &
assert(Inputs.size() == 1 && "Unexpected number of inputs.");
const InputInfo &Input = Inputs[0];
- std::string TripleStr = EffectiveTriple.str();
+ std::string TripleStr =
+ getToolChain().ComputeEffectiveClangTriple(Args, Input.getType());
+ const llvm::Triple Triple(TripleStr);
// Don't warn about "clang -w -c foo.s"
Args.ClaimAllArgs(options::OPT_w);
@@ -6542,14 +6531,14 @@ void ClangAs::ConstructJob(Compilation &
CmdArgs.push_back(Clang::getBaseInputName(Args, Input));
// Add the target cpu
- std::string CPU = getCPUName(Args, EffectiveTriple, /*FromAs*/ true);
+ std::string CPU = getCPUName(Args, Triple, /*FromAs*/ true);
if (!CPU.empty()) {
CmdArgs.push_back("-target-cpu");
CmdArgs.push_back(Args.MakeArgString(CPU));
}
// Add the target features
- getTargetFeatures(getToolChain(), EffectiveTriple, Args, CmdArgs, true);
+ getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, true);
// Ignore explicit -force_cpusubtype_ALL option.
(void)Args.hasArg(options::OPT_force__cpusubtype__ALL);
@@ -6608,7 +6597,7 @@ void ClangAs::ConstructJob(Compilation &
unsigned PICLevel;
bool IsPIE;
std::tie(RelocationModel, PICLevel, IsPIE) =
- ParsePICArgs(getToolChain(), EffectiveTriple, Args);
+ ParsePICArgs(getToolChain(), Triple, Args);
const char *RMName = RelocationModelName(RelocationModel);
if (RMName) {
@@ -6691,9 +6680,7 @@ void GnuTool::anchor() {}
void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
- const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
- const ArgList &Args,
+ const InputInfoList &Inputs, const ArgList &Args,
const char *LinkingOutput) const {
const Driver &D = getToolChain().getDriver();
ArgStringList CmdArgs;
@@ -6860,7 +6847,6 @@ void hexagon::Assembler::RenderExtraTool
void hexagon::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -7104,7 +7090,6 @@ constructHexagonLinkArgs(Compilation &C,
void hexagon::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
auto &HTC = static_cast<const toolchains::HexagonToolChain&>(getToolChain());
@@ -7122,7 +7107,6 @@ void hexagon::Linker::ConstructJob(Compi
void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
@@ -7151,7 +7135,6 @@ bool wasm::Linker::hasIntegratedCPP() co
void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
@@ -7227,8 +7210,7 @@ const std::string arm::getARMArch(String
std::string CPU = llvm::sys::getHostCPUName();
if (CPU != "generic") {
// Translate the native cpu into the architecture suffix for that CPU.
- StringRef Suffix =
- arm::getLLVMArchSuffixForARM(CPU, MArch, Triple);
+ StringRef Suffix = arm::getLLVMArchSuffixForARM(CPU, MArch, Triple);
// If there is no valid architecture suffix for this CPU we don't know how
// to handle it, so return no architecture.
if (Suffix.empty())
@@ -7488,7 +7470,6 @@ const char *Clang::getDependencyFileName
void cloudabi::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const ToolChain &ToolChain = getToolChain();
@@ -7557,7 +7538,6 @@ void cloudabi::Linker::ConstructJob(Comp
void darwin::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -7855,7 +7835,6 @@ void darwin::Linker::AddLinkArgs(Compila
void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
assert(Output.getType() == types::TY_Image && "Invalid linker output type.");
@@ -7957,7 +7936,7 @@ void darwin::Linker::ConstructJob(Compil
if (Args.hasArg(options::OPT_fnested_functions))
CmdArgs.push_back("-allow_stack_execute");
- getMachOToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ getMachOToolChain().addProfileRTLibs(Args, CmdArgs);
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
if (getToolChain().getDriver().CCCIsCXX())
@@ -7966,7 +7945,7 @@ void darwin::Linker::ConstructJob(Compil
// link_ssp spec is empty.
// Let the tool chain choose which runtime library to link.
- getMachOToolChain().AddLinkRuntimeLibArgs(EffectiveTriple, Args, CmdArgs);
+ getMachOToolChain().AddLinkRuntimeLibArgs(Args, CmdArgs);
}
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
@@ -7999,7 +7978,6 @@ void darwin::Linker::ConstructJob(Compil
void darwin::Lipo::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -8022,7 +8000,6 @@ void darwin::Lipo::ConstructJob(Compilat
void darwin::Dsymutil::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -8043,7 +8020,6 @@ void darwin::Dsymutil::ConstructJob(Comp
void darwin::VerifyDebug::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -8067,7 +8043,6 @@ void darwin::VerifyDebug::ConstructJob(C
void solaris::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -8088,7 +8063,6 @@ void solaris::Assembler::ConstructJob(Co
void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -8158,7 +8132,7 @@ void solaris::Linker::ConstructJob(Compi
}
CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
- getToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ getToolChain().addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
@@ -8167,7 +8141,6 @@ void solaris::Linker::ConstructJob(Compi
void openbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -8239,7 +8212,6 @@ void openbsd::Assembler::ConstructJob(Co
void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const Driver &D = getToolChain().getDriver();
@@ -8362,7 +8334,6 @@ void openbsd::Linker::ConstructJob(Compi
void bitrig::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -8383,7 +8354,6 @@ void bitrig::Assembler::ConstructJob(Com
void bitrig::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const Driver &D = getToolChain().getDriver();
@@ -8493,7 +8463,6 @@ void bitrig::Linker::ConstructJob(Compil
void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -8543,8 +8512,7 @@ void freebsd::Assembler::ConstructJob(Co
case llvm::Triple::armeb:
case llvm::Triple::thumb:
case llvm::Triple::thumbeb: {
- arm::FloatABI ABI =
- arm::getARMFloatABI(getToolChain(), EffectiveTriple, Args);
+ arm::FloatABI ABI = arm::getARMFloatABI(getToolChain(), Args);
if (ABI == arm::FloatABI::Hard)
CmdArgs.push_back("-mfpu=vfp");
@@ -8588,7 +8556,6 @@ void freebsd::Assembler::ConstructJob(Co
void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const toolchains::FreeBSD &ToolChain =
@@ -8703,8 +8670,7 @@ void freebsd::Linker::ConstructJob(Compi
if (D.isUsingLTO())
AddGoldPlugin(ToolChain, Args, CmdArgs, D.getLTOMode() == LTOK_Thin);
- bool NeedsSanitizerDeps =
- addSanitizerRuntimes(ToolChain, EffectiveTriple, Args, CmdArgs);
+ bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
@@ -8771,7 +8737,7 @@ void freebsd::Linker::ConstructJob(Compi
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
}
- ToolChain.addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ ToolChain.addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
@@ -8780,7 +8746,6 @@ void freebsd::Linker::ConstructJob(Compi
void netbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -8864,7 +8829,6 @@ void netbsd::Assembler::ConstructJob(Com
void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const Driver &D = getToolChain().getDriver();
@@ -8914,7 +8878,9 @@ void netbsd::Linker::ConstructJob(Compil
break;
case llvm::Triple::armeb:
case llvm::Triple::thumbeb:
- arm::appendEBLinkFlags(Args, CmdArgs, EffectiveTriple);
+ arm::appendEBLinkFlags(
+ Args, CmdArgs,
+ llvm::Triple(getToolChain().ComputeEffectiveClangTriple(Args)));
CmdArgs.push_back("-m");
switch (getToolChain().getTriple().getEnvironment()) {
case llvm::Triple::EABI:
@@ -9065,7 +9031,7 @@ void netbsd::Linker::ConstructJob(Compil
CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
}
- getToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ getToolChain().addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
@@ -9074,18 +9040,20 @@ void netbsd::Linker::ConstructJob(Compil
void gnutools::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
+ std::string TripleStr = getToolChain().ComputeEffectiveClangTriple(Args);
+ llvm::Triple Triple = llvm::Triple(TripleStr);
+
ArgStringList CmdArgs;
llvm::Reloc::Model RelocationModel;
unsigned PICLevel;
bool IsPIE;
std::tie(RelocationModel, PICLevel, IsPIE) =
- ParsePICArgs(getToolChain(), EffectiveTriple, Args);
+ ParsePICArgs(getToolChain(), Triple, Args);
switch (getToolChain().getArch()) {
default:
@@ -9148,7 +9116,7 @@ void gnutools::Assembler::ConstructJob(C
break;
}
- switch (arm::getARMFloatABI(getToolChain(), EffectiveTriple, Args)) {
+ switch (arm::getARMFloatABI(getToolChain(), Args)) {
case arm::FloatABI::Invalid: llvm_unreachable("must have an ABI!");
case arm::FloatABI::Soft:
CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=soft"));
@@ -9323,7 +9291,6 @@ static void AddLibgcc(const llvm::Triple
}
static void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
- const llvm::Triple &EffectiveTriple,
ArgStringList &CmdArgs, const ArgList &Args) {
// Make use of compiler-rt if --rtlib option is used
ToolChain::RuntimeLibType RLT = TC.GetRuntimeLibType(Args);
@@ -9335,7 +9302,7 @@ static void AddRunTimeLibs(const ToolCha
llvm_unreachable("unsupported OS");
case llvm::Triple::Win32:
case llvm::Triple::Linux:
- addClangRT(TC, EffectiveTriple, Args, CmdArgs);
+ addClangRT(TC, Args, CmdArgs);
break;
}
break;
@@ -9407,13 +9374,15 @@ static const char *getLDMOption(const ll
void gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const toolchains::Linux &ToolChain =
static_cast<const toolchains::Linux &>(getToolChain());
const Driver &D = ToolChain.getDriver();
+ std::string TripleStr = getToolChain().ComputeEffectiveClangTriple(Args);
+ llvm::Triple Triple = llvm::Triple(TripleStr);
+
const llvm::Triple::ArchType Arch = ToolChain.getArch();
const bool isAndroid = ToolChain.getTriple().isAndroid();
const bool IsIAMCU = ToolChain.getTriple().isOSIAMCU();
@@ -9455,7 +9424,7 @@ void gnutools::Linker::ConstructJob(Comp
CmdArgs.push_back("-s");
if (Arch == llvm::Triple::armeb || Arch == llvm::Triple::thumbeb)
- arm::appendEBLinkFlags(Args, CmdArgs, EffectiveTriple);
+ arm::appendEBLinkFlags(Args, CmdArgs, Triple);
for (const auto &Opt : ToolChain.ExtraOpts)
CmdArgs.push_back(Opt.c_str());
@@ -9541,13 +9510,11 @@ void gnutools::Linker::ConstructJob(Comp
if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle))
CmdArgs.push_back("--no-demangle");
- bool NeedsSanitizerDeps =
- addSanitizerRuntimes(ToolChain, EffectiveTriple, Args, CmdArgs);
- bool NeedsXRayDeps =
- addXRayRuntime(ToolChain, EffectiveTriple, Args, CmdArgs);
+ bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
+ bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
// The profile runtime also needs access to system libraries.
- getToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ getToolChain().addProfileRTLibs(Args, CmdArgs);
if (D.CCCIsCXX() &&
!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
@@ -9604,7 +9571,7 @@ void gnutools::Linker::ConstructJob(Comp
}
}
- AddRunTimeLibs(ToolChain, D, EffectiveTriple, CmdArgs, Args);
+ AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
if (WantPthread && !isAndroid)
CmdArgs.push_back("-lpthread");
@@ -9621,7 +9588,7 @@ void gnutools::Linker::ConstructJob(Comp
if (Args.hasArg(options::OPT_static))
CmdArgs.push_back("--end-group");
else
- AddRunTimeLibs(ToolChain, D, EffectiveTriple, CmdArgs, Args);
+ AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
// Add IAMCU specific libs (outside the group), if needed.
if (IsIAMCU) {
@@ -9657,7 +9624,6 @@ void gnutools::Linker::ConstructJob(Comp
void nacltools::AssemblerARM::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const toolchains::NaClToolChain &ToolChain =
@@ -9667,8 +9633,8 @@ void nacltools::AssemblerARM::ConstructJ
InputInfoList NewInputs;
NewInputs.push_back(NaClMacros);
NewInputs.append(Inputs.begin(), Inputs.end());
- gnutools::Assembler::ConstructJob(C, JA, Output, NewInputs, EffectiveTriple,
- Args, LinkingOutput);
+ gnutools::Assembler::ConstructJob(C, JA, Output, NewInputs, Args,
+ LinkingOutput);
}
// This is quite similar to gnutools::Linker::ConstructJob with changes that
@@ -9678,7 +9644,6 @@ void nacltools::AssemblerARM::ConstructJ
void nacltools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
@@ -9827,7 +9792,6 @@ void nacltools::Linker::ConstructJob(Com
void minix::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -9848,7 +9812,6 @@ void minix::Assembler::ConstructJob(Comp
void minix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const Driver &D = getToolChain().getDriver();
@@ -9874,7 +9837,7 @@ void minix::Linker::ConstructJob(Compila
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
- getToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ getToolChain().addProfileRTLibs(Args, CmdArgs);
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
if (D.CCCIsCXX()) {
@@ -9904,7 +9867,6 @@ void minix::Linker::ConstructJob(Compila
void dragonfly::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -9930,7 +9892,6 @@ void dragonfly::Assembler::ConstructJob(
void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const Driver &D = getToolChain().getDriver();
@@ -10045,7 +10006,7 @@ void dragonfly::Linker::ConstructJob(Com
CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));
}
- getToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ getToolChain().addProfileRTLibs(Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
@@ -10074,7 +10035,6 @@ static std::string FindVisualStudioExecu
void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -10154,18 +10114,15 @@ void visualstudio::Linker::ConstructJob(
CmdArgs.push_back(Args.MakeArgString("-incremental:no"));
if (Args.hasArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd)) {
for (const auto &Lib : {"asan_dynamic", "asan_dynamic_runtime_thunk"})
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, Lib));
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
// Make sure the dynamic runtime thunk is not optimized out at link time
// to ensure proper SEH handling.
CmdArgs.push_back(Args.MakeArgString("-include:___asan_seh_interceptor"));
} else if (DLL) {
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, "asan_dll_thunk"));
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, "asan_dll_thunk"));
} else {
for (const auto &Lib : {"asan", "asan_cxx"})
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, Lib));
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
}
}
@@ -10195,7 +10152,7 @@ void visualstudio::Linker::ConstructJob(
// Add compiler-rt lib in case if it was explicitly
// specified as an argument for --rtlib option.
if (!Args.hasArg(options::OPT_nostdlib)) {
- AddRunTimeLibs(TC, TC.getDriver(), EffectiveTriple, CmdArgs, Args);
+ AddRunTimeLibs(TC, TC.getDriver(), CmdArgs, Args);
}
// Add filenames, libraries, and other linker inputs.
@@ -10224,7 +10181,7 @@ void visualstudio::Linker::ConstructJob(
A.renderAsInput(Args, CmdArgs);
}
- TC.addProfileRTLibs(EffectiveTriple, Args, CmdArgs);
+ TC.addProfileRTLibs(Args, CmdArgs);
// We need to special case some linker paths. In the case of lld, we need to
// translate 'lld' into 'lld-link', and in the case of the regular msvc
@@ -10253,7 +10210,6 @@ void visualstudio::Linker::ConstructJob(
void visualstudio::Compiler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
C.addCommand(GetCommand(C, JA, Output, Inputs, Args, LinkingOutput));
@@ -10376,7 +10332,6 @@ std::unique_ptr<Command> visualstudio::C
void MinGW::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -10404,8 +10359,7 @@ void MinGW::Assembler::ConstructJob(Comp
SplitDebugName(Args, Inputs[0]));
}
-void MinGW::Linker::AddLibGCC(const llvm::Triple &EffectiveTriple,
- const ArgList &Args,
+void MinGW::Linker::AddLibGCC(const ArgList &Args,
ArgStringList &CmdArgs) const {
if (Args.hasArg(options::OPT_mthreads))
CmdArgs.push_back("-lmingwthrd");
@@ -10427,8 +10381,7 @@ void MinGW::Linker::AddLibGCC(const llvm
CmdArgs.push_back("-lgcc");
}
} else {
- AddRunTimeLibs(getToolChain(), getToolChain().getDriver(), EffectiveTriple,
- CmdArgs, Args);
+ AddRunTimeLibs(getToolChain(), getToolChain().getDriver(), CmdArgs, Args);
}
CmdArgs.push_back("-lmoldname");
@@ -10439,7 +10392,6 @@ void MinGW::Linker::AddLibGCC(const llvm
void MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const ToolChain &TC = getToolChain();
@@ -10562,7 +10514,7 @@ void MinGW::Linker::ConstructJob(Compila
if (Args.hasArg(options::OPT_fopenmp))
CmdArgs.push_back("-lgomp");
- AddLibGCC(EffectiveTriple, Args, CmdArgs);
+ AddLibGCC(Args, CmdArgs);
if (Args.hasArg(options::OPT_pg))
CmdArgs.push_back("-lgmon");
@@ -10583,7 +10535,7 @@ void MinGW::Linker::ConstructJob(Compila
if (Args.hasArg(options::OPT_static))
CmdArgs.push_back("--end-group");
else if (!LinkerName.equals_lower("lld"))
- AddLibGCC(EffectiveTriple, Args, CmdArgs);
+ AddLibGCC(Args, CmdArgs);
}
if (!Args.hasArg(options::OPT_nostartfiles)) {
@@ -10603,7 +10555,6 @@ void MinGW::Linker::ConstructJob(Compila
void XCore::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -10637,7 +10588,6 @@ void XCore::Assembler::ConstructJob(Comp
void XCore::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -10666,7 +10616,6 @@ void XCore::Linker::ConstructJob(Compila
void CrossWindows::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -10706,7 +10655,6 @@ void CrossWindows::Assembler::ConstructJ
void CrossWindows::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const auto &TC =
@@ -10830,19 +10778,17 @@ void CrossWindows::Linker::ConstructJob(
if (!Args.hasArg(options::OPT_nodefaultlibs)) {
// TODO handle /MT[d] /MD[d]
CmdArgs.push_back("-lmsvcrt");
- AddRunTimeLibs(TC, D, EffectiveTriple, CmdArgs, Args);
+ AddRunTimeLibs(TC, D, CmdArgs, Args);
}
}
if (TC.getSanitizerArgs().needsAsanRt()) {
// TODO handle /MT[d] /MD[d]
if (Args.hasArg(options::OPT_shared)) {
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, "asan_dll_thunk"));
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, "asan_dll_thunk"));
} else {
for (const auto &Lib : {"asan_dynamic", "asan_dynamic_runtime_thunk"})
- CmdArgs.push_back(
- TC.getCompilerRTArgString(EffectiveTriple, Args, Lib));
+ CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
// Make sure the dynamic runtime thunk is not optimized out at link time
// to ensure proper SEH handling.
CmdArgs.push_back(Args.MakeArgString("--undefined"));
@@ -10860,7 +10806,6 @@ void CrossWindows::Linker::ConstructJob(
void tools::SHAVE::Compiler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -10917,7 +10862,6 @@ void tools::SHAVE::Compiler::ConstructJo
void tools::SHAVE::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
@@ -10954,7 +10898,6 @@ void tools::SHAVE::Assembler::ConstructJ
void tools::Myriad::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const auto &TC =
@@ -11030,7 +10973,6 @@ void tools::Myriad::Linker::ConstructJob
void PS4cpu::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
claimNoWarnArgs(Args);
@@ -11299,7 +11241,6 @@ static void ConstructGoldLinkJob(const T
void PS4cpu::Link::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const toolchains::FreeBSD &ToolChain =
@@ -11329,7 +11270,6 @@ void PS4cpu::Link::ConstructJob(Compilat
void NVPTX::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const auto &TC =
@@ -11406,7 +11346,6 @@ void NVPTX::Assembler::ConstructJob(Comp
void NVPTX::Linker::ConstructJob(Compilation &C, const JobAction &JA,
const InputInfo &Output,
const InputInfoList &Inputs,
- const llvm::Triple &EffectiveTriple,
const ArgList &Args,
const char *LinkingOutput) const {
const auto &TC =
Modified: cfe/trunk/lib/Driver/Tools.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=276936&r1=276935&r2=276936&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.h (original)
+++ cfe/trunk/lib/Driver/Tools.h Wed Jul 27 18:01:55 2016
@@ -59,8 +59,7 @@ private:
const InputInfo &Output,
const InputInfoList &Inputs) const;
- void AddAArch64TargetArgs(const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args,
+ void AddAArch64TargetArgs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
void AddARMTargetArgs(const llvm::Triple &Triple,
const llvm::opt::ArgList &Args,
@@ -115,7 +114,6 @@ 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;
};
@@ -135,7 +133,6 @@ 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;
};
@@ -163,7 +160,6 @@ 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;
@@ -223,7 +219,6 @@ 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;
};
@@ -239,7 +234,6 @@ 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;
};
@@ -254,7 +248,6 @@ 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;
};
@@ -270,7 +263,6 @@ 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;
};
@@ -332,7 +324,6 @@ 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;
};
@@ -372,7 +363,6 @@ 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;
};
@@ -393,7 +383,6 @@ 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;
};
@@ -406,7 +395,6 @@ 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;
};
@@ -421,7 +409,6 @@ 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;
};
@@ -435,7 +422,6 @@ 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;
};
@@ -452,7 +438,6 @@ 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;
};
@@ -466,7 +451,6 @@ 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;
};
@@ -483,7 +467,6 @@ 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;
};
@@ -497,7 +480,6 @@ 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;
};
@@ -514,7 +496,6 @@ 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;
};
@@ -528,7 +509,6 @@ 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;
};
@@ -545,7 +525,6 @@ 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;
};
@@ -559,7 +538,6 @@ 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;
};
@@ -575,7 +553,6 @@ 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;
};
@@ -589,7 +566,6 @@ 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;
};
@@ -602,7 +578,6 @@ 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;
};
@@ -616,7 +591,6 @@ 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;
};
@@ -633,7 +607,6 @@ 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;
};
@@ -647,7 +620,6 @@ 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;
};
@@ -664,7 +636,6 @@ 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,7 +649,6 @@ 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;
};
@@ -695,7 +665,6 @@ 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;
};
@@ -709,7 +678,6 @@ 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;
};
@@ -732,7 +700,6 @@ 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;
};
@@ -749,7 +716,6 @@ 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;
@@ -771,7 +737,6 @@ 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;
};
@@ -785,13 +750,11 @@ 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::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args, ArgStringList &CmdArgs) const;
+ void AddLibGCC(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs) const;
};
} // end namespace MinGW
@@ -803,9 +766,7 @@ enum class FloatABI {
Hard,
};
-FloatABI getARMFloatABI(const ToolChain &TC,
- const llvm::Triple &EffectiveTriple,
- const llvm::opt::ArgList &Args);
+FloatABI getARMFloatABI(const ToolChain &TC, const llvm::opt::ArgList &Args);
} // end namespace arm
namespace ppc {
@@ -839,7 +800,6 @@ 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;
};
@@ -852,7 +812,6 @@ 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;
};
@@ -867,7 +826,6 @@ 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;
};
@@ -882,7 +840,6 @@ 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;
};
@@ -898,7 +855,6 @@ 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;
};
@@ -911,7 +867,6 @@ 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;
};
@@ -929,7 +884,6 @@ 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;
};
@@ -944,8 +898,8 @@ 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 InputInfo &Output,
+ const InputInfoList &Inputs,
const llvm::opt::ArgList &TCArgs,
const char *LinkingOutput) const override;
};
@@ -960,7 +914,6 @@ 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;
};
@@ -979,7 +932,6 @@ class LLVM_LIBRARY_VISIBILITY Assembler
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;
};
@@ -996,7 +948,6 @@ class LLVM_LIBRARY_VISIBILITY Linker : p
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;
};
More information about the cfe-commits
mailing list