The symbol table needs to demangle all symbol names when building its index. However, this doesn't require the full mangled name: we only need the base name and the function declaration context. Currently, we always construct the demangled string during indexing and cache it in the string pool as a way to speed up future lookups. Constructing the demangled string is by far the most expensive step of the demangling process, because the output string can be exponentially larger than the input and unless you're dumping the symbol table, many of those demangled names will not be needed again.
This patch avoids constructing the full demangled string when we can partially demangle. This speeds up indexing and reduces memory usage.
I guess it would be more correct to call this GetRichManglingInfo now