[OpenCL] Prevent generation of globals in non-constant AS for OpenCL.
authorAnastasia Stulova <anastasia.stulova@arm.com>
Tue, 29 Nov 2016 17:01:19 +0000 (17:01 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Tue, 29 Nov 2016 17:01:19 +0000 (17:01 +0000)
commite4a1c38109dd21c92e0dd6f233a047d9ac862dbe
tree51dc41488bfcc6b4d16b32d57dec65dddae68a62
parentbca5fd4f812db9fc692029ebb35fce5871fe6c24
[OpenCL] Prevent generation of globals in non-constant AS for OpenCL.

Avoid using shortcut for const qualified non-constant address space
aggregate variables while generating them on the stack such that
the alloca object is used instead of a global variable containing
initializer.

Review: https://reviews.llvm.org/D27109
llvm-svn: 288163
clang/lib/CodeGen/CGDecl.cpp
clang/test/CodeGenOpenCL/constant-addr-space-globals.cl