@@ -2086,7 +2086,6 @@ fn lazily_emit_tydesc_glue(cx: &@block_ctxt, field: int,
2086
2086
make_generic_glue ( lcx, cx. sp , ti. ty , glue_fn,
2087
2087
copy_helper ( make_copy_glue) ,
2088
2088
ti. ty_params , "copy" ) ;
2089
-
2090
2089
}
2091
2090
}
2092
2091
}
@@ -2319,8 +2318,34 @@ fn duplicate_heap_parts_if_necessary(cx: &@block_ctxt, vptr: ValueRef,
2319
2318
2320
2319
tag copy_action { INIT ; DROP_EXISTING ; }
2321
2320
2321
+ // These are the types that are passed by pointer.
2322
+ fn type_is_structural_or_param ( tcx : & ty:: ctxt , t : ty:: t ) -> bool {
2323
+ if ty:: type_is_structural ( tcx, t) { ret true ; }
2324
+ alt ty:: struct ( tcx, t) {
2325
+ ty:: ty_param ( _, _) { ret true ; }
2326
+ _ { ret false; }
2327
+ }
2328
+ }
2329
+
2322
2330
fn copy_val ( cx : & @block_ctxt , action : copy_action , dst : ValueRef ,
2323
- src : ValueRef , t : & ty:: t ) -> result {
2331
+ src : ValueRef , t : & ty:: t ) -> @block_ctxt {
2332
+ if type_is_structural_or_param ( bcx_ccx ( cx) . tcx , t) &&
2333
+ action == DROP_EXISTING {
2334
+ let do_copy_cx = new_sub_block_ctxt ( cx, "do_copy" ) ;
2335
+ let next_cx = new_sub_block_ctxt ( cx, "next" ) ;
2336
+ let self_assigning =
2337
+ cx. build . ICmp ( lib:: llvm:: LLVMIntNE ,
2338
+ cx. build . PointerCast ( dst, val_ty ( src) ) , src) ;
2339
+ cx. build . CondBr ( self_assigning, do_copy_cx. llbb , next_cx. llbb ) ;
2340
+ do_copy_cx = copy_val_no_check ( do_copy_cx, action, dst, src, t) ;
2341
+ do_copy_cx. build . Br ( next_cx. llbb ) ;
2342
+ ret next_cx;
2343
+ }
2344
+ ret copy_val_no_check ( cx, action, dst, src, t) ;
2345
+ }
2346
+
2347
+ fn copy_val_no_check ( cx : & @block_ctxt , action : copy_action , dst : ValueRef ,
2348
+ src : ValueRef , t : & ty:: t ) -> @block_ctxt {
2324
2349
let ccx = bcx_ccx ( cx) ;
2325
2350
// FIXME this is just a clunky stopgap. we should do proper checking in an
2326
2351
// earlier pass.
@@ -2329,36 +2354,26 @@ fn copy_val(cx: &@block_ctxt, action: copy_action, dst: ValueRef,
2329
2354
}
2330
2355
2331
2356
if ty:: type_is_scalar ( ccx. tcx , t) || ty:: type_is_native ( ccx. tcx , t) {
2332
- ret rslt ( cx, cx. build . Store ( src, dst) ) ;
2357
+ cx. build . Store ( src, dst) ;
2358
+ ret cx;
2333
2359
} else if ty:: type_is_nil ( ccx. tcx , t) || ty:: type_is_bot ( ccx. tcx , t) {
2334
- ret rslt ( cx , C_nil ( ) ) ;
2360
+ ret cx ;
2335
2361
} else if ty:: type_is_boxed ( ccx. tcx , t) {
2336
- let bcx;
2337
- if action == DROP_EXISTING {
2338
- bcx = drop_ty ( cx, cx. build . Load ( dst) , t) . bcx ;
2339
- } else { bcx = cx; }
2362
+ let bcx = if action == DROP_EXISTING {
2363
+ drop_ty ( cx, cx. build . Load ( dst) , t) . bcx
2364
+ } else { cx } ;
2340
2365
bcx = take_ty ( bcx, src, t) . bcx ;
2341
- ret rslt( bcx, bcx. build . Store ( src, dst) ) ;
2342
- } else if ty:: type_is_structural ( ccx. tcx , t) ||
2343
- ty:: type_has_dynamic_size ( ccx. tcx , t) {
2344
- // Check for self-assignment.
2345
- let do_copy_cx = new_sub_block_ctxt ( cx, "do_copy" ) ;
2346
- let next_cx = new_sub_block_ctxt ( cx, "next" ) ;
2347
- let self_assigning =
2348
- cx. build . ICmp ( lib:: llvm:: LLVMIntNE ,
2349
- cx. build . PointerCast ( dst, val_ty ( src) ) , src) ;
2350
- cx. build . CondBr ( self_assigning, do_copy_cx. llbb , next_cx. llbb ) ;
2351
-
2352
- if action == DROP_EXISTING {
2353
- do_copy_cx = drop_ty ( do_copy_cx, dst, t) . bcx ;
2354
- }
2355
- do_copy_cx = memmove_ty ( do_copy_cx, dst, src, t) . bcx ;
2356
- do_copy_cx = take_ty ( do_copy_cx, dst, t) . bcx ;
2357
- do_copy_cx. build . Br ( next_cx. llbb ) ;
2358
-
2359
- ret rslt( next_cx, C_nil ( ) ) ;
2360
- }
2361
- ccx. sess . bug ( "unexpected type in trans::copy_val: " +
2366
+ bcx. build . Store ( src, dst) ;
2367
+ ret bcx;
2368
+ } else if type_is_structural_or_param ( ccx. tcx , t) {
2369
+ let bcx = if action == DROP_EXISTING {
2370
+ drop_ty ( cx, dst, t) . bcx
2371
+ } else { cx } ;
2372
+ bcx = memmove_ty ( bcx, dst, src, t) . bcx ;
2373
+ bcx = take_ty ( bcx, dst, t) . bcx ;
2374
+ ret bcx;
2375
+ }
2376
+ ccx. sess . bug ( "unexpected type in trans::copy_val_no_check: " +
2362
2377
ty_to_str ( ccx. tcx , t) ) ;
2363
2378
}
2364
2379
@@ -2368,47 +2383,46 @@ fn copy_val(cx: &@block_ctxt, action: copy_action, dst: ValueRef,
2368
2383
// FIXME: We always zero out the source. Ideally we would detect the
2369
2384
// case where a variable is always deinitialized by block exit and thus
2370
2385
// doesn't need to be dropped.
2371
- // FIXME: This can return only a block_ctxt, not a result.
2372
2386
fn move_val ( cx : @block_ctxt , action : copy_action , dst : ValueRef ,
2373
- src : & lval_result , t : & ty:: t ) -> result {
2387
+ src : & lval_result , t : & ty:: t ) -> @ block_ctxt {
2374
2388
let src_val = src. res . val ;
2375
2389
if ty:: type_is_scalar ( bcx_tcx ( cx) , t) ||
2376
2390
ty:: type_is_native ( bcx_tcx ( cx) , t) {
2377
2391
if src. is_mem { src_val = cx. build . Load ( src_val) ; }
2378
2392
cx. build . Store ( src_val, dst) ;
2379
- ret rslt ( cx , C_nil ( ) ) ;
2393
+ ret cx ;
2380
2394
} else if ty:: type_is_nil ( bcx_tcx ( cx) , t) ||
2381
2395
ty:: type_is_bot ( bcx_tcx ( cx) , t) {
2382
- ret rslt ( cx , C_nil ( ) ) ;
2396
+ ret cx ;
2383
2397
} else if ty:: type_is_unique ( bcx_tcx ( cx) , t) ||
2384
2398
ty:: type_is_boxed ( bcx_tcx ( cx) , t) {
2385
2399
if src. is_mem { src_val = cx. build . Load ( src_val) ; }
2386
2400
if action == DROP_EXISTING {
2387
2401
cx = drop_ty ( cx, cx. build . Load ( dst) , t) . bcx ;
2388
2402
}
2389
2403
cx. build . Store ( src_val, dst) ;
2390
- if src. is_mem { ret zero_alloca ( cx, src. res . val , t) ; }
2404
+ if src. is_mem { ret zero_alloca ( cx, src. res . val , t) . bcx ; }
2391
2405
2392
2406
// If we're here, it must be a temporary.
2393
2407
revoke_clean ( cx, src_val) ;
2394
- ret rslt ( cx , C_nil ( ) ) ;
2408
+ ret cx ;
2395
2409
} else if ty:: type_is_structural ( bcx_tcx ( cx) , t) ||
2396
2410
ty:: type_has_dynamic_size ( bcx_tcx ( cx) , t) {
2397
2411
if action == DROP_EXISTING { cx = drop_ty ( cx, dst, t) . bcx ; }
2398
2412
cx = memmove_ty ( cx, dst, src_val, t) . bcx ;
2399
2413
if src. is_mem {
2400
- ret zero_alloca ( cx, src_val, t) ;
2414
+ ret zero_alloca ( cx, src_val, t) . bcx ;
2401
2415
} else { // Temporary value
2402
2416
revoke_clean ( cx, src_val) ;
2403
- ret rslt ( cx , C_nil ( ) ) ;
2417
+ ret cx ;
2404
2418
}
2405
2419
}
2406
2420
bcx_ccx ( cx) . sess . bug ( "unexpected type in trans::move_val: " +
2407
2421
ty_to_str ( bcx_tcx ( cx) , t) ) ;
2408
2422
}
2409
2423
2410
2424
fn move_val_if_temp ( cx : @block_ctxt , action : copy_action , dst : ValueRef ,
2411
- src : & lval_result , t : & ty:: t ) -> result {
2425
+ src : & lval_result , t : & ty:: t ) -> @ block_ctxt {
2412
2426
2413
2427
// Lvals in memory are not temporaries. Copy them.
2414
2428
if src. is_mem {
@@ -2560,8 +2574,8 @@ fn trans_unary(cx: &@block_ctxt, op: ast::unop, e: &@ast::expr,
2560
2574
let llety = T_ptr ( type_of ( bcx_ccx ( sub. bcx ) , e. span , e_ty) ) ;
2561
2575
body = sub. bcx . build . PointerCast ( body, llety) ;
2562
2576
}
2563
- let res = move_val_if_temp ( sub. bcx , INIT , body, lv, e_ty) ;
2564
- ret rslt( res . bcx , sub. box ) ;
2577
+ let bcx = move_val_if_temp ( sub. bcx , INIT , body, lv, e_ty) ;
2578
+ ret rslt( bcx, sub. box ) ;
2565
2579
}
2566
2580
ast:: deref. {
2567
2581
bcx_ccx ( cx) . sess . bug ( "deref expressions should have been \
@@ -2901,10 +2915,8 @@ mod ivec {
2901
2915
let copy_src =
2902
2916
load_if_immediate ( copy_loop_body_cx, copy_src_ptr, unit_ty) ;
2903
2917
2904
- rs =
2905
- copy_val ( copy_loop_body_cx, INIT , copy_dest_ptr, copy_src,
2906
- unit_ty) ;
2907
- let post_copy_cx = rs. bcx ;
2918
+ let post_copy_cx = copy_val
2919
+ ( copy_loop_body_cx, INIT , copy_dest_ptr, copy_src, unit_ty) ;
2908
2920
// Increment both pointers.
2909
2921
if ty:: type_has_dynamic_size ( bcx_tcx ( cx) , t) {
2910
2922
// We have to increment by the dynamically-computed size.
@@ -3104,10 +3116,8 @@ mod ivec {
3104
3116
rhs_copy_cx. llbb ) ;
3105
3117
let dest_ptr_lhs_copy = lhs_do_copy_cx. build . Load ( dest_ptr_ptr) ;
3106
3118
let lhs_val = load_if_immediate ( lhs_do_copy_cx, lhs_ptr, unit_ty) ;
3107
- rs =
3108
- copy_val ( lhs_do_copy_cx, INIT , dest_ptr_lhs_copy, lhs_val,
3109
- unit_ty) ;
3110
- lhs_do_copy_cx = rs. bcx ;
3119
+ lhs_do_copy_cx = copy_val ( lhs_do_copy_cx, INIT , dest_ptr_lhs_copy,
3120
+ lhs_val, unit_ty) ;
3111
3121
3112
3122
// Increment both pointers.
3113
3123
if ty:: type_has_dynamic_size ( bcx_tcx ( cx) , unit_ty) {
@@ -3133,10 +3143,8 @@ mod ivec {
3133
3143
next_cx. llbb ) ;
3134
3144
let dest_ptr_rhs_copy = rhs_do_copy_cx. build . Load ( dest_ptr_ptr) ;
3135
3145
let rhs_val = load_if_immediate ( rhs_do_copy_cx, rhs_ptr, unit_ty) ;
3136
- rs =
3137
- copy_val ( rhs_do_copy_cx, INIT , dest_ptr_rhs_copy, rhs_val,
3138
- unit_ty) ;
3139
- rhs_do_copy_cx = rs. bcx ;
3146
+ rhs_do_copy_cx = copy_val ( rhs_do_copy_cx, INIT , dest_ptr_rhs_copy,
3147
+ rhs_val, unit_ty) ;
3140
3148
3141
3149
// Increment both pointers.
3142
3150
if ty:: type_has_dynamic_size ( bcx_tcx ( cx) , unit_ty) {
@@ -3227,8 +3235,8 @@ fn trans_evec_add(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef, rhs: ValueRef)
3227
3235
-> result {
3228
3236
let r = alloc_ty ( cx, t) ;
3229
3237
let tmp = r. val ;
3230
- r = copy_val ( r. bcx , INIT , tmp, lhs, t) ;
3231
- let bcx = trans_evec_append ( r . bcx , t, tmp, rhs) . bcx ;
3238
+ let bcx = copy_val ( r. bcx , INIT , tmp, lhs, t) ;
3239
+ let bcx = trans_evec_append ( bcx, t, tmp, rhs) . bcx ;
3232
3240
tmp = load_if_immediate ( bcx, tmp, t) ;
3233
3241
add_clean_temp ( cx, tmp, t) ;
3234
3242
ret rslt( bcx, tmp) ;
@@ -3486,10 +3494,10 @@ fn trans_for(cx: &@block_ctxt, local: &@ast::local, seq: &@ast::expr,
3486
3494
outer_next_cx, "for loop scope" ) ;
3487
3495
cx. build . Br ( scope_cx. llbb ) ;
3488
3496
let local_res = alloc_local ( scope_cx, local) ;
3489
- let loc_r = copy_val ( local_res. bcx , INIT , local_res. val , curr, t) ;
3497
+ let bcx = copy_val ( local_res. bcx , INIT , local_res. val , curr, t) ;
3490
3498
add_clean ( scope_cx, local_res. val , t) ;
3491
3499
let bcx =
3492
- trans_alt:: bind_irrefutable_pat ( loc_r . bcx , local. node . pat ,
3500
+ trans_alt:: bind_irrefutable_pat ( bcx, local. node . pat ,
3493
3501
local_res. val , cx. fcx . lllocals ,
3494
3502
false ) ;
3495
3503
bcx = trans_block ( bcx, body, return ) . bcx ;
@@ -3587,8 +3595,7 @@ fn build_environment(bcx: @block_ctxt, lltydescs: [ValueRef],
3587
3595
GEP_tup_like ( bcx, bindings_ty, bindings. val , [ 0 , i as int ] ) ;
3588
3596
bcx = bound. bcx ;
3589
3597
if copying {
3590
- bcx =
3591
- move_val_if_temp ( bcx, INIT , bound. val , lv, bound_tys[ i] ) . bcx ;
3598
+ bcx = move_val_if_temp ( bcx, INIT , bound. val , lv, bound_tys[ i] ) ;
3592
3599
} else { bcx. build . Store ( lv. res . val , bound. val ) ; }
3593
3600
i += 1 u;
3594
3601
}
@@ -4548,7 +4555,7 @@ fn trans_arg_expr(cx: &@block_ctxt, arg: &ty::arg, lldestty0: TypeRef,
4548
4555
// Do nothing for temporaries, just give them to callee
4549
4556
} else if ty:: type_is_structural ( ccx. tcx , e_ty) {
4550
4557
let dst = alloc_ty ( bcx, e_ty) ;
4551
- bcx = copy_val ( dst. bcx , INIT , dst. val , val, e_ty) . bcx ;
4558
+ bcx = copy_val ( dst. bcx , INIT , dst. val , val, e_ty) ;
4552
4559
val = dst. val ;
4553
4560
add_clean_temp ( bcx, val, e_ty) ;
4554
4561
} else {
@@ -4797,7 +4804,7 @@ fn trans_tup(cx: &@block_ctxt, elts: &[@ast::expr], id: ast::node_id) ->
4797
4804
let src = trans_lval ( bcx, e) ;
4798
4805
bcx = src. res . bcx ;
4799
4806
let dst_res = GEP_tup_like ( bcx, t, tup_val, [ 0 , i] ) ;
4800
- bcx = move_val_if_temp ( dst_res. bcx , INIT , dst_res. val , src, e_ty) . bcx ;
4807
+ bcx = move_val_if_temp ( dst_res. bcx , INIT , dst_res. val , src, e_ty) ;
4801
4808
i += 1 ;
4802
4809
}
4803
4810
ret rslt( bcx, tup_val) ;
@@ -4891,7 +4898,7 @@ fn trans_ivec(bcx: @block_ctxt, args: &[@ast::expr], id: ast::node_id) ->
4891
4898
} else {
4892
4899
lleltptr = bcx. build . InBoundsGEP ( llfirsteltptr, [ C_uint ( i) ] ) ;
4893
4900
}
4894
- bcx = move_val_if_temp ( bcx, INIT , lleltptr, lv, unit_ty) . bcx ;
4901
+ bcx = move_val_if_temp ( bcx, INIT , lleltptr, lv, unit_ty) ;
4895
4902
i += 1 u;
4896
4903
}
4897
4904
ret rslt( bcx, llvecptr) ;
@@ -4926,19 +4933,16 @@ fn trans_rec(cx: &@block_ctxt, fields: &[ast::field],
4926
4933
if str:: eq ( f. node . ident , tf. ident ) {
4927
4934
expr_provided = true ;
4928
4935
let lv = trans_lval ( bcx, f. node . expr ) ;
4929
- bcx =
4930
- move_val_if_temp ( lv. res . bcx , INIT , dst_res. val , lv,
4931
- e_ty) . bcx ;
4936
+ bcx = move_val_if_temp ( lv. res . bcx , INIT , dst_res. val ,
4937
+ lv, e_ty) ;
4932
4938
break ;
4933
4939
}
4934
4940
}
4935
4941
if !expr_provided {
4936
4942
let src_res = GEP_tup_like ( bcx, t, base_val, [ 0 , i] ) ;
4937
4943
src_res =
4938
4944
rslt ( src_res. bcx , load_if_immediate ( bcx, src_res. val , e_ty) ) ;
4939
- bcx =
4940
- copy_val ( src_res. bcx , INIT , dst_res. val , src_res. val ,
4941
- e_ty) . bcx ;
4945
+ bcx = copy_val ( src_res. bcx , INIT , dst_res. val , src_res. val , e_ty) ;
4942
4946
}
4943
4947
i += 1 ;
4944
4948
}
@@ -5023,10 +5027,9 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
5023
5027
let t = ty:: expr_ty ( bcx_tcx ( cx) , src) ;
5024
5028
// FIXME: calculate copy init-ness in typestate.
5025
5029
5026
- let move_res =
5027
- move_val ( rhs_res. res . bcx , DROP_EXISTING , lhs_res. res . val , rhs_res,
5028
- t) ;
5029
- ret rslt( move_res. bcx , C_nil ( ) ) ;
5030
+ let bcx = move_val ( rhs_res. res . bcx , DROP_EXISTING , lhs_res. res . val ,
5031
+ rhs_res, t) ;
5032
+ ret rslt( bcx, C_nil ( ) ) ;
5030
5033
}
5031
5034
ast:: expr_assign ( dst, src) {
5032
5035
let lhs_res = trans_lval ( cx, dst) ;
@@ -5035,10 +5038,9 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
5035
5038
let rhs = trans_lval ( lhs_res. res . bcx , src) ;
5036
5039
let t = ty:: expr_ty ( bcx_tcx ( cx) , src) ;
5037
5040
// FIXME: calculate copy init-ness in typestate.
5038
- let copy_res =
5039
- move_val_if_temp ( rhs. res . bcx , DROP_EXISTING , lhs_res. res . val , rhs,
5040
- t) ;
5041
- ret rslt( copy_res. bcx , C_nil ( ) ) ;
5041
+ let bcx = move_val_if_temp ( rhs. res . bcx , DROP_EXISTING ,
5042
+ lhs_res. res . val , rhs, t) ;
5043
+ ret rslt( bcx, C_nil ( ) ) ;
5042
5044
}
5043
5045
ast:: expr_swap ( dst, src) {
5044
5046
let lhs_res = trans_lval ( cx, dst) ;
@@ -5083,10 +5085,9 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
5083
5085
trans_eager_binop ( rhs_res. bcx , op, lhs_val, t, rhs_res. val , t) ;
5084
5086
// FIXME: calculate copy init-ness in typestate.
5085
5087
// This is always a temporary, so can always be safely moved
5086
- let move_res =
5087
- move_val ( v. bcx , DROP_EXISTING , lhs_res. res . val ,
5088
- lval_val ( v. bcx , v. val ) , t) ;
5089
- ret rslt( move_res. bcx , C_nil ( ) ) ;
5088
+ let bcx = move_val ( v. bcx , DROP_EXISTING , lhs_res. res . val ,
5089
+ lval_val ( v. bcx , v. val ) , t) ;
5090
+ ret rslt( bcx, C_nil ( ) ) ;
5090
5091
}
5091
5092
ast:: expr_bind ( f, args) { ret trans_bind ( cx, f, args, e. id ) ; }
5092
5093
ast:: expr_call ( f, args) {
@@ -5425,9 +5426,9 @@ fn trans_ret(cx: &@block_ctxt, e: &option::t<@ast::expr>) -> result {
5425
5426
_ { false }
5426
5427
} ;
5427
5428
if is_local {
5428
- bcx = move_val ( bcx, INIT , cx. fcx . llretptr , lv, t) . bcx ;
5429
+ bcx = move_val ( bcx, INIT , cx. fcx . llretptr , lv, t) ;
5429
5430
} else {
5430
- bcx = move_val_if_temp ( bcx, INIT , cx. fcx . llretptr , lv, t) . bcx ;
5431
+ bcx = move_val_if_temp ( bcx, INIT , cx. fcx . llretptr , lv, t) ;
5431
5432
}
5432
5433
}
5433
5434
_ {
@@ -5476,11 +5477,11 @@ fn init_local(bcx: @block_ctxt, local: &@ast::local) -> result {
5476
5477
// the value.
5477
5478
ty = node_id_type ( bcx_ccx ( bcx) , init. expr . id ) ;
5478
5479
let sub = trans_lval ( bcx, init. expr ) ;
5479
- bcx = move_val_if_temp ( sub. res . bcx , INIT , llptr, sub, ty) . bcx ;
5480
+ bcx = move_val_if_temp ( sub. res . bcx , INIT , llptr, sub, ty) ;
5480
5481
}
5481
5482
ast:: init_move. {
5482
5483
let sub = trans_lval ( bcx, init. expr ) ;
5483
- bcx = move_val ( sub. res . bcx , INIT , llptr, sub, ty) . bcx ;
5484
+ bcx = move_val ( sub. res . bcx , INIT , llptr, sub, ty) ;
5484
5485
}
5485
5486
}
5486
5487
}
@@ -5750,7 +5751,7 @@ fn trans_block(cx: &@block_ctxt, b: &ast::blk, output: &out_method) ->
5750
5751
// The output method is to save the value at target,
5751
5752
// and we didn't pass it to the recursive trans_expr
5752
5753
// call.
5753
- bcx = move_val_if_temp ( bcx, INIT , target, lv, r_ty) . bcx ;
5754
+ bcx = move_val_if_temp ( bcx, INIT , target, lv, r_ty) ;
5754
5755
r = rslt ( bcx, C_nil ( ) ) ;
5755
5756
}
5756
5757
return . { }
@@ -6134,7 +6135,7 @@ fn trans_res_ctor(cx: @local_ctxt, sp: &span, dtor: &ast::_fn,
6134
6135
6135
6136
let dst = GEP_tup_like ( bcx, tup_t, llretptr, [ 0 , 1 ] ) ;
6136
6137
bcx = dst. bcx ;
6137
- bcx = copy_val ( bcx, INIT , dst. val , arg, arg_t) . bcx ;
6138
+ bcx = copy_val ( bcx, INIT , dst. val , arg, arg_t) ;
6138
6139
let flag = GEP_tup_like ( bcx, tup_t, llretptr, [ 0 , 0 ] ) ;
6139
6140
bcx = flag. bcx ;
6140
6141
bcx. build . Store ( C_int ( 1 ) , flag. val ) ;
@@ -6223,8 +6224,7 @@ fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
6223
6224
ty:: type_has_dynamic_size ( cx. ccx . tcx , arg_ty) {
6224
6225
llargval = llargptr;
6225
6226
} else { llargval = bcx. build . Load ( llargptr) ; }
6226
- rslt = copy_val ( bcx, INIT , lldestptr, llargval, arg_ty) ;
6227
- bcx = rslt. bcx ;
6227
+ bcx = copy_val ( bcx, INIT , lldestptr, llargval, arg_ty) ;
6228
6228
i += 1 u;
6229
6229
}
6230
6230
bcx = trans_block_cleanups ( bcx, find_scope_cx ( bcx) ) ;
0 commit comments