[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp JITEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Dec 4 23:19:30 PST 2004
Changes in directory llvm/lib/ExecutionEngine/JIT:
JIT.cpp updated: 1.51 -> 1.52
JITEmitter.cpp updated: 1.58 -> 1.59
---
Log message:
Properly implement a fix for PR475: http://llvm.cs.uiuc.edu/PR475
---
Diffs of the changes: (+15 -13)
Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.51 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.52
--- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.51 Sun Dec 5 00:59:59 2004
+++ llvm/lib/ExecutionEngine/JIT/JIT.cpp Sun Dec 5 01:19:16 2004
@@ -265,19 +265,6 @@
return Addr;
}
-// getPointerToFunctionOrStub - If the specified function has been
-// code-gen'd, return a pointer to the function. If not, compile it, or use
-// a stub to implement lazy compilation if available.
-//
-void *JIT::getPointerToFunctionOrStub(Function *F) {
- // If we have already code generated the function, just return the address.
- if (void *Addr = getPointerToGlobalIfAvailable(F))
- return Addr;
-
- // Otherwise, if the target doesn't support it, just codegen the function.
- return getPointerToFunction(F);
-}
-
/// getOrEmitGlobalVariable - Return the address of the specified global
/// variable, possibly emitting it to memory if needed. This is used by the
/// Emitter.
Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.58 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.59
--- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.58 Wed Dec 1 11:13:05 2004
+++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Sun Dec 5 01:19:16 2004
@@ -208,6 +208,21 @@
}
+// getPointerToFunctionOrStub - If the specified function has been
+// code-gen'd, return a pointer to the function. If not, compile it, or use
+// a stub to implement lazy compilation if available.
+//
+void *JIT::getPointerToFunctionOrStub(Function *F) {
+ // If we have already code generated the function, just return the address.
+ if (void *Addr = getPointerToGlobalIfAvailable(F))
+ return Addr;
+
+ // Get a stub if the target supports it
+ return getJITResolver(MCE).getFunctionStub(F);
+}
+
+
+
//===----------------------------------------------------------------------===//
// JITEmitter code.
//
More information about the llvm-commits
mailing list