TableGen: Enumerate Schedule Model too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189839 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vincent Lejeune 2013-09-03 19:43:28 +00:00
parent 89008539a3
commit d8f2eb301c
2 changed files with 14 additions and 1 deletions

View File

@ -952,6 +952,11 @@ XXXInstrInfo.h:
int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIndex);
} // End namespace XXX
Instruction itineraries can be queried using MCDesc::getSchedClass(). The
value can be named by an enumemation in llvm::XXX::Sched namespace generated
by TableGen in XXXGenInstrInfo.inc. The name of the schedule classes are
the same as provided in XXXSchedule.td plus a default NoIntinerary class.
Instruction Relation Mapping
----------------------------

View File

@ -545,7 +545,15 @@ void InstrInfoEmitter::emitEnums(raw_ostream &OS) {
<< "\t= " << i << ",\n";
}
OS << " INSTRUCTION_LIST_END = " << NumberedInstructions.size() << "\n";
OS << " };\n}\n";
OS << " };\n";
OS << "namespace Sched {\n";
OS << " enum {\n";
for (unsigned i = 0, e = SchedModels.numInstrSchedClasses(); i != e; ++i) {
OS << " " << SchedModels.getSchedClass(i).Name
<< "\t= " << i << ",\n";
}
OS << " SCHED_LIST_END = " << SchedModels.numInstrSchedClasses() << "\n";
OS << " };\n}\n}\n";
OS << "} // End llvm namespace \n";
OS << "#endif // GET_INSTRINFO_ENUM\n\n";