]> granicus.if.org Git - clang/commit
[CUDA] More correctly inherit primitive types from the host during device compilation.
authorJustin Lebar <jlebar@google.com>
Thu, 5 Jan 2017 16:53:21 +0000 (16:53 +0000)
committerJustin Lebar <jlebar@google.com>
Thu, 5 Jan 2017 16:53:21 +0000 (16:53 +0000)
commitbd340f16a9137c20e1ec9403036a7bcd5c52e44f
tree1c60e94eb7bacfc7f1683576bf2321ffa8c4b68d
parent26ee5b50e74be42381a4c7f9fe17dc4a45770d7b
[CUDA] More correctly inherit primitive types from the host during device compilation.

Summary:
CUDA lets users share structs between the host and device, so for that
and other reasons, primitive types such as ptrdiff_t should be the same
on both sides of the compilation.

Our code to do this wasn't entirely successful.  In particular, we did a
bunch of work during the NVPTXTargetInfo constructor, only to override
it in the NVPTX{32,64}TargetInfo constructors.  It worked well enough on
Linux and Mac, but Windows is LLP64, which is different enough to break
it.

This patch removes the NVPTX{32,64}TargetInfo classes entirely and fixes
the bug described above.

Reviewers: tra

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291135 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets.cpp
test/Preprocessor/cuda-types.cu