[llvm-commits] CVS: llvm/utils/TableGen/InstrInfoEmitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Aug 18 18:00:01 PDT 2005



Changes in directory llvm/utils/TableGen:

InstrInfoEmitter.cpp updated: 1.21 -> 1.22
---
Log message:

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


---
Diffs of the changes:  (+11 -3)

 InstrInfoEmitter.cpp |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)


Index: llvm/utils/TableGen/InstrInfoEmitter.cpp
diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.21 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.22
--- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.21	Thu Aug 18 17:12:31 2005
+++ llvm/utils/TableGen/InstrInfoEmitter.cpp	Thu Aug 18 19:59:49 2005
@@ -120,14 +120,22 @@
                                   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";






More information about the llvm-commits mailing list