diff options
author | Justin Lebar <jlebar@google.com> | 2016-11-18 00:41:22 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-11-18 00:41:22 +0000 |
commit | 66c4fd7987d216e91d219e5e8437673a7b0167f8 (patch) | |
tree | e5db1f8f7dd6d58a09a36a0b8b12363c79371919 /clang/lib/CodeGen/CGRecordLayoutBuilder.cpp | |
parent | 25a41c1f630c5ad29ce7180a06d737118cead85a (diff) | |
download | bcm5719-llvm-66c4fd7987d216e91d219e5e8437673a7b0167f8.tar.gz bcm5719-llvm-66c4fd7987d216e91d219e5e8437673a7b0167f8.zip |
[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
Diffstat (limited to 'clang/lib/CodeGen/CGRecordLayoutBuilder.cpp')
0 files changed, 0 insertions, 0 deletions