]> granicus.if.org Git - clang/commit
CodeGen: Cast alloca to expected address space
authorYaxun Liu <Yaxun.Liu@amd.com>
Thu, 18 May 2017 18:51:09 +0000 (18:51 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Thu, 18 May 2017 18:51:09 +0000 (18:51 +0000)
commit3022dac388832e0bb669821e6677abd5cb8a8784
tree56b8e786a48b3a0f55d90117a0e7aeea60860e48
parentb7f27dbfdd43a5f42cc6f263eb50c22677eb4cb6
CodeGen: Cast alloca to expected address space

Alloca always returns a pointer in alloca address space, which may
be different from the type defined by the language. For example,
in C++ the auto variables are in the default address space. Therefore
cast alloca to the expected address space when necessary.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303370 91177308-0d34-0410-b5e6-96231b3b80d8
28 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/Type.h
include/clang/Basic/AddressSpaces.h
include/clang/Basic/DiagnosticSemaKinds.td
lib/AST/ASTContext.cpp
lib/AST/TypePrinter.cpp
lib/Basic/Targets.cpp
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenTypeCache.h
lib/CodeGen/TargetInfo.cpp
lib/CodeGen/TargetInfo.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaType.cpp
test/CodeGen/address-space.c
test/CodeGenCXX/amdgcn-automatic-variable.cpp [new file with mode: 0644]
test/CodeGenOpenCL/amdgcn-automatic-variable.cl [new file with mode: 0644]
test/CodeGenOpenCL/amdgpu-alignment.cl
test/CodeGenOpenCL/amdgpu-debug-info-pointer-address-space.cl
test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl
test/CodeGenOpenCL/amdgpu-nullptr.cl
test/CodeGenOpenCL/builtins-amdgcn.cl
test/CodeGenOpenCL/byval.cl
test/CodeGenOpenCL/size_t.cl
test/Sema/sizeof-struct-non-zero-as-member.cl
test/SemaOpenCL/storageclass-cl20.cl
test/SemaOpenCL/storageclass.cl