summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrosbach <grosbach@91177308-0d34-0410-b5e6-96231b3b80d8>2012-07-12 21:37:20 +0000
committergrosbach <grosbach@91177308-0d34-0410-b5e6-96231b3b80d8>2012-07-12 21:37:20 +0000
commit52c80f1c50ed8bb109b64cb5bb465fcdc7a436fd (patch)
treefdad18bd3c68b70eea2dcfc0ce60290fcb91d3ab
parent8597e45a3bc59f5a7e8c5a80902e2814da0fab60 (diff)
TableGen: Assembly matcher 'insufficient operands' diagnostic.
Make sure the tblgen'erated asm matcher correctly returns numoperands+1 as the ErrorInfo when the problem was that there weren't enough operands specified. rdar://9142751 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160144 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/TableGen/AsmMatcherEmitter.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp
index f5e094e486a..da493b3a3b0 100644
--- a/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/utils/TableGen/AsmMatcherEmitter.cpp
@@ -2649,6 +2649,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
OS << " for (unsigned i = 0; i != " << MaxNumOperands << "; ++i) {\n";
OS << " if (i + 1 >= Operands.size()) {\n";
OS << " OperandsValid = (it->Classes[i] == " <<"InvalidMatchClass);\n";
+ OS << " if (!OperandsValid) ErrorInfo = i + 1;\n;";
OS << " break;\n";
OS << " }\n";
OS << " unsigned Diag = validateOperandClass(Operands[i+1],\n";