[Lldb-commits] [PATCH] D118814: [lldb] Don't keep demangled names in memory after indexing

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 3 14:57:32 PST 2022

clayborg added a comment.

LGTM if the RichManglingContext isn't actually demangling the string anyway, no need to force it to do so and cache the results.

Comment at: lldb/source/Symbol/Symtab.cpp:388-389
   // Only register functions that have a base name.
   llvm::StringRef base_name = rmc.GetBufferRef();
   if (base_name.empty())
I was checking this function out as the only user of RichManglingContext. Seems that we could modify RichManglingContext::ParseFunctionBaseName() to just return the base name? Seems weird to call parse and then fetch. Could also just rename to "StringRef RichManglingContext::GetFunctionBaseName(). 

In fact the RichManglingContext class has the notion of an internal buffer where people call some parse routine and then call RichManglingContext::GetBufferRef()? Seems like we should just get rid of the internal buffer and just return it each time from all of the RichManglingContext::ParseXXX routines. Not needed, but just something I found interesting about the RichManglingContext class implementation.



More information about the lldb-commits mailing list