SPIRV2.0 Spec only specifies Linux mangling, however our downstream has
use for a Windows mangling for these types.
Unfortunately, the SPIRV
spec specifies a single mangling for all pipe types, despite clang
allowing overloading on these types. Because of this, this patch
chooses to mangle the read/writability and element type for the windows
mangling.
The windows manglings in the test all demangle according to demangler:
"void cdecl test1(struct clang::ocl_pipe<int,1>)
"void cdecl test2(struct clang::ocl_pipe<float,0>)
"void cdecl test2(struct clang::ocl_pipe<int,1>)
"void cdecl test3(struct clang::ocl_pipe<int const,1>)
"void cdecl test4(struct clang::ocl_pipe<union
clang::vector<unsigned char,3>,1>)
"void cdecl test5(struct clang::ocl_pipe<union
clang::vector<int,4>,1>)
"void cdecl test_reserved_read_pipe(struct clang::_ASCLglobal<struc
Person > * ptr64,struct clang::ocl_pipe<struct Person,1>)
We don't seem to add namespace for other OpenCL types, although I am not against it as I find it actually cleaner.
Since the mangling deviates what is documented can you add some comments here explaining your mangling scheme?