2003-10-05 21:27:59 +02:00
|
|
|
//===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
|
2005-04-22 02:00:37 +02:00
|
|
|
//
|
2003-10-20 22:20:30 +02: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.
|
2005-04-22 02:00:37 +02:00
|
|
|
//
|
2003-10-20 22:20:30 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-10-05 21:27:59 +02:00
|
|
|
//
|
|
|
|
// FIXME: document
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef CODEMITTERGEN_H
|
|
|
|
#define CODEMITTERGEN_H
|
|
|
|
|
|
|
|
#include "TableGenBackend.h"
|
2004-10-14 07:53:01 +02:00
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2003-10-05 21:27:59 +02:00
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2004-10-14 07:53:01 +02:00
|
|
|
class RecordVal;
|
|
|
|
|
2003-10-05 21:27:59 +02:00
|
|
|
class CodeEmitterGen : public TableGenBackend {
|
|
|
|
RecordKeeper &Records;
|
|
|
|
public:
|
|
|
|
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
|
2005-04-22 02:00:37 +02:00
|
|
|
|
2003-10-05 21:27:59 +02:00
|
|
|
// 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 07:53:01 +02: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-05 21:27:59 +02:00
|
|
|
};
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-10-05 21:27:59 +02:00
|
|
|
#endif
|