This is an archive of the discontinued LLVM Phabricator instance.

[Asm, ARM] Add fallback diag for multiple invalid operands
ClosedPublic

Authored by olista01 on Aug 15 2017, 8:24 AM.

Details

Summary

This adds a "invalid operands for instruction" diagnostic for
instructions where there is an instruction encoding with the correct
mnemonic and which is available for this target, but where multiple
operands do not match those which were provided. This makes it clear
that there is some combination of operands that is valid for the current
target, which the default diagnostic of "invalid instruction" does not.

Since this is a very general error, we only emit it if we don't have a
more specific error.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 created this revision.Aug 15 2017, 8:24 AM
javed.absar added inline comments.Nov 21 2017, 4:10 AM
include/llvm/MC/MCParser/MCTargetAsmParser.h
192

Would it be a good idea to have a message string with the assert, summarises expectation mismatch?

olista01 updated this revision to Diff 123896.Nov 22 2017, 3:03 AM

Add messages to assertions.

javed.absar accepted this revision.Dec 4 2017, 3:39 AM

LGTM. Thanks for this.

This revision is now accepted and ready to land.Dec 4 2017, 3:39 AM
SjoerdMeijer added inline comments.Dec 4 2017, 3:44 AM
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
10226

nit: 'teh' spell error

This revision was automatically updated to reflect the committed changes.
olista01 reopened this revision.Dec 4 2017, 5:48 AM

I've reverted this because it is causing a buildbot failure - http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/6552/steps/test-check-all/logs/stdio.

It's not clear to me what the problem is from the lit output, and I haven't been able to reproduce the failure locally by enabling expensive checks. This looks very similar to the problem Sander hit in D40011.

This revision is now accepted and ready to land.Dec 4 2017, 5:48 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2019, 5:06 AM
Herald added a subscriber: hiraditya. · View Herald Transcript