This change implements suggesting alternative mnemonics when an invalid one is specified. For example addru $9, $6, 17767 leads to the following error message:
error: unknown instruction, did you mean: add, addiu, addu, maddu?
Differential D40646
[mips] Enable the mnemonic spell corrector atanasyan on Nov 30 2017, 4:35 AM. Authored by
Details This change implements suggesting alternative mnemonics when an invalid one is specified. For example addru $9, $6, 17767 leads to the following error message: error: unknown instruction, did you mean: add, addiu, addu, maddu?
Diff Detail
Event TimelineComment Actions I looked at enabling this when @SjoerdMeijer developed the spell checker in the first place but hit upon a nasty error case: llvmgitsvnbuild $cat test-spellcheck.s swk $3, $4 llvmgitsvnbuild $./bin/llvm-mc -arch=mips -mcpu=mips32r6 test-spellcheck.s -o - -mattr=+micromips .text test-spellcheck.s:1:3: error: unknown instruction, did you mean: sw, swe, swl, swm, swp, swr, usw? swk $3, $4 ^ The swe there is potentially refering to the micromips or the micromipsr6 version. swl and swr should not be on the list. There's a number of instructions which don't have the correct predicates, so the spelling checker will deliver the wrong results, as the set of possible corrections is dependant on the feature bits that are enabled. I have been working on a patch set to correct / rework the instruction predicates which I should start posting next week. I think we should hold off on enabling this until the instruction predicates have been fixed.
Comment Actions Not at the moment, but don't abandon this patch. Over the next week or so I'll be uploading more of patches which fix various incorrect predicates in the MIPS backend. |
This does not require -show-encoding as the test does not actually check any instruction encodings.