2003-05-24 00:15:53 +00:00
|
|
|
//===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
|
2005-04-22 00:00:37 +00:00
|
|
|
//
|
2003-10-20 20:20:30 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:37:13 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-22 00:00:37 +00:00
|
|
|
//
|
2003-10-20 20:20:30 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-05-24 00:15:53 +00:00
|
|
|
//
|
2003-07-31 04:32:37 +00:00
|
|
|
// FIXME: document
|
2003-05-24 00:15:53 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef CODEMITTERGEN_H
|
|
|
|
#define CODEMITTERGEN_H
|
|
|
|
|
2003-08-06 04:36:35 +00:00
|
|
|
#include "TableGenBackend.h"
|
2004-10-14 05:53:01 +00:00
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2006-07-13 21:02:53 +00:00
|
|
|
#include <string>
|
2003-05-24 00:15:53 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
2004-10-14 05:53:01 +00:00
|
|
|
class RecordVal;
|
2006-07-13 21:02:53 +00:00
|
|
|
class BitsInit;
|
2004-10-14 05:53:01 +00:00
|
|
|
|
2003-08-06 04:36:35 +00:00
|
|
|
class CodeEmitterGen : public TableGenBackend {
|
2003-05-24 00:15:53 +00:00
|
|
|
RecordKeeper &Records;
|
|
|
|
public:
|
|
|
|
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
|
2005-04-22 00:00:37 +00:00
|
|
|
|
2003-08-01 04:38:18 +00:00
|
|
|
// run - Output the code emitter
|
|
|
|
void run(std::ostream &o);
|
2003-07-31 04:32:37 +00:00
|
|
|
private:
|
2003-05-24 00:15:53 +00:00
|
|
|
void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace);
|
|
|
|
void emitGetValueBit(std::ostream &o, const std::string &Namespace);
|
2006-07-13 21:02:53 +00:00
|
|
|
void reverseBits(std::vector<Record*> &Insts);
|
|
|
|
int getVariableBit(const std::string &VarName, BitsInit *BI, int bit);
|
2003-05-24 00:15:53 +00:00
|
|
|
};
|
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2003-05-24 00:15:53 +00:00
|
|
|
#endif
|