mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-30 17:33:24 +00:00
eliminate need for the NumMIOperands field in Operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8ed4c47d70
commit
d438b53e76
@ -365,8 +365,20 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
|
||||
DagInit *MIOpInfo = 0;
|
||||
if (Rec->isSubClassOf("Operand")) {
|
||||
PrintMethod = Rec->getValueAsString("PrintMethod");
|
||||
NumOps = Rec->getValueAsInt("NumMIOperands");
|
||||
MIOpInfo = Rec->getValueAsDag("MIOperandInfo");
|
||||
|
||||
// Verify that MIOpInfo has an 'ops' root value.
|
||||
if (!dynamic_cast<DefInit*>(MIOpInfo->getOperator()) ||
|
||||
dynamic_cast<DefInit*>(MIOpInfo->getOperator())
|
||||
->getDef()->getName() != "ops")
|
||||
throw "Bad value for MIOperandInfo in operand '" + Rec->getName() +
|
||||
"'\n";
|
||||
|
||||
// If we have MIOpInfo, then we have #operands equal to number of entries
|
||||
// in MIOperandInfo.
|
||||
if (unsigned NumArgs = MIOpInfo->getNumArgs())
|
||||
NumOps = NumArgs;
|
||||
|
||||
} else if (Rec->getName() == "variable_ops") {
|
||||
hasVariableNumberOfOperands = true;
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user