[Openmp-commits] [openmp] [libc] [llvm] [NVPTX][NFC] Change naming for global objects for ctor / dtor handling (PR #72137)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 13 12:42:47 PST 2023


jhuber6 wrote:

> > not targetable from user code
> 
> But it is. https://godbolt.org/z/eE3d6raYd
> 
> What's worse, I think unlike double-underscore symbols that are explicitly reserved for compiler's own use, we do not have such conventions for `$`-prefixed ones. Yes, they may be uncommon, but that's not a very convincing argument that the change will be an improvement over double-underscore prefix.

I actually never knew you could actually use `$` in C identifiers. I think I just assumed it wasn't allowed from looking at code like https://github.com/llvm/llvm-project/blob/main/lld/Common/Strings.cpp#L66 in the past which doesn't seem to consider `$`. Seems to be a reverse problem of PTX https://gcc.gnu.org/onlinedocs/gcc/Dollar-Signs.html. So it's one of those things that's technically permitted but likely to break. Good to know I guess.

https://github.com/llvm/llvm-project/pull/72137


More information about the Openmp-commits mailing list