@@ -86,7 +86,7 @@ type tydesc_info =
86
86
ValueRef tydesc,
87
87
ValueRef size,
88
88
ValueRef align,
89
- mutable option:: t[ ValueRef ] take_glue ,
89
+ mutable option:: t[ ValueRef ] copy_glue ,
90
90
mutable option:: t[ ValueRef ] drop_glue ,
91
91
mutable option:: t[ ValueRef ] free_glue ,
92
92
mutable option:: t[ ValueRef ] cmp_glue ,
@@ -506,7 +506,7 @@ fn T_tydesc(&type_names tn) -> TypeRef {
506
506
T_struct ( [ tydescpp, // first_param
507
507
T_int ( ) , // size
508
508
T_int ( ) , // align
509
- glue_fn_ty, // take_glue
509
+ glue_fn_ty, // copy_glue
510
510
glue_fn_ty, // drop_glue
511
511
glue_fn_ty, // free_glue
512
512
glue_fn_ty, // sever_glue
@@ -1797,7 +1797,7 @@ fn declare_tydesc(&@local_ctxt cx, &span sp, &ty::t t, vec[uint] ty_params) ->
1797
1797
tydesc=gvar,
1798
1798
size=llsize,
1799
1799
align=llalign,
1800
- mutable take_glue =none[ ValueRef ] ,
1800
+ mutable copy_glue =none[ ValueRef ] ,
1801
1801
mutable drop_glue=none[ ValueRef ] ,
1802
1802
mutable free_glue=none[ ValueRef ] ,
1803
1803
mutable cmp_glue=none[ ValueRef ] ,
@@ -1874,8 +1874,8 @@ fn emit_tydescs(&@crate_ctxt ccx) {
1874
1874
auto glue_fn_ty = T_ptr ( T_glue_fn ( ccx. tn) ) ;
1875
1875
auto cmp_fn_ty = T_ptr ( T_cmp_glue_fn ( ccx. tn) ) ;
1876
1876
auto ti = pair. _1;
1877
- auto take_glue =
1878
- alt ( { ti. take_glue } ) {
1877
+ auto copy_glue =
1878
+ alt ( { ti. copy_glue } ) {
1879
1879
case ( none) {
1880
1880
ccx. stats. n_null_glues += 1 u;
1881
1881
C_null ( glue_fn_ty)
@@ -1908,7 +1908,7 @@ fn emit_tydescs(&@crate_ctxt ccx) {
1908
1908
} ;
1909
1909
auto tydesc =
1910
1910
C_struct ( [ C_null ( T_ptr ( T_ptr ( T_tydesc ( ccx. tn) ) ) ) , ti. size,
1911
- ti. align, take_glue , // take_glue
1911
+ ti. align, copy_glue , // copy_glue
1912
1912
drop_glue, // drop_glue
1913
1913
free_glue, // free_glue
1914
1914
C_null ( glue_fn_ty) , // sever_glue
@@ -1925,14 +1925,14 @@ fn emit_tydescs(&@crate_ctxt ccx) {
1925
1925
}
1926
1926
}
1927
1927
1928
- fn make_take_glue ( & @block_ctxt cx, ValueRef v, & ty:: t t) {
1928
+ fn make_copy_glue ( & @block_ctxt cx, ValueRef v, & ty:: t t) {
1929
1929
// NB: v is an *alias* of type t here, not a direct value.
1930
1930
1931
1931
auto bcx;
1932
1932
if ( ty:: type_is_boxed( cx. fcx. lcx. ccx. tcx, t) ) {
1933
1933
bcx = incr_refcnt_of_boxed( cx, cx. build. Load ( v) ) . bcx;
1934
1934
} else if ( ty:: type_is_structural( cx. fcx. lcx. ccx. tcx, t) ) {
1935
- bcx = iter_structural_ty( cx, v, t, bind take_ty ( _, _, _) ) . bcx;
1935
+ bcx = iter_structural_ty( cx, v, t, bind copy_ty ( _, _, _) ) . bcx;
1936
1936
} else { bcx = cx; }
1937
1937
bcx. build. RetVoid ( ) ;
1938
1938
}
@@ -2839,7 +2839,7 @@ fn iter_sequence(@block_ctxt cx, ValueRef v, &ty::t t, &val_and_ty_fn f) ->
2839
2839
2840
2840
fn lazily_emit_all_tydesc_glue( & @block_ctxt cx,
2841
2841
& option:: t[ @tydesc_info] static_ti) {
2842
- lazily_emit_tydesc_glue( cx, abi:: tydesc_field_take_glue , static_ti) ;
2842
+ lazily_emit_tydesc_glue( cx, abi:: tydesc_field_copy_glue , static_ti) ;
2843
2843
lazily_emit_tydesc_glue( cx, abi:: tydesc_field_drop_glue, static_ti) ;
2844
2844
lazily_emit_tydesc_glue( cx, abi:: tydesc_field_free_glue, static_ti) ;
2845
2845
lazily_emit_tydesc_glue( cx, abi:: tydesc_field_cmp_glue, static_ti) ;
@@ -2857,8 +2857,8 @@ fn lazily_emit_tydesc_glue(&@block_ctxt cx, int field,
2857
2857
alt ( static_ti) {
2858
2858
case ( none) { }
2859
2859
case ( some( ?ti) ) {
2860
- if ( field == abi:: tydesc_field_take_glue ) {
2861
- alt ( { ti. take_glue } ) {
2860
+ if ( field == abi:: tydesc_field_copy_glue ) {
2861
+ alt ( { ti. copy_glue } ) {
2862
2862
case ( some( _) ) { }
2863
2863
case ( none) {
2864
2864
log #fmt( "+++ lazily_emit_tydesc_glue TAKE %s",
@@ -2867,9 +2867,9 @@ fn lazily_emit_tydesc_glue(&@block_ctxt cx, int field,
2867
2867
auto glue_fn =
2868
2868
declare_generic_glue( lcx, ti. ty,
2869
2869
T_glue_fn ( lcx. ccx. tn) ,
2870
- "take ") ;
2871
- ti. take_glue = some[ ValueRef ] ( glue_fn) ;
2872
- auto tg = make_take_glue ;
2870
+ "copy ") ;
2871
+ ti. copy_glue = some[ ValueRef ] ( glue_fn) ;
2872
+ auto tg = make_copy_glue ;
2873
2873
make_generic_glue( lcx, cx. sp, ti. ty, glue_fn,
2874
2874
mgghf_single( tg) , ti. ty_params) ;
2875
2875
log #fmt( "--- lazily_emit_tydesc_glue TAKE %s",
@@ -2945,8 +2945,8 @@ fn call_tydesc_glue_full(&@block_ctxt cx, ValueRef v, ValueRef tydesc,
2945
2945
alt ( static_ti) {
2946
2946
case ( none) { /* no-op */ }
2947
2947
case ( some( ?sti) ) {
2948
- if ( field == abi:: tydesc_field_take_glue ) {
2949
- static_glue_fn = sti. take_glue ;
2948
+ if ( field == abi:: tydesc_field_copy_glue ) {
2949
+ static_glue_fn = sti. copy_glue ;
2950
2950
} else if ( field == abi:: tydesc_field_drop_glue) {
2951
2951
static_glue_fn = sti. drop_glue;
2952
2952
} else if ( field == abi:: tydesc_field_free_glue) {
@@ -3053,9 +3053,9 @@ fn compare(&@block_ctxt cx, ValueRef lhs, ValueRef rhs, &ty::t t,
3053
3053
ret call_cmp_glue( cx, lhs, rhs, t, llop) ;
3054
3054
}
3055
3055
3056
- fn take_ty ( & @block_ctxt cx, ValueRef v, ty:: t t) -> result {
3056
+ fn copy_ty ( & @block_ctxt cx, ValueRef v, ty:: t t) -> result {
3057
3057
if ( ty:: type_has_pointers( cx. fcx. lcx. ccx. tcx, t) ) {
3058
- ret call_tydesc_glue( cx, v, t, abi:: tydesc_field_take_glue ) ;
3058
+ ret call_tydesc_glue( cx, v, t, abi:: tydesc_field_copy_glue ) ;
3059
3059
}
3060
3060
ret rslt( cx, C_nil ( ) ) ;
3061
3061
}
@@ -3168,14 +3168,14 @@ fn copy_val(&@block_ctxt cx, copy_action action, ValueRef dst, ValueRef src,
3168
3168
ty:: type_is_bot( ccx. tcx, t) ) {
3169
3169
ret rslt( cx, C_nil ( ) ) ;
3170
3170
} else if ( ty:: type_is_boxed( ccx. tcx, t) ) {
3171
- auto r = take_ty ( cx, src, t) ;
3171
+ auto r = copy_ty ( cx, src, t) ;
3172
3172
if ( action == DROP_EXISTING ) {
3173
3173
r = drop_ty( r. bcx, r. bcx. build. Load ( dst) , t) ;
3174
3174
}
3175
3175
ret rslt( r. bcx, r. bcx. build. Store ( src, dst) ) ;
3176
3176
} else if ( ty:: type_is_structural( ccx. tcx, t) ||
3177
3177
ty:: type_has_dynamic_size( ccx. tcx, t) ) {
3178
- auto r = take_ty ( cx, src, t) ;
3178
+ auto r = copy_ty ( cx, src, t) ;
3179
3179
if ( action == DROP_EXISTING ) { r = drop_ty( r. bcx, dst, t) ; }
3180
3180
r = memmove_ty( r. bcx, dst, src, t) ;
3181
3181
if ( ty:: type_owns_heap_mem( ccx. tcx, t) ) {
@@ -3376,7 +3376,7 @@ fn trans_vec_append(&@block_ctxt cx, &ty::t t, ValueRef lhs, ValueRef rhs) ->
3376
3376
bcx = llvec_tydesc. bcx;
3377
3377
ti = none[ @tydesc_info] ;
3378
3378
auto llelt_tydesc = get_tydesc( bcx, elt_ty, false, ti) ;
3379
- lazily_emit_tydesc_glue( cx, abi:: tydesc_field_take_glue , ti) ;
3379
+ lazily_emit_tydesc_glue( cx, abi:: tydesc_field_copy_glue , ti) ;
3380
3380
lazily_emit_tydesc_glue( cx, abi:: tydesc_field_drop_glue, ti) ;
3381
3381
lazily_emit_tydesc_glue( cx, abi:: tydesc_field_free_glue, ti) ;
3382
3382
bcx = llelt_tydesc. bcx;
@@ -3663,7 +3663,7 @@ mod ivec {
3663
3663
rs = get_tydesc( bcx, unit_ty, false, no_tydesc_info) ;
3664
3664
auto unit_tydesc = rs. val;
3665
3665
bcx = rs. bcx;
3666
- lazily_emit_tydesc_glue( bcx, abi:: tydesc_field_take_glue , none) ;
3666
+ lazily_emit_tydesc_glue( bcx, abi:: tydesc_field_copy_glue , none) ;
3667
3667
lazily_emit_tydesc_glue( bcx, abi:: tydesc_field_drop_glue, none) ;
3668
3668
lazily_emit_tydesc_glue( bcx, abi:: tydesc_field_free_glue, none) ;
3669
3669
auto rhs_len_and_data = get_len_and_data( bcx, rhs, unit_ty) ;
@@ -3950,7 +3950,7 @@ mod ivec {
3950
3950
}
3951
3951
3952
3952
// NB: This does *not* adjust reference counts. The caller must have done
3953
- // this via take_ty () beforehand.
3953
+ // this via copy_ty () beforehand.
3954
3954
fn duplicate_heap_part( & @block_ctxt cx, ValueRef orig_vptr,
3955
3955
ty:: t unit_ty) -> result {
3956
3956
// Cast to an opaque interior vector if we can't trust the pointer
@@ -5160,9 +5160,9 @@ fn trans_bind_thunk(&@local_ctxt cx, &span sp, &ty::t incoming_fty,
5160
5160
if ( out_arg. mode == ty:: mo_val) {
5161
5161
if ( type_is_immediate( cx. ccx, e_ty) ) {
5162
5162
val = bcx. build. Load ( val) ;
5163
- bcx = take_ty ( bcx, val, e_ty) . bcx;
5163
+ bcx = copy_ty ( bcx, val, e_ty) . bcx;
5164
5164
} else {
5165
- bcx = take_ty ( bcx, val, e_ty) . bcx;
5165
+ bcx = copy_ty ( bcx, val, e_ty) . bcx;
5166
5166
val = bcx. build. Load ( val) ;
5167
5167
}
5168
5168
} else if ( ty:: type_contains_params( cx. ccx. tcx, out_arg. ty) ) {
@@ -5401,7 +5401,7 @@ fn trans_arg_expr(&@block_ctxt cx, &ty::arg arg, TypeRef lldestty0,
5401
5401
val = do_spill( lv. res. bcx, lv. res. val) ;
5402
5402
}
5403
5403
} else { auto re = trans_expr( bcx, e) ; val = re. val; bcx = re. bcx; }
5404
- if ( arg. mode == ty:: mo_val) { bcx = take_ty ( bcx, val, e_ty) . bcx; }
5404
+ if ( arg. mode == ty:: mo_val) { bcx = copy_ty ( bcx, val, e_ty) . bcx; }
5405
5405
if ( ty:: type_is_bot( cx. fcx. lcx. ccx. tcx, e_ty) ) {
5406
5406
// For values of type _|_, we generate an
5407
5407
// "undef" value, as such a value should never
0 commit comments