[llvm] [MsDemangle] Use LLVM style RTTI for AST nodes (PR #143410)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 24 11:10:38 PDT 2025
Nerixyz wrote:
> Do you have an example in mind, where this added RTTI functionality would make the code simpler?
Yes, I wanted to add rich function demangling info for MS to LLDB. For this, I need to keep track where certain parts of the demangled name are. Specifically, the basename and function arguments. [Here](https://github.com/Nerixyz/llvm-project/commit/c80e17baf33afcf671fdffa9faf484ec03156541#diff-9dc7747922f5e49ac61e242acd2cfb4d12ee55861581aebd60870709375911f9R154) is my WIP, which still has some unrelated changes. RTTI is used there for checking if a node is an identifier and to be able to access its template parameters.
LLDB already does this for the Itanium demangling in [DemangledNameInfo](https://github.com/llvm/llvm-project/blob/6dad1e87fb7a8de7033a315f5dd5d7c95dab32f6/lldb/source/Core/DemangledNameInfo.cpp). It would be even better if that visitor/output buffer could be reused somehow, as MS-demangle also uses that class. However, it doesn't call `printLeft`/`printRight`, because the node types are different.
https://github.com/llvm/llvm-project/pull/143410
More information about the llvm-commits
mailing list