From ac9b572dc308315c0ecb1685cc2f439337594b11 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 23 Aug 2008 18:50:06 +0200 Subject: LLVM compiler: Support the LLVM interpreter for debugging. --- MLKLLVMCompiler.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm index f2d1d6e..f65654f 100644 --- a/MLKLLVMCompiler.mm +++ b/MLKLLVMCompiler.mm @@ -33,6 +33,7 @@ #include #include #include +//#include #include #include #include @@ -149,16 +150,22 @@ static Constant //function->dump(); - // JIT-compile. - fn = (id (*)()) execution_engine->getPointerToFunction (function); //module->dump(); //NSLog (@"%p", fn); [pool release]; //NSLog (@"Code compiled."); +#if 1 + // JIT-compile. + fn = (id (*)()) execution_engine->getPointerToFunction (function); // Execute. lambdaForm = fn(); + execution_engine->freeMachineCodeForFunction (function); +#else + Interpreter *i = Interpreter::create (module_provider); + lambdaForm = i->runFunction (function)->PointerVal; +#endif //NSLog (@"Closure built."); -- cgit v1.2.3