Chris Lattner | 33ccf7e | 2003-08-03 17:24:10 +0000 | [diff] [blame] | 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; |
Chris Lattner | a3ae614 | 2003-08-03 21:57:51 +0000 | [diff] [blame^] | 13 | class Record; |
| 14 | class StringInit; |
| 15 | class IntInit; |
Chris Lattner | 33ccf7e | 2003-08-03 17:24:10 +0000 | [diff] [blame] | 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. |
Chris Lattner | a3ae614 | 2003-08-03 21:57:51 +0000 | [diff] [blame^] | 23 | void run(std::ostream &OS); |
Chris Lattner | 33ccf7e | 2003-08-03 17:24:10 +0000 | [diff] [blame] | 24 | |
| 25 | // runEnums - Print out enum values for all of the instructions. |
Chris Lattner | a3ae614 | 2003-08-03 21:57:51 +0000 | [diff] [blame^] | 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); |
Chris Lattner | 33ccf7e | 2003-08-03 17:24:10 +0000 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | #endif |