Skip to content

Commit

Permalink
codegen: jl_func_sig calling convention must include "thunk" (JuliaLa…
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Mar 17, 2020
1 parent 36241a9 commit 60ffa4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3856,6 +3856,7 @@ static Function *emit_tojlinvoke(jl_code_instance_t *codeinst, Module *M, jl_cod
GlobalVariable::PrivateLinkage,
name.str(), M);
jl_init_function(f);
f->addFnAttr(Thunk);
//f->setAlwaysInline();
ctx.f = f; // for jl_Module
BasicBlock *b0 = BasicBlock::Create(jl_LLVMContext, "top", f);
Expand All @@ -3878,7 +3879,8 @@ static Function *emit_tojlinvoke(jl_code_instance_t *codeinst, Module *M, jl_cod
}
theFarg = maybe_decay_untracked(theFarg);
auto args = f->arg_begin();
Value *r = ctx.builder.CreateCall(theFptr, { &*args, &*++args, &*++args, theFarg });
CallInst *r = ctx.builder.CreateCall(theFptr, { &*args, &*++args, &*++args, theFarg });
r->setAttributes(cast<Function>(theFptr)->getAttributes());
ctx.builder.CreateRet(r);
return f;
}
Expand Down

0 comments on commit 60ffa4a

Please sign in to comment.