mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-01 02:33:44 +00:00
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
This commit is contained in:
parent
af6f38e424
commit
0d60345dcf
@ -30,8 +30,7 @@ int64_t SparcV9CodeEmitter::getMachineOpValue(MachineOperand &MO) {
|
||||
} else if (MO.isImmediate()) {
|
||||
return MO.getImmedValue();
|
||||
} else if (MO.isPCRelativeDisp()) {
|
||||
// FIXME!!!
|
||||
//return MO.getPCRelativeDisp();
|
||||
MCE->saveBBreference(currBB, MO);
|
||||
return 0;
|
||||
} else {
|
||||
assert(0 && "Unknown type of MachineOperand");
|
||||
@ -55,6 +54,7 @@ bool SparcV9CodeEmitter::runOnMachineFunction(MachineFunction &MF) {
|
||||
}
|
||||
|
||||
void SparcV9CodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) {
|
||||
currBB = MBB.getBasicBlock();
|
||||
MCE.startBasicBlock(MBB);
|
||||
for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I)
|
||||
emitInstruction(**I);
|
||||
|
@ -3,12 +3,14 @@
|
||||
#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) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user