Make bind glue do an llvm tail call to the target. Closes #2.

Now, llvm probably won't actually *emit* a tail call with the compiler
options and configuration we have, but this should punt it over to the
more general "do tail calls" bug.
This commit is contained in:
Michael Sullivan 2011-08-15 17:33:08 -07:00
parent d55048ec5c
commit 14d85ca87a

View file

@ -4436,7 +4436,7 @@ fn trans_bind_thunk(cx: &@local_ctxt, sp: &span, incoming_fty: &ty::t,
type_of_fn_from_ty(bcx_ccx(bcx), sp, outgoing_fty, ty_param_count);
lltargetfn = bcx.build.PointerCast(lltargetfn, T_ptr(T_ptr(lltargetty)));
lltargetfn = bcx.build.Load(lltargetfn);
bcx.build.FastCall(lltargetfn, llargs);
llvm::LLVMSetTailCall(bcx.build.FastCall(lltargetfn, llargs), 1);
bcx.build.RetVoid();
finish_fn(fcx, lltop);
ret {val: llthunk, ty: llthunk_ty};