mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-04 09:54:09 +00:00
[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
This commit is contained in:
parent
4e669c9278
commit
f20a2199de
@ -107,9 +107,20 @@ AddCodeToMergeInOperand(Record *R, BitsInit *BI, const std::string &VarName,
|
||||
while (NumberedOp < NumberOps &&
|
||||
(CGI.Operands.isFlatOperandNotEmitted(NumberedOp) ||
|
||||
(NamedOpIndices.size() && NamedOpIndices.count(
|
||||
CGI.Operands.getSubOperandNumber(NumberedOp).first))))
|
||||
CGI.Operands.getSubOperandNumber(NumberedOp).first)))) {
|
||||
++NumberedOp;
|
||||
|
||||
if (NumberedOp >= CGI.Operands.back().MIOperandNo +
|
||||
CGI.Operands.back().MINumOperands) {
|
||||
errs() << "Too few operands in record " << R->getName() <<
|
||||
" (no match for variable " << VarName << "):\n";
|
||||
errs() << *R;
|
||||
errs() << '\n';
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
OpIdx = NumberedOp++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user