summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-09-29 17:24:28 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-09-29 17:24:28 +0200
commitc1c4ac24df8f201403b55eb95c0f9f1c11e3a9f1 (patch)
treebf7f3d4ec1f84f19c546f41725ce19d7b22e5af3
parent7e28d6c5e341e23a5b27799d67461c1aa2437df3 (diff)
Use ExecutionEngine::runFunction for immediate execution.
-rw-r--r--MLKLLVMCompiler.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm
index a37b4c0..91d744d 100644
--- a/MLKLLVMCompiler.mm
+++ b/MLKLLVMCompiler.mm
@@ -37,6 +37,7 @@
#include <llvm/CallingConv.h>
#include <llvm/DerivedTypes.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
+#include <llvm/ExecutionEngine/GenericValue.h>
#include <llvm/Instructions.h>
//#include <llvm/Interpreter.h>
#include <llvm/Module.h>
@@ -174,9 +175,11 @@ static Constant
#if 1
// JIT-compile.
- fn = (id (*)()) execution_engine->getPointerToFunction (function);
+ std::vector<GenericValue> nogenericargs;
+ lambdaForm = (id)execution_engine->runFunction (function, nogenericargs).PointerVal;
+ //fn = (id (*)()) execution_engine->getPointerToFunction (function);
// Execute.
- lambdaForm = fn();
+ //lambdaForm = fn();
// FIXME: Free machine code when appropriate. (I.e. now? But this crashes after a LOAD.)
//execution_engine->freeMachineCodeForFunction (function);
#else