@@ -1116,7 +1116,7 @@ fn declare_tydesc(cx: &@local_ctxt, sp: &span, t: &ty::t, ty_params: &[uint])
1116
1116
tydesc: gvar,
1117
1117
size: llsize,
1118
1118
align: llalign,
1119
- mutable copy_glue : none :: < ValueRef > ,
1119
+ mutable take_glue : none :: < ValueRef > ,
1120
1120
mutable drop_glue: none :: < ValueRef > ,
1121
1121
mutable free_glue: none :: < ValueRef > ,
1122
1122
mutable cmp_glue: none :: < ValueRef > ,
@@ -1202,8 +1202,8 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
1202
1202
let glue_fn_ty = T_ptr ( T_glue_fn ( * ccx) ) ;
1203
1203
let cmp_fn_ty = T_ptr ( T_cmp_glue_fn ( * ccx) ) ;
1204
1204
let ti = pair. val ;
1205
- let copy_glue =
1206
- alt { ti. copy_glue } {
1205
+ let take_glue =
1206
+ alt { ti. take_glue } {
1207
1207
none. { ccx . stats . n_null_glues += 1 u; C_null ( glue_fn_ty) }
1208
1208
some ( v) { ccx. stats . n_real_glues += 1 u; v }
1209
1209
} ;
@@ -1233,7 +1233,7 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
1233
1233
[ C_null ( T_ptr ( T_ptr ( ccx. tydesc_type ) ) ) ,
1234
1234
ti. size , // size
1235
1235
ti. align , // align
1236
- copy_glue , // copy_glue
1236
+ take_glue , // take_glue
1237
1237
drop_glue, // drop_glue
1238
1238
free_glue, // free_glue
1239
1239
C_null ( glue_fn_ty) , // sever_glue
@@ -1253,7 +1253,7 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
1253
1253
}
1254
1254
}
1255
1255
1256
- fn make_copy_glue ( cx : & @block_ctxt , v : ValueRef , t : & ty:: t ) {
1256
+ fn make_take_glue ( cx : & @block_ctxt , v : ValueRef , t : & ty:: t ) {
1257
1257
// NB: v is an *alias* of type t here, not a direct value.
1258
1258
1259
1259
let bcx;
@@ -1262,7 +1262,7 @@ fn make_copy_glue(cx: &@block_ctxt, v: ValueRef, t: &ty::t) {
1262
1262
bcx = incr_refcnt_of_boxed ( cx, cx. build . Load ( v) ) . bcx ;
1263
1263
} else if ty:: type_is_structural ( bcx_tcx ( cx) , t) {
1264
1264
bcx = duplicate_heap_parts_if_necessary ( cx, v, t) . bcx ;
1265
- bcx = iter_structural_ty ( bcx, v, t, bind copy_ty ( _, _, _) ) . bcx ;
1265
+ bcx = iter_structural_ty ( bcx, v, t, bind take_ty ( _, _, _) ) . bcx ;
1266
1266
} else { bcx = cx; }
1267
1267
1268
1268
build_return ( bcx) ;
@@ -1966,7 +1966,7 @@ fn iter_sequence(cx: @block_ctxt, v: ValueRef, t: &ty::t, f: &val_and_ty_fn)
1966
1966
1967
1967
fn lazily_emit_all_tydesc_glue ( cx : & @block_ctxt ,
1968
1968
static_ti : & option:: t < @tydesc_info > ) {
1969
- lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_copy_glue , static_ti) ;
1969
+ lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_take_glue , static_ti) ;
1970
1970
lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_drop_glue, static_ti) ;
1971
1971
lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_free_glue, static_ti) ;
1972
1972
lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_cmp_glue, static_ti) ;
@@ -1984,18 +1984,18 @@ fn lazily_emit_tydesc_glue(cx: &@block_ctxt, field: int,
1984
1984
alt static_ti {
1985
1985
none. { }
1986
1986
some ( ti) {
1987
- if field == abi:: tydesc_field_copy_glue {
1988
- alt { ti. copy_glue } {
1987
+ if field == abi:: tydesc_field_take_glue {
1988
+ alt { ti. take_glue } {
1989
1989
some ( _) { }
1990
1990
none. {
1991
1991
log #fmt [ "+++ lazily_emit_tydesc_glue TAKE %s" ,
1992
1992
ty_to_str ( bcx_tcx ( cx) , ti. ty ) ] ;
1993
1993
let lcx = cx. fcx . lcx ;
1994
1994
let glue_fn =
1995
1995
declare_generic_glue ( lcx, ti. ty , T_glue_fn ( * lcx. ccx ) ,
1996
- "copy " ) ;
1997
- ti. copy_glue = some :: < ValueRef > ( glue_fn) ;
1998
- make_generic_glue ( lcx, cx. sp , ti. ty , glue_fn, make_copy_glue ,
1996
+ "take " ) ;
1997
+ ti. take_glue = some :: < ValueRef > ( glue_fn) ;
1998
+ make_generic_glue ( lcx, cx. sp , ti. ty , glue_fn, make_take_glue ,
1999
1999
ti. ty_params , "take" ) ;
2000
2000
log #fmt[ "--- lazily_emit_tydesc_glue TAKE %s" ,
2001
2001
ty_to_str ( bcx_tcx ( cx) , ti. ty ) ] ;
@@ -2059,8 +2059,8 @@ fn call_tydesc_glue_full(cx: &@block_ctxt, v: ValueRef, tydesc: ValueRef,
2059
2059
alt static_ti {
2060
2060
none. { /* no-op */ }
2061
2061
some( sti) {
2062
- if field == abi:: tydesc_field_copy_glue {
2063
- static_glue_fn = sti. copy_glue ;
2062
+ if field == abi:: tydesc_field_take_glue {
2063
+ static_glue_fn = sti. take_glue ;
2064
2064
} else if field == abi:: tydesc_field_drop_glue {
2065
2065
static_glue_fn = sti. drop_glue ;
2066
2066
} else if field == abi:: tydesc_field_free_glue {
@@ -2147,10 +2147,10 @@ fn compare(cx: &@block_ctxt, lhs: ValueRef, rhs: ValueRef, t: &ty::t,
2147
2147
ret call_cmp_glue ( cx, lhs, rhs, t, llop) ;
2148
2148
}
2149
2149
2150
- fn copy_ty ( cx : & @block_ctxt , v : ValueRef , t : ty:: t ) -> result {
2150
+ fn take_ty ( cx : & @block_ctxt , v : ValueRef , t : ty:: t ) -> result {
2151
2151
if ty:: type_has_pointers ( bcx_tcx ( cx) , t) ||
2152
2152
ty:: type_owns_heap_mem ( bcx_tcx ( cx) , t) {
2153
- ret call_tydesc_glue ( cx, v, t, abi:: tydesc_field_copy_glue ) ;
2153
+ ret call_tydesc_glue ( cx, v, t, abi:: tydesc_field_take_glue ) ;
2154
2154
}
2155
2155
ret rslt( cx, C_nil ( ) ) ;
2156
2156
}
@@ -2257,7 +2257,7 @@ fn copy_val(cx: &@block_ctxt, action: copy_action, dst: ValueRef,
2257
2257
if action == DROP_EXISTING {
2258
2258
bcx = drop_ty ( cx, cx. build . Load ( dst) , t) . bcx ;
2259
2259
} else { bcx = cx; }
2260
- bcx = copy_ty ( bcx, src, t) . bcx ;
2260
+ bcx = take_ty ( bcx, src, t) . bcx ;
2261
2261
ret rslt( bcx, bcx. build . Store ( src, dst) ) ;
2262
2262
} else if ty:: type_is_structural ( ccx. tcx , t) ||
2263
2263
ty:: type_has_dynamic_size ( ccx. tcx , t) {
@@ -2273,7 +2273,7 @@ fn copy_val(cx: &@block_ctxt, action: copy_action, dst: ValueRef,
2273
2273
do_copy_cx = drop_ty ( do_copy_cx, dst, t) . bcx ;
2274
2274
}
2275
2275
do_copy_cx = memmove_ty ( do_copy_cx, dst, src, t) . bcx ;
2276
- do_copy_cx = copy_ty ( do_copy_cx, dst, t) . bcx ;
2276
+ do_copy_cx = take_ty ( do_copy_cx, dst, t) . bcx ;
2277
2277
do_copy_cx. build . Br ( next_cx. llbb ) ;
2278
2278
2279
2279
ret rslt( next_cx, C_nil ( ) ) ;
@@ -2526,7 +2526,7 @@ fn trans_evec_append(cx: &@block_ctxt, t: &ty::t, lhs: ValueRef,
2526
2526
bcx = llvec_tydesc. bcx ;
2527
2527
ti = none :: < @tydesc_info > ;
2528
2528
let llelt_tydesc = get_tydesc ( bcx, elt_ty, false , ti) . result ;
2529
- lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_copy_glue , ti) ;
2529
+ lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_take_glue , ti) ;
2530
2530
lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_drop_glue, ti) ;
2531
2531
lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_free_glue, ti) ;
2532
2532
bcx = llelt_tydesc. bcx ;
@@ -2784,7 +2784,7 @@ mod ivec {
2784
2784
bcx = rs. bcx ;
2785
2785
rs = get_tydesc ( bcx, unit_ty, false , no_tydesc_info) . result ;
2786
2786
bcx = rs. bcx ;
2787
- lazily_emit_tydesc_glue ( bcx, abi:: tydesc_field_copy_glue , none) ;
2787
+ lazily_emit_tydesc_glue ( bcx, abi:: tydesc_field_take_glue , none) ;
2788
2788
lazily_emit_tydesc_glue ( bcx, abi:: tydesc_field_drop_glue, none) ;
2789
2789
lazily_emit_tydesc_glue ( bcx, abi:: tydesc_field_free_glue, none) ;
2790
2790
let rhs_len_and_data = get_len_and_data ( bcx, rhs, unit_ty) ;
@@ -3076,7 +3076,7 @@ mod ivec {
3076
3076
}
3077
3077
3078
3078
// NB: This does *not* adjust reference counts. The caller must have done
3079
- // this via copy_ty () beforehand.
3079
+ // this via take_ty () beforehand.
3080
3080
fn duplicate_heap_part ( cx : & @block_ctxt , orig_vptr : ValueRef ,
3081
3081
unit_ty : ty:: t ) -> result {
3082
3082
// Cast to an opaque interior vector if we can't trust the pointer
@@ -4474,7 +4474,7 @@ fn trans_arg_expr(cx: &@block_ctxt, arg: &ty::arg, lldestty0: TypeRef,
4474
4474
if lv. is_mem {
4475
4475
val = load_if_immediate ( bcx, val, e_ty) ;
4476
4476
}
4477
- bcx = copy_ty ( bcx, val, e_ty) . bcx ;
4477
+ bcx = take_ty ( bcx, val, e_ty) . bcx ;
4478
4478
add_clean_temp ( bcx, val, e_ty) ;
4479
4479
}
4480
4480
} else if type_is_immediate ( ccx, e_ty) && !lv. is_mem {
@@ -5833,7 +5833,7 @@ fn copy_args_to_allocas(fcx: @fn_ctxt, scope: @block_ctxt,
5833
5833
// Args that are locally assigned to need to do a local
5834
5834
// take/drop
5835
5835
if fcx. lcx . ccx . mut_map . contains_key ( aarg. id ) {
5836
- bcx = copy_ty ( bcx, aval, arg_ty) . bcx ;
5836
+ bcx = take_ty ( bcx, aval, arg_ty) . bcx ;
5837
5837
add_clean ( scope, addr, arg_ty) ;
5838
5838
}
5839
5839
}
0 commit comments