[PATCH] D33128: [AsmParser] Mnemonic Spell Corrector

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 03:46:38 PDT 2017


sdardis added a reviewer: sdardis.
sdardis added a comment.

Nits inlined. Also you should update the summary.

Thanks,
Simon



================
Comment at: test/MC/ARM/invalid-instructions.s:3
+@ RUN: not llvm-mc -triple=thumb -show-encoding < %s 2>&1 | FileCheck %s --check-prefix=CHECK-THUMB
+
+@ First check what happens when an instruction is omitted:
----------------
Add one line comment explaining that this is testing the mnemonic spell checker.


================
Comment at: test/MC/ARM/invalid-instructions.s:46
+
+@ Check an instruction that is 2 edits away, resuling in a number of suggestions:
+
----------------
resuling ->  resulting


================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2718
+  OS << "static unsigned EditDistance(std::string S, std::string T) {\n";
+  OS << "  assert(S.size() && T.size());\n";
+  OS << "  const unsigned N = S.size() + 1;\n";
----------------
Add a string documenting this assertion such as "Empty string for assembly mnemoic!"


================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2765
+    OS << "\n";
+    OS << "  // Edit distance bigger than 2 are probably not useful suggestions.\n";
+    OS << "  if (MinDist > 2 || Candidates.empty())\n";
----------------
"Edit distance.." -> "Candidates with an edit distance.."


https://reviews.llvm.org/D33128





More information about the llvm-commits mailing list