[Lldb-commits] [PATCH] D128366: [lldb] Make Module::LookupInfo::Prune language-agnostic

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 23 09:15:01 PDT 2022


bulbazord added a comment.

In D128366#3603943 <https://reviews.llvm.org/D128366#3603943>, @labath wrote:

> How hot is this code? Parsing a demangled name isn't entirely cheap, and the fact that the objc++ class calls back into the c++ version means that the c++ name will be parsed twice.

Not sure, I'll measure this. Also, at least on my machine, the list of language plugins includes at least 3 C++ language plugins, so it happens *at least* twice...

> Could we move this pruning elsewhere? These values come from the symbol file plugins anyway, and they can do a better job at determining which language does a particular name belong to.
> (OK, they can an also come from the symtab, but there I guess we could infer something from the mangling scheme).

We're specifically pruning the results from a name lookup, so I'm not sure where would be a better place to move it. That being said, based on your observation, we could try to do a better job of inferring the language a name belongs to by looking at the mangling scheme before we look at every single language plugin.



================
Comment at: lldb/include/lldb/Target/Language.h:320
+  virtual bool NamesAreEquivalentWithContext(
+      const ConstString &user_provided_name,
+      const ConstString &full_name_with_context) const {
----------------
labath wrote:
> I think we're passing ConstStrings by value these days...
I see. Is there a reason we do that instead of passing by reference?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128366/new/

https://reviews.llvm.org/D128366



More information about the lldb-commits mailing list