[libcxx-commits] [libcxxabi] [llvm] [ItaniumDemangle] Strip __alloc_token_ to transparently demangle allocation functions (PR #191048)
Marco Elver via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 9 13:37:19 PDT 2026
melver wrote:
> > This needs review from regular @reviewers-libcxxabi folks. Have you considered `.alloc_token` suffix instead?
> > ```
> > % echo '_Znwm.xxx' | c++filt
> > operator new(unsigned long) [clone .xxx]
> > ```
>
> You mean to rewrite (in the demangler) e.g. `__alloc_token__Znwm` to `_Znwm.alloc_token`, which is then translated as `operator new(unsigned long) (.alloc_token)` to indicate the underlying function is non-standard?
>
> I suppose it's useful to have this information for debugging, but if the demangler's purpose is to translate mangled names back to source-level names then maybe it's redundant. Preferences?
While for most users it might be a distraction, I think there would be cases where it'd be useful to distinguish. I updated the change to append `(.alloc_token)` to indicate the fact it's a non-standard operator new implementation.
PTAL.
https://github.com/llvm/llvm-project/pull/191048
More information about the libcxx-commits
mailing list