1 //===- InstrInfoEmitter.h - Generate a Instruction Set Desc. ----*- C++ -*-===//
3 // This tablegen backend is responsible for emitting a description of the target
4 // instruction set for the code generator.
6 //===----------------------------------------------------------------------===//
8 #ifndef INSTRINFO_EMITTER_H
9 #define INSTRINFO_EMITTER_H
11 #include "TableGenBackend.h"
16 class InstrInfoEmitter : public TableGenBackend {
17 RecordKeeper &Records;
19 InstrInfoEmitter(RecordKeeper &R) : Records(R) {}
21 // run - Output the instruction set description, returning true on failure.
22 void run(std::ostream &OS);
24 // runEnums - Print out enum values for all of the instructions.
25 void runEnums(std::ostream &OS);
27 void printDefList(ListInit *LI, const std::string &Name,
28 std::ostream &OS) const;
29 void emitRecord(Record *R, unsigned Num, Record *InstrInfo, std::ostream &OS);
30 void emitShiftedValue(Record *R, StringInit *Val, IntInit *Shift,