From 562318bc16804f13d07ce81493e7d4f032c5bc42 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 12 Sep 2011 13:46:25 +0200 Subject: LLVM: Make the LLVM IR interpreter able to call built-in functions. --- MLKLLVMCompiler.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'MLKLLVMCompiler.mm') diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm index 8cb60e7..10dd1b7 100644 --- a/MLKLLVMCompiler.mm +++ b/MLKLLVMCompiler.mm @@ -133,7 +133,7 @@ static Constant InitializeNativeTarget(); std::string error; - //execution_engine = ExecutionEngine::create (module, true, &error); + //execution_engine = ExecutionEngine::create (module, true, &error); execution_engine = ExecutionEngine::create (module, false, &error); assert(execution_engine); @@ -574,8 +574,9 @@ static Constant if ((built_in_name = toilet_built_in_function_name(_head))) { //vector argtypes (2, VoidPointerTy); - vector argtypes; - FunctionType *ftype = FunctionType::get (VoidPointerTy, argtypes, true); + vector argtypes (2 + [_argumentForms count] + 1, VoidPointerTy); + argtypes[1] = PointerPointerTy; + FunctionType *ftype = FunctionType::get (VoidPointerTy, argtypes, false); functionPtr = module->getOrInsertFunction (built_in_name, ftype); closureDataPtr = ConstantPointerNull::get (VoidPointerTy); -- cgit v1.2.3