llvm-project/clang/lib
Yaxun Liu a4005e13f7 [CUDA][HIP] Allow function-scope static const variable
CUDA 8.0 E.3.9.4 says: Within the body of a __device__ or __global__
function, only __shared__ variables or variables without any device
memory qualifiers may be declared with static storage class.

It is unclear how a function-scope non-const static variable
without device memory qualifier is implemented, therefore only static
const variable without device memory qualifier is allowed, which
can be emitted as a global variable in constant address space.

Currently clang only allows function-scope static variable with
__shared__ qualifier.

This patch also allows function-scope static const variable without
device memory qualifier and emits it as a global variable in constant
address space.

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

llvm-svn: 338188
2018-07-28 03:05:25 +00:00
..
ARCMigrate Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
AST [AST] Add a convenient getter from QualType to RecordDecl 2018-07-28 02:16:13 +00:00
ASTMatchers [ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration. 2018-07-27 17:26:11 +00:00
Analysis [AST] Add a convenient getter from QualType to RecordDecl 2018-07-28 02:16:13 +00:00
Basic Revert r338057 "[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name" 2018-07-26 23:21:51 +00:00
CodeGen [CUDA][HIP] Allow function-scope static const variable 2018-07-28 03:05:25 +00:00
CrossTU [CrossTU] Fix handling of Cross Translation Unit directory path 2017-10-27 12:53:37 +00:00
Driver [DEBUGINFO] Disable unsupported debug info options for NVPTX target. 2018-07-27 19:45:14 +00:00
Edit Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
Format NFC: Add the emacs c++ mode hint "-*- C++ -*-" to the headers that don't have it 2018-07-24 00:07:49 +00:00
Frontend [OPENMP] Force OpenMP 4.5 when compiling for offloading. 2018-07-26 15:17:38 +00:00
FrontendTool Add a new driver mode to dump compiler feature and extension options. 2018-05-31 13:57:09 +00:00
Headers [ms] Add __shiftleft128 / __shiftright128 intrinsics 2018-07-20 21:02:09 +00:00
Index [Index] Set OrigD before D is changed. 2018-07-20 08:08:56 +00:00
Lex [Preprocessor] Stop entering included files after hitting a fatal error. 2018-07-25 19:16:26 +00:00
Parse Parse a possible trailing postfix expression suffix after a fold expression 2018-07-27 21:55:12 +00:00
Rewrite Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
Sema [CUDA][HIP] Allow function-scope static const variable 2018-07-28 03:05:25 +00:00
Serialization [AST] Sink 'part of explicit cast' down into ImplicitCastExpr 2018-07-27 07:27:14 +00:00
StaticAnalyzer [analyzer] Extend NoStoreFuncVisitor to insert a note on IVars 2018-07-27 18:26:40 +00:00
Tooling [Tooling] Use UniqueStringSaver. NFC 2018-07-23 11:25:25 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00