freebsd-dev/utils/TableGen/CodeEmitterGen.h

45 lines
1.1 KiB
C
Raw Normal View History

2009-06-02 17:52:33 +00:00
//===- CodeEmitterGen.h - Code Emitter Generator ----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// FIXME: document
//
//===----------------------------------------------------------------------===//
#ifndef CODEMITTERGEN_H
#define CODEMITTERGEN_H
#include "TableGenBackend.h"
#include <map>
#include <vector>
#include <string>
namespace llvm {
class RecordVal;
class BitsInit;
2009-12-15 18:09:07 +00:00
struct Init;
2009-06-02 17:52:33 +00:00
class CodeEmitterGen : public TableGenBackend {
RecordKeeper &Records;
public:
CodeEmitterGen(RecordKeeper &R) : Records(R) {}
// run - Output the code emitter
2009-07-04 13:58:26 +00:00
void run(raw_ostream &o);
2009-06-02 17:52:33 +00:00
private:
2009-07-04 13:58:26 +00:00
void emitMachineOpEmitter(raw_ostream &o, const std::string &Namespace);
void emitGetValueBit(raw_ostream &o, const std::string &Namespace);
2009-06-02 17:52:33 +00:00
void reverseBits(std::vector<Record*> &Insts);
2009-12-15 18:09:07 +00:00
int getVariableBit(const Init *VarVal, BitsInit *BI, int bit);
2009-06-02 17:52:33 +00:00
};
} // End llvm namespace
#endif