[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
Mon Apr 20 03:12:56 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?
>
> I think what @MaskRay meant was that instead of naming the symbol `__alloc_token_*` it should be named `*.alloc_token`, since that's the usual way to have different generated names for the same function, instead of special-casing things this way. I'd also be in favour of that, since it works with the current ecosystem (including other toolchains).
They aren't compiler-generated. They are allocator-provided functions that the compiler calls: https://clang.llvm.org/docs/AllocToken.html#allocation-token-instrumentation
https://github.com/llvm/llvm-project/pull/191048
More information about the libcxx-commits
mailing list