]> granicus.if.org Git - clang/commit
[CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.
authorJustin Lebar <jlebar@google.com>
Fri, 9 Sep 2016 20:35:43 +0000 (20:35 +0000)
committerJustin Lebar <jlebar@google.com>
Fri, 9 Sep 2016 20:35:43 +0000 (20:35 +0000)
commitfc6245cf9dc945c35d7b1be78c92b970a1c5199d
tree02932c0cf17a1ab5bfb7ab4cf80df83755eb2c63
parent02a8764a3d4b6df5657eb12a2a8fdf920c724d18
[CUDA] Make __GCC_ATOMIC_XXX_LOCK_FREE macros the same on host/device.

Summary:
This fixes a bug where we were unable to compile the following CUDA
file with libstdc++ (didn't try libc++):

  #include <future>
  void foo() { std::shared_future<int> x; }

The problem is that <future> only defines std::shared_future if
__GCC_ATOMIC_INT_LOCK_FREE > 1.  When we compiled this file for device,
the macro was set to 1, and then the class didn't exist at all.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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