Go to file
Justin Lebar 66c4fd7987 [CUDA] Driver changes to support CUDA compilation on MacOS.
Summary:
Compiling CUDA device code requires us to know the host toolchain,
because CUDA device-side compiles pull in e.g. host headers.

When we only supported Linux compilation, this worked because
CudaToolChain, which is responsible for device-side CUDA compilation,
inherited from the Linux toolchain.  But in order to support MacOS,
CudaToolChain needs to take a HostToolChain pointer.

Because a CUDA toolchain now requires a host TC, we no longer will
create a CUDA toolchain from Driver::getToolChain -- you have to go
through CreateOffloadingDeviceToolChains.  I am *pretty* sure this is
correct, and that previously any attempt to create a CUDA toolchain
through getToolChain() would eventually have resulted in us throwing
"error: unsupported use of NVPTX for host compilation".

In any case hacking getToolChain to create a CUDA+host toolchain would
be wrong, because a Driver can be reused for multiple compilations,
potentially with different host TCs, and getToolChain will cache the
result, causing us to potentially use a stale host TC.

So that's the main change in this patch.

In addition, we have to pull CudaInstallationDetector out of Generic_GCC
and into a top-level class.  It's now used by the Generic_GCC and MachO
toolchains.

Reviewers: tra

Subscribers: rryan, hfinkel, sfantao

Differential Revision: https://reviews.llvm.org/D26774

llvm-svn: 287285
2016-11-18 00:41:22 +00:00
clang [CUDA] Driver changes to support CUDA compilation on MacOS. 2016-11-18 00:41:22 +00:00
clang-tools-extra [include-fixer] Add a test for the full round trip through libclang and the plugin. 2016-11-17 15:23:06 +00:00
compiler-rt [sanitizers] specifying style for global constant 2016-11-17 21:57:43 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Fix build since r286752. 2016-11-14 16:06:33 +00:00
libcxx Workaround compilers w/o C++1z inline variables 2016-11-17 20:08:43 +00:00
libcxxabi __cxa_demangle: allow demangling invocation blocks 2016-11-14 03:07:47 +00:00
libunwind EHABI: mark some functions as exported 2016-11-17 23:53:35 +00:00
lld Add missing REQUIRES. 2016-11-18 00:11:12 +00:00
lldb Resubmit "Change RegisterValue getters / setters to use StringRef." 2016-11-17 23:47:31 +00:00
llgo [llgo] add llgo source path to LLVM_GO_PACKAGES 2016-07-27 03:01:00 +00:00
llvm [lli] Prefer `exit(1)` to `return 1` for consistency. 2016-11-17 22:59:13 +00:00
openmp Update stats-gathering code 2016-11-14 21:13:44 +00:00
parallel-libs [Acxxel] Remove setActiveDeviceForThread 2016-10-28 00:54:02 +00:00
polly Probably overwritten loads should not be considered hoistable 2016-11-17 22:25:17 +00:00