Remove some dead code
authorChris Lattner <sabre@nondot.org>
Mon, 22 Nov 2004 23:07:22 +0000 (23:07 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 22 Nov 2004 23:07:22 +0000 (23:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18136 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCCodeEmitter.cpp

index 31a603d53b6dc9a43c6c8afb09e81549cc005389..57f30c53bdcac471bf49f5de94404c976305d426 100644 (file)
 #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;