HomePhabricator

[CUDA] Do not allow non-empty destructors for global device-side variables.

Description

[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