summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Linux.cpp
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-11-28 15:56:00 -0500
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-11-28 17:02:06 -0500
commit1abd4c94d7575e4cd288e0024c1ec79f17b048a9 (patch)
tree5dc253472fc233c8305bc1accbd9a935a083736d /clang/lib/Driver/ToolChains/Linux.cpp
parenta7abe6eac061a999e88d651e4857872f5ec52e5d (diff)
downloadbcm5719-llvm-1abd4c94d7575e4cd288e0024c1ec79f17b048a9.tar.gz
bcm5719-llvm-1abd4c94d7575e4cd288e0024c1ec79f17b048a9.zip
[Clang] Bypass distro detection on non-Linux hosts
Skip distro detection when we're not running on Linux, or when the target triple is not Linux. This saves a few OS calls for each invocation of clang.exe. Differential Revision: https://reviews.llvm.org/D70467
Diffstat (limited to 'clang/lib/Driver/ToolChains/Linux.cpp')
-rw-r--r--clang/lib/Driver/ToolChains/Linux.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index 087783875ff..736a2d435ca 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -240,7 +240,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
.str());
}
- Distro Distro(D.getVFS());
+ Distro Distro(D.getVFS(), Triple);
if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
ExtraOpts.push_back("-z");
@@ -511,7 +511,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
const llvm::Triple::ArchType Arch = getArch();
const llvm::Triple &Triple = getTriple();
- const Distro Distro(getDriver().getVFS());
+ const Distro Distro(getDriver().getVFS(), Triple);
if (Triple.isAndroid())
return Triple.isArch64Bit() ? "/system/bin/linker64" : "/system/bin/linker";
OpenPOWER on IntegriCloud