[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

Dmitrii Galimzianov via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 28 15:27:12 PDT 2024


DmT021 wrote:

> Don't let us hold this patch up if returning the the original patch that fixes things makes things work if you can't easily get the same functionality from this version of the patch. Will one part of this patch work with the new stuff and the other part not? If so, maybe we allow the place that works use the new functionality and just hard code the other one?

The current version of the patch does archive the desired result (no redundant scan of the current module) and all the tests are green. But the issue is it's awfully complex. All this callback logic is hard to read and even harder to modify next time. Especially in `SymbolContext`.
I'd prefer a slightly repetitive approach. At each lookup function (in this case `SymbolContext::FindBestGlobalDataSymbol` and `IRExecutionUnit::FindInSymbols`):
- check the current module
- if no suitable result is found:
  - get a copy of ModuleList and remove `current module` from it
  - search through the copy.
  
But I don't insist; if you're ok with this implementation, I'm ok too.

https://github.com/llvm/llvm-project/pull/102835


More information about the lldb-commits mailing list