diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2017-10-13 03:37:48 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2017-10-13 03:37:48 +0000 |
commit | b7318e02c1094a31fda53dcdb27d3ca60277e091 (patch) | |
tree | 8ad03466024293aead2ba6e32cd29352c46a24bf /clang/lib/AST/ASTContext.cpp | |
parent | 662bb0002808b8afa87bd2059ab5a4c00449f9b3 (diff) | |
download | bcm5719-llvm-b7318e02c1094a31fda53dcdb27d3ca60277e091.tar.gz bcm5719-llvm-b7318e02c1094a31fda53dcdb27d3ca60277e091.zip |
[OpenCL] Add LangAS::opencl_private to represent private address space in AST
Currently Clang uses default address space (0) to represent private address space for OpenCL
in AST. There are two issues with this:
Multiple address spaces including private address space cannot be diagnosed.
There is no mangling for default address space. For example, if private int* is emitted as
i32 addrspace(5)* in IR. It is supposed to be mangled as PUAS5i but it is mangled as
Pi instead.
This patch attempts to represent OpenCL private address space explicitly in AST. It adds
a new enum LangAS::opencl_private and adds it to the variable types which are implicitly
private:
automatic variables without address space qualifier
function parameter
pointee type without address space qualifier (OpenCL 1.2 and below)
Differential Revision: https://reviews.llvm.org/D35082
llvm-svn: 315668
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index fa4c4805e27..1b1f2df81b9 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -707,6 +707,7 @@ static const LangAS::Map *getAddressSpaceMap(const TargetInfo &T, 1, // opencl_global 3, // opencl_local 2, // opencl_constant + 0, // opencl_private 4, // opencl_generic 5, // cuda_device 6, // cuda_constant |