Added saveBBreferences() for BasicBlock resolution.

llvm-svn: 6451
This commit is contained in:
Misha Brukman 2003-05-30 20:32:45 +00:00
parent 62904a1538
commit c5a1e94883
2 changed files with 16 additions and 4 deletions

View File

@ -10,7 +10,10 @@
#ifndef LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
#define LLVM_CODEGEN_MACHINE_CODE_EMITTER_H
#include <iostream>
#include <string>
class BasicBlock;
class MachineInstr;
class MachineFunction;
class MachineBasicBlock;
class MachineConstantPool;
@ -91,6 +94,11 @@ struct MachineCodeEmitter {
///
static MachineCodeEmitter*
createFilePrinterMachineCodeEmitter(MachineCodeEmitter&);
///
virtual void saveBBreference(BasicBlock* BB, MachineInstr &MI) {
std::cerr << "Save BB reference unimplemented\n";
}
};
#endif

View File

@ -158,9 +158,7 @@ namespace {
}
}
void emitPCRelativeDisp(Value *V) {
// put block in mapping BB -> { instr, address }. when BB is beginning to
// output, find instr, set disp, overwrite instr at addr using the
// unsigned value gotten from emitter
if (MCE) MCE->emitPCRelativeDisp(V);
}
void emitGlobalAddress(GlobalValue *V, bool isPCRelative) {
@ -173,9 +171,15 @@ namespace {
void emitFunctionConstantValueAddress(unsigned ConstantNum, int 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);
}