diff options
| author | Justin Lebar <jlebar@google.com> | 2017-01-05 16:52:11 +0000 |
|---|---|---|
| committer | Justin Lebar <jlebar@google.com> | 2017-01-05 16:52:11 +0000 |
| commit | dda1d844fb655e9f2c7447f330e8e73614581474 (patch) | |
| tree | d9f63c153f9a26d0aaa6e72ad937e2bbe6b93c09 /clang/lib/Driver/ToolChains.cpp | |
| parent | 4086fe5cd1500e8533e964ff2eb2d896fee62806 (diff) | |
| download | bcm5719-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/ToolChains.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 6 |
1 files changed, 3 insertions, 3 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()); } |

