The CodeEmitterGenerator used to consider ANY uninitialized field as being an
[oota-llvm.git] / utils / TableGen / InstrInfoEmitter.h
1 //===- InstrInfoEmitter.h - Generate a Instruction Set Desc. ----*- C++ -*-===//
2 //
3 // This tablegen backend is responsible for emitting a description of the target
4 // instruction set for the code generator.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef INSTRINFO_EMITTER_H
9 #define INSTRINFO_EMITTER_H
10
11 #include <iosfwd>
12 class RecordKeeper;
13 class Record;
14 class StringInit;
15 class IntInit;
16
17 class InstrInfoEmitter {
18   RecordKeeper &Records;
19 public:
20   InstrInfoEmitter(RecordKeeper &R) : Records(R) {}
21   
22   // run - Output the instruction set description, returning true on failure.
23   void run(std::ostream &OS);
24
25   // runEnums - Print out enum values for all of the instructions.
26   void runEnums(std::ostream &OS);
27 private:
28   void emitRecord(Record *R, unsigned Num, Record *InstrInfo, std::ostream &OS);
29   void emitShiftedValue(Record *R, StringInit *Val, IntInit *Shift,
30                         std::ostream &OS);
31 };
32
33 #endif