Commit Graph

2 Commits

Author SHA1 Message Date
Fangrui Song 54a366f515 [ELF] Add a corrector for case mismatch problems
Reviewed By: grimar, peter.smith

Differential Revision: https://reviews.llvm.org/D70506
2019-11-26 09:11:56 -08:00
Fangrui Song b4745fad24 [ELF] Add a spell corrector for "undefined symbol" diagnostics
Non-undefined symbols with Levenshtein distance 1 or a transposition are
suggestion candidates. This is probably good enough and it can suggest
some missing/superfluous qualifiers: const, restrict, volatile, & and &&
ref-qualifier, e.g.

   error: undefined symbol: foo(int*)
   >>> referenced by b.o:(.text+0x1)
  +>>> did you mean: foo(int const*)
  +>>> defined in: a.o

   error: undefined symbol: foo(int*&)
   >>> referenced by b.o:(.text+0x1)
  +>>> did you mean: foo(int*)
  +>>> defined in: b.o

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D67039

llvm-svn: 370853
2019-09-04 09:04:26 +00:00