Reland "[lld/mac] Port typo correction for undefined symbols from ELF port"
authorNico Weber <thakis@chromium.org>
Wed, 12 Oct 2022 00:40:26 +0000 (20:40 -0400)
committerNico Weber <thakis@chromium.org>
Thu, 13 Oct 2022 14:33:47 +0000 (10:33 -0400)
commit82ca390062d11512528e3d357d8d3d7b69477caf
treea6ca605f2779d5452d0856ba89c95dc26daef938
parentc787986cddce230e8ca28a773166b5773449bcb9
Reland "[lld/mac] Port typo correction for undefined symbols from ELF port"

The only difference in the reland is that the loop at the top of
getAlternativeSpelling() now calls dyn_cast_or_null() instead
of dyn_cast() -- a file's symbols list can contain null entries.

The test for this might be slightly involved, so I'll land it in
a follow-up, to make the reland similar to the original commit.

Originally reviewed at:
Differential Revision: https://reviews.llvm.org/D135038

This reverts commit 317b5582b813c51d1fb6723fd44b227b7f274bc7.
lld/MachO/SymbolTable.cpp
lld/test/MachO/undef-spell-corrector.s [new file with mode: 0644]
lld/test/MachO/undef-suggest-extern-c.s [new file with mode: 0644]
lld/test/MachO/undef-suggest-extern-c2.s [new file with mode: 0644]