forked from M-Labs/artiq
1
0
Fork 0

LLVMIRGenerator: don't map sret LLVM argument to any ARTIQ arguments.

This commit is contained in:
whitequark 2015-08-31 14:02:02 -06:00
parent 5e0ec3a6ea
commit 3ca5967cea
1 changed files with 7 additions and 6 deletions

View File

@ -409,11 +409,7 @@ class LLVMIRGenerator:
self.llfunction = self.llmodule.get_global(func.name) self.llfunction = self.llmodule.get_global(func.name)
if self.llfunction is None: if self.llfunction is None:
llargtys = [] llfunty = self.llty_of_type(func.type, bare=True)
for arg in func.arguments:
llargtys.append(self.llty_of_type(arg.type))
llfunty = ll.FunctionType(args=llargtys,
return_type=self.llty_of_type(func.type.ret, for_return=True))
self.llfunction = ll.Function(self.llmodule, llfunty, func.name) self.llfunction = ll.Function(self.llmodule, llfunty, func.name)
if func.is_internal: if func.is_internal:
@ -427,7 +423,12 @@ class LLVMIRGenerator:
disubprogram = self.debug_info_emitter.emit_subprogram(func, self.llfunction) disubprogram = self.debug_info_emitter.emit_subprogram(func, self.llfunction)
# First, map arguments. # First, map arguments.
for arg, llarg in zip(func.arguments, self.llfunction.args): if self.llfunction.type.pointee.__has_sret:
llactualargs = self.llfunction.args[1:]
else:
llactualargs = self.llfunction.args
for arg, llarg in zip(func.arguments, llactualargs):
self.llmap[arg] = llarg self.llmap[arg] = llarg
# Second, create all basic blocks. # Second, create all basic blocks.