[cfe-dev] [libc++abi] Why is cxa_demangle.h a public header?

Howard Hinnant hhinnant at apple.com
Sat Jun 8 08:02:55 PDT 2013


On Jun 7, 2013, at 11:15 PM, Matthew Dempsky <matthew at dempsky.org> wrote:

> What's the point of having libcxxabi/include/cxa_demangle.h?
> Everything in __cxxabiv1::__libcxxabi's visibility is limited to
> hidden anyway, so it's only usable within libc++abi (and maybe
> libc++), but nothing else makes use of it currently.

Because when I was first asked to write the demangler I was also asked to have it create a syntax tree and expose that syntax tree for use by the compiler and/or debugger.

That design hasn't worked out.  I'm currently working on an alternative.  A tool for the compiler and/or debugger could still be done, but it makes more sense to have that be a separate tool, as opposed to bundling it into the demangler.

> 
> Also, it seems to bloat libc++abi a lot, at least on OpenBSD.  If I
> move the declarations from cxa_demangle.h into cxa_demangle.cpp and
> than change the __libcxxabi namespace into an anonymous namespace, it
> cuts libc++.so (statically linked against libc++abi) from 1655653
> bytes of text to just 1292112 bytes.

I'm hoping to get rid of this shortly.

Howard





More information about the cfe-dev mailing list