diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-03 20:38:06 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-03 20:38:06 +0000 |
commit | ff7d9d46a510ba90fc4c69dee770b4489b60f3f0 (patch) | |
tree | 237b5a8c63a0af6a47df34499383b913220fb2c2 /include | |
parent | 7604798c68651927fb923ec1c0f6cda70122fc07 (diff) | |
download | clang-ff7d9d46a510ba90fc4c69dee770b4489b60f3f0.tar.gz |
[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
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index cd79df32a1..958c28ecfe 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -986,6 +986,11 @@ public: return getTargetOpts().SupportedOpenCLOptions; } + /// \brief Get OpenCL image type address space. + virtual LangAS::ID getOpenCLImageAddrSpace() const { + return LangAS::opencl_global; + } + /// \brief Check the target is valid after it is fully initialized. virtual bool validateTarget(DiagnosticsEngine &Diags) const { return true; |