Remove some dead code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18136 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2004-11-22 23:07:22 +00:00
parent dd99885da3
commit f2190b39d0
-76
View File
@@ -23,82 +23,6 @@
#include "llvm/Support/Debug.h"
using namespace llvm;
namespace {
class JITResolver {
MachineCodeEmitter &MCE;
// LazyCodeGenMap - Keep track of call sites for functions that are to be
// lazily resolved.
std::map<unsigned, Function*> LazyCodeGenMap;
// LazyResolverMap - Keep track of the lazy resolver created for a
// particular function so that we can reuse them if necessary.
std::map<Function*, unsigned> LazyResolverMap;
public:
JITResolver(MachineCodeEmitter &mce) : MCE(mce) {}
unsigned getLazyResolver(Function *F);
unsigned addFunctionReference(unsigned Address, Function *F);
private:
unsigned emitStubForFunction(Function *F);
static void CompilationCallback();
unsigned resolveFunctionReference(unsigned RetAddr);
};
static JITResolver &getResolver(MachineCodeEmitter &MCE) {
static JITResolver *TheJITResolver = 0;
if (TheJITResolver == 0)
TheJITResolver = new JITResolver(MCE);
return *TheJITResolver;
}
}
unsigned JITResolver::getLazyResolver(Function *F) {
std::map<Function*, unsigned>::iterator I = LazyResolverMap.lower_bound(F);
if (I != LazyResolverMap.end() && I->first == F) return I->second;
unsigned Stub = emitStubForFunction(F);
LazyResolverMap.insert(I, std::make_pair(F, Stub));
return Stub;
}
/// addFunctionReference - This method is called when we need to emit the
/// address of a function that has not yet been emitted, so we don't know the
/// address. Instead, we emit a call to the CompilationCallback method, and
/// keep track of where we are.
///
unsigned JITResolver::addFunctionReference(unsigned Address, Function *F) {
LazyCodeGenMap[Address] = F;
return (intptr_t)&JITResolver::CompilationCallback;
}
unsigned JITResolver::resolveFunctionReference(unsigned RetAddr) {
std::map<unsigned, Function*>::iterator I = LazyCodeGenMap.find(RetAddr);
assert(I != LazyCodeGenMap.end() && "Not in map!");
Function *F = I->second;
LazyCodeGenMap.erase(I);
// FIXME: this needs to be rewritten.
return 0; //MCE.forceCompilationOf(F);
}
/// emitStubForFunction - This method is used by the JIT when it needs to emit
/// the address of a function for a function whose code has not yet been
/// generated. In order to do this, it generates a stub which jumps to the lazy
/// function compiler, which will eventually get fixed to call the function
/// directly.
///
unsigned JITResolver::emitStubForFunction(Function *F) {
std::cerr << "PPC32CodeEmitter::emitStubForFunction() unimplemented!\n";
abort();
return 0;
}
void JITResolver::CompilationCallback() {
std::cerr << "PPC32CodeEmitter: CompilationCallback() unimplemented!";
abort();
}
namespace {
class PPC32CodeEmitter : public MachineFunctionPass {
TargetMachine &TM;