summaryrefslogtreecommitdiff
path: root/MLKLLVMCompiler.mm
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-09-12 13:46:25 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-09-12 14:03:43 +0200
commit562318bc16804f13d07ce81493e7d4f032c5bc42 (patch)
tree58767c8173a9b98f4bd39af320bc7acfc1fd86a9 /MLKLLVMCompiler.mm
parentced360319ceaa26ab02c84cdefb862e3facd5f7b (diff)
LLVM: Make the LLVM IR interpreter able to call built-in functions.
Diffstat (limited to 'MLKLLVMCompiler.mm')
-rw-r--r--MLKLLVMCompiler.mm7
1 files changed, 4 insertions, 3 deletions
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 <const Type *> argtypes (2, VoidPointerTy);
- vector <const Type *> argtypes;
- FunctionType *ftype = FunctionType::get (VoidPointerTy, argtypes, true);
+ vector <const Type *> 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);