about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-05-27 15:19:38 -0700
committerEric Holk <eholk@mozilla.com>2011-05-27 15:20:58 -0700
commit8cfc388d40673b21282dcdf656cbff3ac8166eca (patch)
tree2934640774ac780fa522c9e78dd046a15e08dc8f /src
parentd49998f0ed9b0a239b40d30ccfde750f8439cac4 (diff)
downloadrust-8cfc388d40673b21282dcdf656cbff3ac8166eca.tar.gz
rust-8cfc388d40673b21282dcdf656cbff3ac8166eca.zip
Switched calling conventions so that spawn with multiple arguments works.
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/trans.rs11
-rw-r--r--src/rt/rust_upcall.cpp2
-rw-r--r--src/test/run-pass/spawn.rs4
3 files changed, 8 insertions, 9 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 9f3d4b8b3b3..835098c3d7f 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -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.
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 966ddb15eee..6d8734bd430 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -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;
 }
 
diff --git a/src/test/run-pass/spawn.rs b/src/test/run-pass/spawn.rs
index dcee95ada00..6978326d9b1 100644
--- a/src/test/run-pass/spawn.rs
+++ b/src/test/run-pass/spawn.rs
@@ -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: