@@ -207,7 +207,6 @@ fn trans_send(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
207
207
auto data = trans_lval( bcx, rhs) ;
208
208
bcx = data. res. bcx;
209
209
auto chan_ty = node_id_type( cx. fcx. lcx. ccx, id) ;
210
- auto unit_ty;
211
210
alt ( ty:: struct ( cx. fcx. lcx. ccx. tcx, chan_ty) ) {
212
211
case ( ty:: ty_chan( ?t) ) { unit_ty = t; }
213
212
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,
223
222
bcx. build. Call ( bcx. fcx. lcx. ccx. upcalls. send,
224
223
~[ bcx. fcx. lltaskptr, llchanval, lldataptr] ) ;
225
224
ret rslt( bcx, chn. val) ;
225
+ auto unit_ty;
226
226
}
227
227
228
228
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,
234
234
auto unit_ty = node_id_type( bcx. fcx. lcx. ccx, id) ;
235
235
// FIXME: calculate copy init-ness in typestate.
236
236
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) ;
244
238
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 ( ) ) ) ) ;
246
241
auto llportptr = bcx. build. PointerCast ( prt. val, T_opaque_port_ptr ( ) ) ;
247
242
bcx. build. Call ( bcx. fcx. lcx. ccx. upcalls. recv,
248
243
~[ 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);
251
247
//bcx = cp.bcx;
252
248
253
249
add_clean_temp( cx, data_load, unit_ty) ;
0 commit comments