There are lots of questions on SO about name mangling and demangling vis-a-vis the ABI used by gcc
and clang
. Many of the demangling questions involve trying to get at the semantics embedded in the mangling grammar, as in "Extracting class from demangled symbol". Throughout, solutions posed rely on heuristics that generalize poorly.
What I'm interested in is a robust approach to demangling that:
- Precisely tokenizes the mangled name;
- Correctly associates C++ semantics with each token;
- Does not depend on knowing anything about the library from which the mangled name is drawn; and
- Renders the resulting AST for easy consumption by other utilities (think YAML, JSON).
We know #1-#3 can be accomplished because the LLVM implements it. Anybody got a line on a complete toolchain to #4?