llvm/lib/Target/SparcV9/SparcV9CodeEmitter.h
Misha Brukman 0d60345dcf Keep track of the current BasicBlock being processed so that a referencing
MachineInstr can later be patched up correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6378 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 22:41:44 +00:00

36 lines
864 B
C++

#ifndef SPARCV9CODEEMITTER_H
#define SPARCV9CODEEMITTER_H
#include "llvm/BasicBlock.h"
#include "llvm/CodeGen/MachineCodeEmitter.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
class SparcV9CodeEmitter : public MachineFunctionPass {
MachineCodeEmitter &MCE;
BasicBlock *BB;
public:
SparcV9CodeEmitter(MachineCodeEmitter &M) : MCE(M) {}
bool runOnMachineFunction(MachineFunction &F);
/// Function generated by the CodeEmitterGenerator using TableGen
///
static unsigned getBinaryCodeForInstr(MachineInstr &MI);
private:
static int64_t getMachineOpValue(MachineOperand &MO);
static unsigned getValueBit(int64_t Val, unsigned bit);
void emitConstant(unsigned Val, unsigned Size);
void emitBasicBlock(MachineBasicBlock &MBB);
void emitInstruction(MachineInstr &MI);
};
#endif