aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/InstrInfoEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-19 16:57:28 +0000
committerChris Lattner <sabre@nondot.org>2005-08-19 16:57:28 +0000
commit0e384b66a781fc0ff005f475a7ab151afa054fb0 (patch)
tree3b2a6d983cb69d5acb1127a541e5675857e968ad /utils/TableGen/InstrInfoEmitter.cpp
parentc19d5621aee638177045f7857c49aa30ee74423f (diff)
downloadexternal_llvm-0e384b66a781fc0ff005f475a7ab151afa054fb0.zip
external_llvm-0e384b66a781fc0ff005f475a7ab151afa054fb0.tar.gz
external_llvm-0e384b66a781fc0ff005f475a7ab151afa054fb0.tar.bz2
For now, just emit empty operand info structures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22910 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/InstrInfoEmitter.cpp')
-rw-r--r--utils/TableGen/InstrInfoEmitter.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp
index ae7c4d1..667a4df 100644
--- a/utils/TableGen/InstrInfoEmitter.cpp
+++ b/utils/TableGen/InstrInfoEmitter.cpp
@@ -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";
}