summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2017-01-05 16:52:11 +0000
committerJustin Lebar <jlebar@google.com>2017-01-05 16:52:11 +0000
commitdda1d844fb655e9f2c7447f330e8e73614581474 (patch)
treed9f63c153f9a26d0aaa6e72ad937e2bbe6b93c09 /clang/lib/Driver
parent4086fe5cd1500e8533e964ff2eb2d896fee62806 (diff)
downloadbcm5719-llvm-dda1d844fb655e9f2c7447f330e8e73614581474.tar.gz
bcm5719-llvm-dda1d844fb655e9f2c7447f330e8e73614581474.zip
[CUDA] Make CUDAInstallationDetector take the host triple in its constructor.
Summary: Previously it was taking the true target triple, which is not really what it needs: The location of the CUDA installation depends on the host OS. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28319 llvm-svn: 291130
Diffstat (limited to 'clang/lib/Driver')
-rw-r--r--clang/lib/Driver/ToolChains.cpp6
-rw-r--r--clang/lib/Driver/ToolChains.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index f15baa840d4..8815c132016 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -1805,7 +1805,7 @@ static CudaVersion ParseCudaVersionFile(llvm::StringRef V) {
}
CudaInstallationDetector::CudaInstallationDetector(
- const Driver &D, const llvm::Triple &TargetTriple,
+ const Driver &D, const llvm::Triple &HostTriple,
const llvm::opt::ArgList &Args)
: D(D) {
SmallVector<std::string, 4> CudaPathCandidates;
@@ -1840,7 +1840,7 @@ CudaInstallationDetector::CudaInstallationDetector(
// It's sufficient for our purposes to be flexible: If both lib and lib64
// exist, we choose whichever one matches our triple. Otherwise, if only
// lib exists, we use it.
- if (TargetTriple.isArch64Bit() && FS.exists(InstallPath + "/lib64"))
+ if (HostTriple.isArch64Bit() && FS.exists(InstallPath + "/lib64"))
LibPath = InstallPath + "/lib64";
else if (FS.exists(InstallPath + "/lib"))
LibPath = InstallPath + "/lib";
@@ -4870,7 +4870,7 @@ Tool *DragonFly::buildLinker() const {
CudaToolChain::CudaToolChain(const Driver &D, const llvm::Triple &Triple,
const ToolChain &HostTC, const ArgList &Args)
: ToolChain(D, Triple, Args), HostTC(HostTC),
- CudaInstallation(D, Triple, Args) {
+ CudaInstallation(D, HostTC.getTriple(), Args) {
if (CudaInstallation.isValid())
getProgramPaths().push_back(CudaInstallation.getBinPath());
}
diff --git a/clang/lib/Driver/ToolChains.h b/clang/lib/Driver/ToolChains.h
index e6872224637..f43db7a24d5 100644
--- a/clang/lib/Driver/ToolChains.h
+++ b/clang/lib/Driver/ToolChains.h
@@ -43,7 +43,7 @@ private:
mutable llvm::SmallSet<CudaArch, 4> ArchsWithVersionTooLowErrors;
public:
- CudaInstallationDetector(const Driver &D, const llvm::Triple &Triple,
+ CudaInstallationDetector(const Driver &D, const llvm::Triple &HostTriple,
const llvm::opt::ArgList &Args);
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
OpenPOWER on IntegriCloud