Skip to content

Commit dc2832b

Browse files
author
Eric Holk
committed
---
yaml --- r: 4078 b: refs/heads/master c: 838511e h: refs/heads/master v: v3
1 parent 287b881 commit dc2832b

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e71f261e3f9ca6921d166671f1e5b7a38e8e3a8b
2+
refs/heads/master: 838511e3aa58045a88d76dd431c643fa94f4c6da

trunk/src/comp/middle/trans_comm.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ fn trans_send(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
207207
auto data = trans_lval(bcx, rhs);
208208
bcx = data.res.bcx;
209209
auto chan_ty = node_id_type(cx.fcx.lcx.ccx, id);
210-
auto unit_ty;
211210
alt (ty::struct(cx.fcx.lcx.ccx.tcx, chan_ty)) {
212211
case (ty::ty_chan(?t)) { unit_ty = t; }
213212
case (_) { bcx.fcx.lcx.ccx.sess.bug("non-chan type in trans_send"); }
@@ -223,6 +222,7 @@ fn trans_send(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
223222
bcx.build.Call(bcx.fcx.lcx.ccx.upcalls.send,
224223
~[bcx.fcx.lltaskptr, llchanval, lldataptr]);
225224
ret rslt(bcx, chn.val);
225+
auto unit_ty;
226226
}
227227

228228
fn trans_recv(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
@@ -234,20 +234,16 @@ fn trans_recv(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
234234
auto unit_ty = node_id_type(bcx.fcx.lcx.ccx, id);
235235
// FIXME: calculate copy init-ness in typestate.
236236

237-
ret recv_val(bcx, data.res.val, lhs, unit_ty, DROP_EXISTING);
238-
}
239-
240-
fn recv_val(&@block_ctxt cx, ValueRef to, &@ast::expr from, &ty::t unit_ty,
241-
copy_action action) -> result {
242-
auto bcx = cx;
243-
auto prt = trans_expr(bcx, from);
237+
auto prt = trans_expr(bcx, lhs);
244238
bcx = prt.bcx;
245-
auto lldataptr = bcx.build.PointerCast(to, T_ptr(T_ptr(T_i8())));
239+
auto lldataptr = bcx.build.PointerCast(data.res.val,
240+
T_ptr(T_ptr(T_i8())));
246241
auto llportptr = bcx.build.PointerCast(prt.val, T_opaque_port_ptr());
247242
bcx.build.Call(bcx.fcx.lcx.ccx.upcalls.recv,
248243
~[bcx.fcx.lltaskptr, lldataptr, llportptr]);
249-
auto data_load = load_if_immediate(bcx, to, unit_ty);
250-
//auto cp = copy_val(bcx, action, to, data_load, unit_ty);
244+
auto data_load = load_if_immediate(bcx, data.res.val, unit_ty);
245+
//auto cp = copy_val(bcx, DROP_EXISTING,
246+
// data.res.val, data_load, unit_ty);
251247
//bcx = cp.bcx;
252248

253249
add_clean_temp(cx, data_load, unit_ty);

0 commit comments

Comments
 (0)