diff options
author | Chris Lattner <sabre@nondot.org> | 2004-08-11 02:22:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-08-11 02:22:39 +0000 |
commit | cf03da0ce913267c4971534e8792297e06535a4e (patch) | |
tree | f4a74645bb4162b33d08b8bfbb7f2cfaadd830f7 /utils/TableGen/CodeGenTarget.cpp | |
parent | 552a8428fa67d921d94fde534270811378a1b977 (diff) |
Start parsing more information from the Operand information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r-- | utils/TableGen/CodeGenTarget.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index 9004104315..e7ca857028 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -132,19 +132,26 @@ CodeGenInstruction::CodeGenInstruction(Record *R) : TheDef(R) { try { DagInit *DI = R->getValueAsDag("OperandList"); + unsigned MIOperandNo = 0; for (unsigned i = 0, e = DI->getNumArgs(); i != e; ++i) if (DefInit *Arg = dynamic_cast<DefInit*>(DI->getArg(i))) { Record *Rec = Arg->getDef(); MVT::ValueType Ty; + std::string PrintMethod = "printOperand"; + unsigned NumOps = 1; if (Rec->isSubClassOf("RegisterClass")) Ty = getValueType(Rec->getValueAsDef("RegType")); - else if (Rec->isSubClassOf("Operand")) + else if (Rec->isSubClassOf("Operand")) { Ty = getValueType(Rec->getValueAsDef("Type")); - else + PrintMethod = Rec->getValueAsString("PrintMethod"); + NumOps = Rec->getValueAsInt("NumMIOperands"); + } else throw "Unknown operand class '" + Rec->getName() + "' in instruction '" + R->getName() + "' instruction!"; - OperandList.push_back(OperandInfo(Rec, Ty, DI->getArgName(i))); + OperandList.push_back(OperandInfo(Rec, Ty, DI->getArgName(i), + PrintMethod, MIOperandNo)); + MIOperandNo += NumOps; } else { throw "Illegal operand for the '" + R->getName() + "' instruction!"; } |