Extract and reuse demangling functionality common to llvm-cxxfilt,
LLVMSymbolizer::DemangleName and llvm::demangle.
From functional perspective it introduces following changes:
- Supports Rust symbols in LLVMSymbolizer::DemangleName.
- Accepts Rust symbols with an extra underscore in llvm::demangle.
Can/should we make this somehow a generic piece of code that could be used here and in llvm-cxxfilt, so it's only written in one place? (eg: there's patches to add D demangling going in at the moment & so would be handy if adding support only had to go in one place rather than 2 or more)
Speaking of the D demangling support - I was hoping it could be broken down into pieces like the Rust work you did (really appreciate that, btw) - I thought the original Rust proposal was a fully featured single patch that then got broken down, am I remembering that correctly? I couldn't find the original single patch version - if you happen to have a pointer to it, I'd appreciate it for comparison/understanding of how things went there.