mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +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 &&
|
while (NumberedOp < NumberOps &&
|
||||||
(CGI.Operands.isFlatOperandNotEmitted(NumberedOp) ||
|
(CGI.Operands.isFlatOperandNotEmitted(NumberedOp) ||
|
||||||
(NamedOpIndices.size() && NamedOpIndices.count(
|
(NamedOpIndices.size() && NamedOpIndices.count(
|
||||||
CGI.Operands.getSubOperandNumber(NumberedOp).first))))
|
CGI.Operands.getSubOperandNumber(NumberedOp).first)))) {
|
||||||
++NumberedOp;
|
++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++;
|
OpIdx = NumberedOp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user