This change adds extra cast operator addrspace_cast described earlier in this RFC:
http://lists.llvm.org/pipermail/cfe-dev/2018-December/060546.html
This operator is intended for casting between pointers to objects in different address spaces and follows similar logic as const_cast in C++.
Example:
int* gen = ...; global int* gl = addrspace_cast<global int*>(gen);
Note that functionality of casting pointers to different address spaces has been previously removed from all other cast operators and can only be currently done using C style casts.
This commit only enables this change for OpenCL, but if agreed it can be changed to apply to C++ too (it needs to be enabled as a valid keyword). However, for C++ it might need to be added as a Clang only extension?
Maybe the documentation should be updated to include the new cast operator?