blob: 5bb220dd4a616af3acf5b0358ea5a8e9918c1f90 [file] [log] [blame]
Chris Lattnerf5bd1b72003-10-05 19:27:59 +00001//===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
John Criswelld3032032003-10-20 20:20:30 +00002//
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//===----------------------------------------------------------------------===//
Chris Lattnerf5bd1b72003-10-05 19:27:59 +00009//
10// FIXME: document
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef CODEMITTERGEN_H
15#define CODEMITTERGEN_H
16
17#include "TableGenBackend.h"
Misha Brukman8393c152004-10-14 05:53:01 +000018#include <map>
19#include <vector>
Chris Lattnerf5bd1b72003-10-05 19:27:59 +000020
Brian Gaeke960707c2003-11-11 22:41:34 +000021namespace llvm {
22
Misha Brukman8393c152004-10-14 05:53:01 +000023class RecordVal;
24
Chris Lattnerf5bd1b72003-10-05 19:27:59 +000025class CodeEmitterGen : public TableGenBackend {
26 RecordKeeper &Records;
27public:
28 CodeEmitterGen(RecordKeeper &R) : Records(R) {}
29
30 // run - Output the code emitter
31 void run(std::ostream &o);
32private:
33 void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
34 void emitGetValueBit(std::ostream &o, const std::string &Namespace);
Misha Brukman8393c152004-10-14 05:53:01 +000035 void emitInstrOpBits(std::ostream &o,
36 const std::vector<RecordVal> &Vals,
37 std::map<std::string, unsigned> &OpOrder,
38 std::map<std::string, bool> &OpContinuous);
Chris Lattnerf5bd1b72003-10-05 19:27:59 +000039};
40
Brian Gaeke960707c2003-11-11 22:41:34 +000041} // End llvm namespace
42
Chris Lattnerf5bd1b72003-10-05 19:27:59 +000043#endif