[CUDA] Do not allow dynamic initialization of global device side variables.
authorArtem Belevich <tra@google.com>
Tue, 2 Feb 2016 22:29:48 +0000 (22:29 +0000)
committerArtem Belevich <tra@google.com>
Tue, 2 Feb 2016 22:29:48 +0000 (22:29 +0000)
commit97c01c35f8da48b47c397fd915a82bd1d881d4ab
tree06d8b1e2ae200287569e9ad71bdaa548e5ef75d6
parent8abc2e51b81efe2f540f6a61a3028f8fe72fe478
[CUDA] Do not allow dynamic initialization of global device side variables.

In general CUDA does not allow dynamic initialization of
global device-side variables. One exception is that CUDA allows
records with empty constructors as described in section E2.2.1 of
CUDA 7.5 Programming guide.

This patch applies initializer checks for all device-side variables.
Empty constructors are accepted, but no code is generated for them.

Differential Revision: http://reviews.llvm.org/D15305

llvm-svn: 259592
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/CodeGen/CGDeclCXX.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/Sema/SemaCUDA.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/CodeGenCUDA/device-var-init.cu [new file with mode: 0644]