]> granicus.if.org Git - clang/commit
[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)
commit44f73317fc0d168da26f72b16bd75106df113515
treeb36208985914e3c551575977af8799f54fafba6b
parent2fcd11968f1040e9d89dc32fed1148f667f75890
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259592 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenModule.cpp
lib/Sema/SemaCUDA.cpp
lib/Sema/SemaDecl.cpp
test/CodeGenCUDA/device-var-init.cu [new file with mode: 0644]