From c1c4ac24df8f201403b55eb95c0f9f1c11e3a9f1 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Mon, 29 Sep 2008 17:24:28 +0200 Subject: Use ExecutionEngine::runFunction for immediate execution. --- MLKLLVMCompiler.mm | 7 +++++-- 1 file 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 #include #include +#include #include //#include #include @@ -174,9 +175,11 @@ static Constant #if 1 // JIT-compile. - fn = (id (*)()) execution_engine->getPointerToFunction (function); + std::vector 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 -- cgit v1.2.3