transforms.llvm_ir_generator: call devirtualized functions directly.

This commit is contained in:
whitequark 2016-01-10 15:54:46 +00:00
parent bbd0ca7827
commit f92ce291ef
1 changed files with 5 additions and 2 deletions

View File

@ -925,10 +925,13 @@ class LLVMIRGenerator:
return llvalue
def _prepare_closure_call(self, insn):
llclosure = self.map(insn.target_function())
llargs = [self.map(arg) for arg in insn.arguments()]
llclosure = self.map(insn.target_function())
llenv = self.llbuilder.extract_value(llclosure, 0)
llfun = self.llbuilder.extract_value(llclosure, 1)
if insn.static_target_function is None:
llfun = self.llbuilder.extract_value(llclosure, 1)
else:
llfun = self.map(insn.static_target_function)
return llfun, [llenv] + list(llargs)
def _prepare_ffi_call(self, insn):