OSDN Git Service

[TableGen] AsmMatcher: Fix bug with reported diagnostic for operand.
authorSander de Smalen <sander.desmalen@arm.com>
Tue, 21 Nov 2017 12:26:06 +0000 (12:26 +0000)
committerSander de Smalen <sander.desmalen@arm.com>
Tue, 21 Nov 2017 12:26:06 +0000 (12:26 +0000)
commit4f7355afcdd91c65fb29e9d43ed57ad0f89dacc4
treef22da2ba2d7f8f17742689a64747720d8239460d
parent4ef99ab6831ad19f6eef62ca3b35e68f6320a984
[TableGen] AsmMatcher: Fix bug with reported diagnostic for operand.

Summary:
The generated diagnostic by the AsmMatcher isn't always applicable to the AsmOperand.

This is because the code will only update the diagnostic if it is more specific than the previous diagnostic. However, when having validated operands and 'moved on' to a next operand (for some instruction/alias for which all previous operands are valid), if the diagnostic is InvalidOperand, than that should be set as the diagnostic, not the more specific message about a previous operand for some other instruction/alias candidate.

Reviewers: craig.topper, olista01, rengolin, stoklund

Reviewed By: olista01

Subscribers: javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318759 91177308-0d34-0410-b5e6-96231b3b80d8
test/MC/AArch64/arm64-diags.s
test/MC/AArch64/basic-a64-diagnostics.s
utils/TableGen/AsmMatcherEmitter.cpp