[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)
commitf475eed48d2454b61d94f8da38c361b8ad7f6c73
tree03235e19fa011233ac9827cb0baf79bbed08f1eb
parente1490afa4c9162d08f4fc550165470d781a5ffdc
[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

llvm-svn: 318759
llvm/test/MC/AArch64/arm64-diags.s
llvm/test/MC/AArch64/basic-a64-diagnostics.s
llvm/utils/TableGen/AsmMatcherEmitter.cpp