[llvm-commits] CVS: llvm/utils/TableGen/CodeGenInstruction.h InstrInfoEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Aug 19 09:57:39 PDT 2005
Changes in directory llvm/utils/TableGen:
CodeGenInstruction.h updated: 1.9 -> 1.10
InstrInfoEmitter.cpp updated: 1.22 -> 1.23
---
Log message:
For now, just emit empty operand info structures.
---
Diffs of the changes: (+24 -2)
CodeGenInstruction.h | 1 +
InstrInfoEmitter.cpp | 25 +++++++++++++++++++++++--
2 files changed, 24 insertions(+), 2 deletions(-)
Index: llvm/utils/TableGen/CodeGenInstruction.h
diff -u llvm/utils/TableGen/CodeGenInstruction.h:1.9 llvm/utils/TableGen/CodeGenInstruction.h:1.10
--- llvm/utils/TableGen/CodeGenInstruction.h:1.9 Thu Aug 18 18:38:41 2005
+++ llvm/utils/TableGen/CodeGenInstruction.h Fri Aug 19 11:57:28 2005
@@ -35,6 +35,7 @@
/// 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: llvm/utils/TableGen/InstrInfoEmitter.cpp
diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.22 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.23
--- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.22 Thu Aug 18 19:59:49 2005
+++ llvm/utils/TableGen/InstrInfoEmitter.cpp Fri Aug 19 11:57:28 2005
@@ -103,6 +103,21 @@
}
}
+ // 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 @@
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";
}
More information about the llvm-commits
mailing list