summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-08-13 18:16:34 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-08-13 18:16:34 +0000
commit71d84781176dab7d2f4e78e78ac91286198487d5 (patch)
treefb427c774a3d8ef8f330acd6a38088729a5ad334 /lib
parent37df460874e8d9d28e6833e5fb66a9aa8e1ef50a (diff)
downloadllvm-71d84781176dab7d2f4e78e78ac91286198487d5.tar.gz
llvm-71d84781176dab7d2f4e78e78ac91286198487d5.tar.bz2
llvm-71d84781176dab7d2f4e78e78ac91286198487d5.tar.xz
Deconstify parameter to getPointerToFunction().
Run passes on single function (hey, just-in-time compilation!) instead of the entire module that contains it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/JIT/VM.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/JIT/VM.cpp b/lib/ExecutionEngine/JIT/VM.cpp
index d5815e8dd8..ee7e311ebb 100644
--- a/lib/ExecutionEngine/JIT/VM.cpp
+++ b/lib/ExecutionEngine/JIT/VM.cpp
@@ -39,7 +39,7 @@ void VM::setupPassManager() {
/// getPointerToFunction - This method is used to get the address of the
/// specified function, compiling it if neccesary.
///
-void *VM::getPointerToFunction(const Function *F) {
+void *VM::getPointerToFunction(Function *F) {
void *&Addr = GlobalAddress[F]; // Function already code gen'd
if (Addr) return Addr;
@@ -49,11 +49,9 @@ void *VM::getPointerToFunction(const Function *F) {
static bool isAlreadyCodeGenerating = false;
assert(!isAlreadyCodeGenerating && "ERROR: RECURSIVE COMPILATION DETECTED!");
- // FIXME: JIT all of the functions in the module. Eventually this will JIT
- // functions on demand. This has the effect of populating all of the
- // non-external functions into the GlobalAddress table.
+ // JIT the function
isAlreadyCodeGenerating = true;
- PM.run(getModule());
+ PM.run(*F);
isAlreadyCodeGenerating = false;
assert(Addr && "Code generation didn't add function to GlobalAddress table!");