[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp
Chris Lattner
lattner at persephone.cs.uiuc.edu
Mon Nov 22 15:07:39 PST 2004
Changes in directory llvm/lib/Target/PowerPC:
PPC32CodeEmitter.cpp updated: 1.15 -> 1.16
---
Log message:
Remove some dead code
---
Diffs of the changes: (+0 -76)
Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp
diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.15 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.16
--- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.15 Mon Nov 22 15:51:40 2004
+++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Mon Nov 22 17:07:22 2004
@@ -24,82 +24,6 @@
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;
MachineCodeEmitter &MCE;
More information about the llvm-commits
mailing list