freebsd-dev/contrib/llvm/utils/TableGen/CodeEmitterGen.h

50 lines
1.4 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 <vector>
#include <string>
namespace llvm {
class RecordVal;
class BitsInit;
class CodeGenTarget;
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);
2010-01-01 10:31:22 +00:00
int getVariableBit(const std::string &VarName, BitsInit *BI, int bit);
std::string getInstructionCase(Record *R, CodeGenTarget &Target);
void
AddCodeToMergeInOperand(Record *R, BitsInit *BI, const std::string &VarName,
unsigned &NumberedOp,
std::string &Case, CodeGenTarget &Target);
2009-06-02 17:52:33 +00:00
};
} // End llvm namespace
#endif