[cfe-dev] libc++abi
David Chisnall
csdavec at swan.ac.uk
Tue May 24 10:49:16 PDT 2011
On 24 May 2011, at 17:56, Chris Lattner wrote:
> The bulk of libcxxrt is an older demangler
This is incorrect. The bulk of the code is the exception handling / RTTI logic - this is nontrivial to implement correctly and is invoked by a significant amount of C++ code, often on important code paths, while the demangler is largely used for debugging and error reporting (for example, in the uncaught exception handler).
The demangler is from libelftc - we tried importing the demangler from libc++abi, but it turned out to increase the total object code size of libcxxrt by a factor of four, which is unacceptable for a core system library like this.
We may replace the libelftc demangler with something else at some point, but the current code fits the requirements of libcxxrt:
- Lightweight
- Good performance
- Permissively licensed
If libelftc gains support for the C++0x extensions, then we will just import their code. Otherwise, we will probably extend it ourselves and push the improvements upstream. While I like Howard's interface to the demanger for use by clients such as debuggers that require rich introspection of C++ encodings, it is massively overengineered for use in a C++ runtime library, which just requires to dump the encodings into a string, with minimal space requirements (as one common use for this code is dumping a type when you have run out of memory).
David
(author of most of libcxxrt)
-- Send from my Jacquard Loom
More information about the cfe-dev
mailing list