[PATCH] D135038: [lld/mac] Port typo correction for undefined symbols from ELF port

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 08:31:37 PDT 2022


thakis added a comment.

Thanks!

Presubmit looks happier now that I removed the committed parent rev. Yesterday, when the parent wasn't committed yet, it was green too. Maybe a presubmit bug with landed parent revs.



================
Comment at: lld/MachO/SymbolTable.cpp:413
+// file of sym.
+static const Symbol *getAlternativeSpelling(const Undefined &sym,
+                                            std::string &pre_hint,
----------------
oontvoo wrote:
> This function does some intensive works - is it worth caching the results? 
> 
> (OTOTH, maybe performance isn't important in case of failures, anyways 🤔 )
We only call it once per undefined symbol, so a cache would have a very low hit rate i think (?). We only call this for the first 2 undefined symbols for perf reasons too. So even for fairly long symbol names, this should add less than 100k symbol lookups (which is not nothing! But it only happens on failing links, and it's still small compared to total number of lookups during a link)


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

https://reviews.llvm.org/D135038



More information about the llvm-commits mailing list