1 //===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
14 #ifndef CODEMITTERGEN_H
15 #define CODEMITTERGEN_H
17 #include "TableGenBackend.h"
28 class CodeEmitterGen : public TableGenBackend {
29 RecordKeeper &Records;
31 CodeEmitterGen(RecordKeeper &R) : Records(R) {}
33 // run - Output the code emitter
34 void run(raw_ostream &o);
36 void emitMachineOpEmitter(raw_ostream &o, const std::string &Namespace);
37 void emitGetValueBit(raw_ostream &o, const std::string &Namespace);
38 void reverseBits(std::vector<Record*> &Insts);
39 int getVariableBit(const std::string &VarName, BitsInit *BI, int bit);
40 std::string getInstructionCase(Record *R, CodeGenTarget &Target);
42 AddCodeToMergeInOperand(Record *R, BitsInit *BI, const std::string &VarName,
44 std::string &Case, CodeGenTarget &Target);
48 } // End llvm namespace