[PATCH] D28322: [CUDA] More correctly inherit primitive types from the host during device compilation.

Justin Lebar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 13:59:51 PST 2017


jlebar created this revision.
jlebar added a reviewer: tra.
jlebar added a subscriber: cfe-commits.

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.


https://reviews.llvm.org/D28322

Files:
  clang/lib/Basic/Targets.cpp
  clang/test/Preprocessor/cuda-types.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28322.83129.patch
Type: text/x-patch
Size: 5692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170104/22ae46ee/attachment.bin>


More information about the cfe-commits mailing list