[CUDA] Do not allow non-empty destructors for global device-side variables.
According to Cuda Programming guide (v7.5, E2.3.1): > __device__, __constant__ and __shared__ variables defined in namespace > scope, that are of class type, cannot have a non-empty constructor or a > non-empty destructor. Clang already deals with device-side constructors (see D15305). This patch enforces similar rules for destructors. Differential Revision: http://reviews.llvm.org/D20140 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270108 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Sema/Sema.h 1 addition, 0 deletionsinclude/clang/Sema/Sema.h
- lib/Sema/SemaCUDA.cpp 49 additions, 1 deletionlib/Sema/SemaCUDA.cpp
- lib/Sema/SemaDecl.cpp 6 additions, 0 deletionslib/Sema/SemaDecl.cpp
- test/CodeGenCUDA/device-var-init.cu 79 additions, 3 deletionstest/CodeGenCUDA/device-var-init.cu
- test/SemaCUDA/device-var-init.cu 47 additions, 2 deletionstest/SemaCUDA/device-var-init.cu
Loading
Please register or sign in to comment