mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Added saveBBreferences() for BasicBlock resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6451 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e7800b5458
commit
da3a8b19ce
@ -10,7 +10,10 @@
|
|||||||
#ifndef LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
|
#ifndef LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
|
||||||
#define LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
|
#define LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
class BasicBlock;
|
||||||
|
class MachineInstr;
|
||||||
class MachineFunction;
|
class MachineFunction;
|
||||||
class MachineBasicBlock;
|
class MachineBasicBlock;
|
||||||
class MachineConstantPool;
|
class MachineConstantPool;
|
||||||
@ -91,6 +94,11 @@ struct MachineCodeEmitter {
|
|||||||
///
|
///
|
||||||
static MachineCodeEmitter*
|
static MachineCodeEmitter*
|
||||||
createFilePrinterMachineCodeEmitter(MachineCodeEmitter&);
|
createFilePrinterMachineCodeEmitter(MachineCodeEmitter&);
|
||||||
|
|
||||||
|
///
|
||||||
|
virtual void saveBBreference(BasicBlock* BB, MachineInstr &MI) {
|
||||||
|
std::cerr << "Save BB reference unimplemented\n";
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -158,9 +158,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void emitPCRelativeDisp(Value *V) {
|
void emitPCRelativeDisp(Value *V) {
|
||||||
// put block in mapping BB -> { instr, address }. when BB is beginning to
|
if (MCE) MCE->emitPCRelativeDisp(V);
|
||||||
// output, find instr, set disp, overwrite instr at addr using the
|
|
||||||
// unsigned value gotten from emitter
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitGlobalAddress(GlobalValue *V, bool isPCRelative) {
|
void emitGlobalAddress(GlobalValue *V, bool isPCRelative) {
|
||||||
@ -173,9 +171,15 @@ namespace {
|
|||||||
void emitFunctionConstantValueAddress(unsigned ConstantNum, int Offset) {
|
void emitFunctionConstantValueAddress(unsigned ConstantNum, int Offset) {
|
||||||
if (MCE) MCE->emitFunctionConstantValueAddress(ConstantNum, Offset);
|
if (MCE) MCE->emitFunctionConstantValueAddress(ConstantNum, Offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void saveBBreference(BasicBlock* BB, MachineInstr &MI) {
|
||||||
|
if (MCE) MCE->saveBBreference(BB, MI);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
MachineCodeEmitter *MachineCodeEmitter::createFilePrinterMachineCodeEmitter(MachineCodeEmitter &MCE) {
|
MachineCodeEmitter *MachineCodeEmitter::createFilePrinterMachineCodeEmitter
|
||||||
|
(MachineCodeEmitter &MCE) {
|
||||||
return new FilePrinterMachineCodeEmitter(MCE, std::cerr);
|
return new FilePrinterMachineCodeEmitter(MCE, std::cerr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user