Switched calling conventions so that spawn with multiple arguments works.

This commit is contained in:
Eric Holk 2011-05-27 15:19:38 -07:00
parent d49998f0ed
commit 8cfc388d40
3 changed files with 8 additions and 9 deletions

View File

@ -5949,7 +5949,6 @@ fn mk_spawn_wrapper(&@block_ctxt cx,
&ty::t args_ty) -> result {
auto llmod = cx.fcx.lcx.ccx.llmod;
let TypeRef args_ty_tref = type_of(cx.fcx.lcx.ccx, cx.sp, args_ty);
//let TypeRef wrapper_fn_type = T_fn([args_ty_tref], T_void());
let TypeRef wrapper_fn_type =
type_of_fn(cx.fcx.lcx.ccx, cx.sp, ast::proto_fn,
@ -5963,8 +5962,8 @@ fn mk_spawn_wrapper(&@block_ctxt cx,
ty_str(cx.fcx.lcx.ccx.tn, wrapper_fn_type));
// TODO: construct a name based on tname
auto llfndecl = decl_cdecl_fn(llmod, "spawn_wrap",
wrapper_fn_type);
auto llfndecl = decl_fastcall_fn(llmod, "spawn_wrap",
wrapper_fn_type);
log_err #fmt("spawn wrapper decl type: %s",
val_str(cx.fcx.lcx.ccx.tn, llfndecl));
@ -6028,10 +6027,10 @@ fn mk_spawn_wrapper(&@block_ctxt cx,
i += 1;
}
fbcx.build.Call(llfn,
child_args);
fbcx.build.FastCall(llfn,
child_args);
fbcx.build.RetVoid();
finish_fn(fcx, fbcx.llbb);
// TODO: make sure we clean up everything we need to.

View File

@ -480,7 +480,7 @@ upcall_start_task(rust_task *spawner,
// here.
uintptr_t start_args[] = {0, 0, 0, args};
task->start(spawnee_fn, (uintptr_t)&start_args, sizeof(start_args));
task->start(spawnee_fn, (uintptr_t)start_args, sizeof(start_args));
return task;
}

View File

@ -2,11 +2,11 @@
// -*- rust -*-
fn main() {
auto t = spawn child(10);
auto t = spawn child(10);
}
fn child(int i) {
log_err i;
log_err i;
}
// Local Variables: