2003-08-03 17:24:10 +00:00
|
|
|
//===- InstrInfoEmitter.h - Generate a Instruction Set Desc. ----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// This tablegen backend is responsible for emitting a description of the target
|
|
|
|
// instruction set for the code generator.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef INSTRINFO_EMITTER_H
|
|
|
|
#define INSTRINFO_EMITTER_H
|
|
|
|
|
2003-08-06 04:32:07 +00:00
|
|
|
#include "TableGenBackend.h"
|
2003-08-03 21:57:51 +00:00
|
|
|
class StringInit;
|
|
|
|
class IntInit;
|
2003-08-06 04:32:07 +00:00
|
|
|
class ListInit;
|
2003-08-03 17:24:10 +00:00
|
|
|
|
2003-08-06 04:32:07 +00:00
|
|
|
class InstrInfoEmitter : public TableGenBackend {
|
2003-08-03 17:24:10 +00:00
|
|
|
RecordKeeper &Records;
|
|
|
|
public:
|
|
|
|
InstrInfoEmitter(RecordKeeper &R) : Records(R) {}
|
|
|
|
|
|
|
|
// run - Output the instruction set description, returning true on failure.
|
2003-08-03 21:57:51 +00:00
|
|
|
void run(std::ostream &OS);
|
2003-08-03 17:24:10 +00:00
|
|
|
|
|
|
|
// runEnums - Print out enum values for all of the instructions.
|
2003-08-03 21:57:51 +00:00
|
|
|
void runEnums(std::ostream &OS);
|
|
|
|
private:
|
2003-08-06 04:32:07 +00:00
|
|
|
void printDefList(ListInit *LI, const std::string &Name,
|
|
|
|
std::ostream &OS) const;
|
2003-08-03 21:57:51 +00:00
|
|
|
void emitRecord(Record *R, unsigned Num, Record *InstrInfo, std::ostream &OS);
|
|
|
|
void emitShiftedValue(Record *R, StringInit *Val, IntInit *Shift,
|
|
|
|
std::ostream &OS);
|
2003-08-03 17:24:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|