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:
Misha Brukman 2003-05-30 20:32:45 +00:00
parent e7800b5458
commit da3a8b19ce
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);
}