llvm.org GIT mirror llvm / f20a219
[TableGen] Don't assert, produce an error, when an instruction has too few operands When an instruction's operand list does not have a sufficient number of operands to match with all of the variables that contribute to its encoding, instead of asserting inside a call to getSubOperandNumber, produce an informative error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204542 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 6 years ago
1 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
106106 while (NumberedOp < NumberOps &&
107107 (CGI.Operands.isFlatOperandNotEmitted(NumberedOp) ||
108108 (NamedOpIndices.size() && NamedOpIndices.count(
109 CGI.Operands.getSubOperandNumber(NumberedOp).first))))
109 CGI.Operands.getSubOperandNumber(NumberedOp).first)))) {
110110 ++NumberedOp;
111
112 if (NumberedOp >= CGI.Operands.back().MIOperandNo +
113 CGI.Operands.back().MINumOperands) {
114 errs() << "Too few operands in record " << R->getName() <<
115 " (no match for variable " << VarName << "):\n";
116 errs() << *R;
117 errs() << '\n';
118
119 return;
120 }
121 }
111122
112123 OpIdx = NumberedOp++;
113124 }