yxsamliu wrote:

> > I am wondering whether prefix the builtin type with `__amdgcn_` would be 
> > better since I envision risk of conflicting with reserved names of other 
> > compilers or standard libraries.
> 
> In the patch where the type was introduced we had a brief back-and-forth. I 
> checked the reference type WASM introduced and they don't have prefix. I 
> don't think in the future we'd have a cross-platform/-compiler type called 
> `__buffer_rsrc_t`, and if it happens, it is not supposed to have `__` prefix. 
> However, I'm by no means a language expert, so I'm fine if we really want to 
> add that.

we are introducing `__buffer_rsrc_t` in global namespace, which is seen in any 
other namespace. Imagine some libstdc++ or libc++ header files use the same 
name in some namespaces and a HIP program includes these header files, there 
may be compilation error.

A search of `__buffer` shows libstdc++ and libc++ do use names starting with 
`__buffer`:

https://github.com/search?q=repo%3Agcc-mirror%2Fgcc%20path%3A%2F%5Elibstdc%5C%2B%5C%2B-v3%5C%2Finclude%5C%2F%2F%20__buffer&type=code

https://github.com/search?q=repo%3Allvm%2Fllvm-project+path%3A%2F%5Elibcxx%5C%2F%2F+__buffer&type=code&p=1

I understand the chance of conflict is low. It may be like the chance of 
hitting by a meteor. However, if we prefix with `__amdgcn_`, there is no such 
risk. And we have the benefit to clearly indicate it is a amdgcn 
target-specific type.

https://github.com/llvm/llvm-project/pull/95276
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to