Skip to content

Commit b82235b

Browse files
cixtorgraydon
authored andcommitted
---
yaml --- r: 2389 b: refs/heads/master c: 157f61f h: refs/heads/master i: 2387: e57f670 v: v3
1 parent 8818af5 commit b82235b

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 2d9ccf3ae56ce8d403b66a3cb0a560161eb9cb03
2+
refs/heads/master: 157f61f8c871e0fd63a57fe63821360d0a0d95fe

trunk/src/comp/middle/trans.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7074,14 +7074,25 @@ fn trans_exit_task_glue(@glue_fns glues,
70747074
let vec[ValueRef] V_args = vec();
70757075

70767076
auto llfn = glues.exit_task_glue;
7077-
let ValueRef lltaskptr = llvm.LLVMGetParam(llfn, 4u);
70787077

70797078
auto entrybb = llvm.LLVMAppendBasicBlock(llfn, _str.buf("entry"));
70807079
auto build = new_builder(entrybb);
7081-
auto tptr = build.PtrToInt(lltaskptr, T_int());
7082-
auto V_args2 = vec(tptr) + V_args;
7083-
trans_native_call(build, glues, lltaskptr,
7084-
externs, tn, llmod, "upcall_exit", true, V_args2);
7080+
7081+
let ValueRef arg1 = llvm.LLVMGetParam(llfn, 0u);
7082+
let ValueRef arg2 = llvm.LLVMGetParam(llfn, 1u);
7083+
let ValueRef arg3 = llvm.LLVMGetParam(llfn, 2u);
7084+
let ValueRef arg4 = llvm.LLVMGetParam(llfn, 3u);
7085+
let ValueRef arg5 = llvm.LLVMGetParam(llfn, 4u);
7086+
7087+
auto main_type = T_fn(vec(T_int(), T_int(), T_int(), T_int()), T_void());
7088+
7089+
auto fun = build.IntToPtr(arg1, T_ptr(main_type));
7090+
auto call_args = vec(arg2, arg3, arg4, arg5);
7091+
build.FastCall(fun, call_args);
7092+
7093+
trans_native_call(build, glues, arg3,
7094+
externs, tn, llmod, "upcall_exit", true, vec(arg3));
7095+
70857096
build.RetVoid();
70867097
}
70877098

@@ -7524,22 +7535,12 @@ fn trans_vec_append_glue(@local_ctxt cx) {
75247535
fn make_glues(ModuleRef llmod, type_names tn) -> @glue_fns {
75257536
ret @rec(activate_glue = decl_glue(llmod, tn, abi.activate_glue_name()),
75267537
yield_glue = decl_glue(llmod, tn, abi.yield_glue_name()),
7527-
/*
7528-
* Note: the signature passed to decl_cdecl_fn here looks unusual
7529-
* because it is. It corresponds neither to a native signature
7530-
* nor a normal rust-ABI signature. In fact it is a fake
7531-
* signature, that exists solely to acquire the task pointer as
7532-
* an argument to the upcall. It so happens that the runtime sets
7533-
* up the task pointer as the sole incoming argument to the frame
7534-
* that we return into when returning to the exit task glue. So
7535-
* this is the signature required to retrieve it.
7536-
*/
75377538
exit_task_glue = decl_cdecl_fn(llmod, abi.exit_task_glue_name(),
75387539
T_fn(vec(T_int(),
75397540
T_int(),
75407541
T_int(),
75417542
T_int(),
7542-
T_taskptr(tn)),
7543+
T_int()),
75437544
T_void())),
75447545

75457546
native_glues_rust =

0 commit comments

Comments
 (0)