blob: e0a7071ed6dcf5cf47339f3f5df5d84293b5110c [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// FIXME: document
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef CODEMITTERGEN_H
15#define CODEMITTERGEN_H
16
17#include "TableGenBackend.h"
18#include <map>
19#include <vector>
20#include <string>
21
22namespace llvm {
23
24class RecordVal;
25class BitsInit;
26
27class CodeEmitterGen : public TableGenBackend {
28 RecordKeeper &Records;
29public:
30 CodeEmitterGen(RecordKeeper &R) : Records(R) {}
31
32 // run - Output the code emitter
33 void run(std::ostream &o);
34private:
35 void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
36 void emitGetValueBit(std::ostream &o, const std::string &Namespace);
37 void reverseBits(std::vector<Record*> &Insts);
38 int getVariableBit(const std::string &VarName, BitsInit *BI, int bit);
39};
40
41} // End llvm namespace
42
43#endif