2003-10-06 03:27:59 +08:00
|
|
|
//===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
|
2003-10-21 04:20:30 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2003-10-06 03:27:59 +08:00
|
|
|
//
|
|
|
|
// FIXME: document
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef CODEMITTERGEN_H
|
|
|
|
#define CODEMITTERGEN_H
|
|
|
|
|
|
|
|
#include "TableGenBackend.h"
|
2004-10-14 13:53:01 +08:00
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2003-10-06 03:27:59 +08:00
|
|
|
|
2003-11-12 06:41:34 +08:00
|
|
|
namespace llvm {
|
|
|
|
|
2004-10-14 13:53:01 +08:00
|
|
|
class RecordVal;
|
|
|
|
|
2003-10-06 03:27:59 +08:00
|
|
|
class CodeEmitterGen : public TableGenBackend {
|
|
|
|
RecordKeeper &Records;
|
|
|
|
public:
|
|
|
|
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
|
|
|
|
|
|
|
|
// run - Output the code emitter
|
|
|
|
void run(std::ostream &o);
|
|
|
|
private:
|
|
|
|
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
|
|
|
|
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
|
2004-10-14 13:53:01 +08:00
|
|
|
void emitInstrOpBits(std::ostream &o,
|
|
|
|
const std::vector<RecordVal> &Vals,
|
|
|
|
std::map<std::string, unsigned> &OpOrder,
|
|
|
|
std::map<std::string, bool> &OpContinuous);
|
2003-10-06 03:27:59 +08:00
|
|
|
};
|
|
|
|
|
2003-11-12 06:41:34 +08:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-10-06 03:27:59 +08:00
|
|
|
#endif
|