2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-23 10:24:01 +08:00

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

View File

@ -409,11 +409,7 @@ class LLVMIRGenerator:
self.llfunction = self.llmodule.get_global(func.name)
if self.llfunction is None:
llargtys = []
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))
llfunty = self.llty_of_type(func.type, bare=True)
self.llfunction = ll.Function(self.llmodule, llfunty, func.name)
if func.is_internal:
@ -427,7 +423,12 @@ class LLVMIRGenerator:
disubprogram = self.debug_info_emitter.emit_subprogram(func, self.llfunction)
# 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
# Second, create all basic blocks.