]> granicus.if.org Git - clang/commit
[OpenCL] Fix size of image type
authorYaxun Liu <Yaxun.Liu@amd.com>
Wed, 3 Aug 2016 20:38:06 +0000 (20:38 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Wed, 3 Aug 2016 20:38:06 +0000 (20:38 +0000)
commitff7d9d46a510ba90fc4c69dee770b4489b60f3f0
tree237b5a8c63a0af6a47df34499383b913220fb2c2
parent7604798c68651927fb923ec1c0f6cda70122fc07
[OpenCL] Fix size of image type

The size of image type is reported incorrectly as size of a pointer to address space 0, which causes error when casting image type to pointers by __builtin_astype.

The fix is to get image address space from TargetInfo then report the size accordingly.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277647 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/TargetInfo.h
lib/AST/ASTContext.cpp
lib/Basic/Targets.cpp
lib/CodeGen/CGOpenCLRuntime.cpp
lib/CodeGen/TargetInfo.cpp
lib/CodeGen/TargetInfo.h