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

Dmitrii Galimzianov via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 27 18:04:47 PDT 2024


DmT021 wrote:

> We should always prefer symbols from the current module first, probably external first, then fall back to internal. If we do a search of all modules, we should prefer external symbols first and then internal, but only if they are unique.

So it's `current module external, current module internal, other modules external, other modules internal`, right? This is how [SymbolContext.cpp](https://github.com/llvm/llvm-project/pull/102835/files#diff-da1a374f5098c39acfebae4b87a261f143a842e613082c2296de7ee28df12a33) implements it.
What if we use `SymbolContext::FindBestGlobalDataSymbol` and `SymbolContext::FindBestFunction` (a new function*) in `IRExecutionUnit::FindInSymbols`? This way we can simplify LoadAddressResolver by removing all this logic about tracking internal symbols.

\* `SymbolContext::FindBestFunction` will use the same lookup order but search functions instead of symbols.

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


More information about the lldb-commits mailing list