For now, just emit empty operand info structures.
authorChris Lattner <sabre@nondot.org>
Fri, 19 Aug 2005 16:57:28 +0000 (16:57 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 19 Aug 2005 16:57:28 +0000 (16:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22910 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenInstruction.h
utils/TableGen/InstrInfoEmitter.cpp

index 54f4b983a96d39d4a117e19b0ba6fad98180505b..b140d0021106aa4bf3ea86d60c8f61c15fceed1e 100644 (file)
@@ -35,6 +35,7 @@ namespace llvm {
     /// operand list for a tablegen instruction.
     struct OperandInfo {
       /// Rec - The definition this operand is declared as.
+      ///
       Record *Rec;
 
       /// Ty - The MachineValueType of the operand.
index ae7c4d19981594319ea48d74da21c02fe4a4c3f4..667a4df8b88a2f7f106a749cfc9a32fa82481c7a 100644 (file)
@@ -103,6 +103,21 @@ void InstrInfoEmitter::run(std::ostream &OS) {
     }
   }
 
+  // Emit all of the operand info records.
+  OS << "\n";
+  for (CodeGenTarget::inst_iterator II = Target.inst_begin(),
+       E = Target.inst_end(); II != E; ++II) {
+    const CodeGenInstruction &Inst = II->second;
+    if (!Inst.hasVariableNumberOfOperands) {
+      OS << "static const TargetOperandInfo " << Inst.TheDef->getName()
+         << "_Operands[] = {";
+      // FIXME: Emit operand info.
+      OS << "};\n";
+    }
+  }
+  
+  // Emit all of the TargetInstrDescriptor records.
+  //
   OS << "\nstatic const TargetInstrDescriptor " << TargetName
      << "Insts[] = {\n";
   emitRecord(Target.getPHIInstruction(), 0, InstrInfo, ListNumbers, OS);
@@ -173,10 +188,16 @@ void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
 
   LI = Inst.TheDef->getValueAsListInit("Defs");
   if (!LI->getSize())
-    OS << "EmptyImpList ";
+    OS << "EmptyImpList, ";
   else
-    OS << "ImplicitList" << ListNumbers[LI] << " ";
+    OS << "ImplicitList" << ListNumbers[LI] << ", ";
 
+  // Emit the operand info.
+  if (NumOperands == -1)
+    OS << "0 ";
+  else
+    OS << Inst.TheDef->getName() << "_Operands ";
+  
   OS << " },  // Inst #" << Num << " = " << Inst.TheDef->getName() << "\n";
 }