mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
34 lines
817 B
C
34 lines
817 B
C
|
|
||
|
|
||
|
#ifndef SPARCV9CODEEMITTER_H
|
||
|
#define SPARCV9CODEEMITTER_H
|
||
|
|
||
|
#include "llvm/CodeGen/MachineCodeEmitter.h"
|
||
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||
|
#include "llvm/CodeGen/MachineInstr.h"
|
||
|
|
||
|
class SparcV9CodeEmitter : public MachineFunctionPass {
|
||
|
MachineCodeEmitter &MCE;
|
||
|
|
||
|
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
|