Skip to content

Commit bd9dd5e

Browse files
committed
Change the numbering of upcall functions. upcall_0 now calls a function
with no arguments. This is still preparation for calling functions that don't take a rust task argument.
1 parent 73f4728 commit bd9dd5e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/comp/middle/trans.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,7 @@ fn decl_upcall_glue(ModuleRef llmod, type_names tn, uint _n) -> ValueRef {
832832
let int n = _n as int;
833833
let str s = abi.upcall_glue_name(n);
834834
let vec[TypeRef] args =
835-
vec(T_int(), // callee
836-
T_int()) // taskptr
835+
vec(T_int()) // callee
837836
+ _vec.init_elt[TypeRef](T_int(), n as uint);
838837

839838
ret decl_fastcall_fn(llmod, s, T_fn(args, T_int()));
@@ -864,7 +863,7 @@ fn trans_upcall2(builder b, @glue_fns glues, ValueRef lltaskptr,
864863
&hashmap[str, ValueRef] upcalls,
865864
type_names tn, ModuleRef llmod, str name,
866865
vec[ValueRef] args) -> ValueRef {
867-
let int n = _vec.len[ValueRef](args) as int;
866+
let int n = (_vec.len[ValueRef](args) as int) + 1;
868867
let ValueRef llupcall = get_upcall(upcalls, tn, llmod, name, n);
869868
llupcall = llvm.LLVMConstPointerCast(llupcall, T_int());
870869

@@ -6090,7 +6089,7 @@ fn make_glues(ModuleRef llmod, type_names tn) -> @glue_fns {
60906089

60916090
upcall_glues =
60926091
_vec.init_fn[ValueRef](bind decl_upcall_glue(llmod, tn, _),
6093-
abi.n_upcall_glues as uint),
6092+
abi.n_upcall_glues + 1 as uint),
60946093
no_op_type_glue = decl_no_op_type_glue(llmod, tn),
60956094
memcpy_glue = decl_memcpy_glue(llmod),
60966095
bzero_glue = decl_bzero_glue(llmod),

0 commit comments

Comments
 (0)