[PATCH] D67039: [ELF] Add a spell corrector for "undefined symbol" diagnostics

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 02:44:46 PDT 2019


peter.smith added a comment.

Interesting idea. I suspect we'll need to modify it over time in response to feedback. For example, what if there are several candidates, should we report them all, give one stronger weighting etc. One thing I don't think it will catch, which is my most common and least favourite typo, is a transposition which is usually a distance of 2. I'm less concerned about the algorithm speed at the moment as it should only trigger in an error case, and if it aids debugging then it is time well spent.



================
Comment at: ELF/Relocations.cpp:752
+static void reportUndefinedSymbol(const UndefinedDiag &undef,
+                                  bool spellCorrector) {
   Symbol &sym = *undef.sym;
----------------
I think you mean to use spellCorrector as a verb (do spelling correction), but it reads like a noun (spellCorrector is some object that does spelling correction). I suggest doSpellingCorrection or correctSpelling.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D67039





More information about the llvm-commits mailing list