Skip to content

Commit 14d85ca

Browse files
committed
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.
1 parent d55048e commit 14d85ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/comp/middle/trans.rs

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

0 commit comments

Comments
 (0)