diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-19 00:59:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-19 00:59:49 +0000 |
commit | 511ee687e523525ed5983700a922b657268b496d (patch) | |
tree | d1e38bca9bb1a40a50bd05663ead224c3a4813fe /llvm/utils/TableGen/InstrInfoEmitter.cpp | |
parent | 1d37296e02d729d89d80b481ecbbfd91a0ba12d2 (diff) | |
download | bcm5719-llvm-511ee687e523525ed5983700a922b657268b496d.tar.gz bcm5719-llvm-511ee687e523525ed5983700a922b657268b496d.zip |
now that all of the targets are clean w.r.t. the number of operands for each
instruction defined, actually emit this to the InstrInfoDescriptor, which
allows an assert in the machineinstrbuilder to do some checking for us,
and is required by the dag->dag emitter
llvm-svn: 22895
Diffstat (limited to 'llvm/utils/TableGen/InstrInfoEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/InstrInfoEmitter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp index 6340a153a25..ae7c4d19981 100644 --- a/llvm/utils/TableGen/InstrInfoEmitter.cpp +++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp @@ -120,14 +120,22 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num, Record *InstrInfo, std::map<ListInit*, unsigned> &ListNumbers, std::ostream &OS) { + int NumOperands; + if (Inst.hasVariableNumberOfOperands) + NumOperands = -1; + else if (!Inst.OperandList.empty()) + // Each logical operand can be multiple MI operands. + NumOperands = Inst.OperandList.back().MIOperandNo + + Inst.OperandList.back().MINumOperands; + else + NumOperands = 0; + OS << " { \""; if (Inst.Name.empty()) OS << Inst.TheDef->getName(); else OS << Inst.Name; - OS << "\",\t" << -1 - //Inst.OperandList.size() - << ", -1, 0, false, 0, 0, 0, 0"; + OS << "\",\t" << NumOperands << ", -1, 0, false, 0, 0, 0, 0"; // Emit all of the target indepedent flags... if (Inst.isReturn) OS << "|M_RET_FLAG"; |