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).
llvm-svn: 276936
diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index 6df5bba..30cc3f4 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -602,9 +602,7 @@
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 @@
// 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");
}