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)
For printing and semantic check of implicit addr space, there is another patch https://reviews.llvm.org/D38857