forked from M-Labs/artiq
1
0
Fork 0

LLVMIRGenerator: fix syscall emission.

This commit is contained in:
whitequark 2015-08-28 03:03:12 -05:00
parent 6a29775bf0
commit 9fd25a1cc4
1 changed files with 7 additions and 4 deletions

View File

@ -793,6 +793,9 @@ class LLVMIRGenerator:
def _prepare_ffi_call(self, insn): def _prepare_ffi_call(self, insn):
llargs = [self.map(arg) for arg in insn.arguments()] llargs = [self.map(arg) for arg in insn.arguments()]
llfunname = insn.target_function().type.name
llfun = self.llmodule.get_global(llfunname)
if llfun is None:
llfunty = ll.FunctionType(self.llty_of_type(insn.type, for_return=True), llfunty = ll.FunctionType(self.llty_of_type(insn.type, for_return=True),
[llarg.type for llarg in llargs]) [llarg.type for llarg in llargs])
llfun = ll.Function(self.llmodule, llfunty, llfun = ll.Function(self.llmodule, llfunty,