@@ -1149,7 +1149,6 @@ fn declare_tydesc(cx: &@local_ctxt, sp: &span, t: ty::t, ty_params: &[uint])
1149
1149
mutable drop_glue: none :: < ValueRef > ,
1150
1150
mutable free_glue: none :: < ValueRef > ,
1151
1151
mutable cmp_glue: none :: < ValueRef > ,
1152
- mutable copy_glue: none :: < ValueRef > ,
1153
1152
ty_params: ty_params} ;
1154
1153
log ~"--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t);
1155
1154
ret info;
@@ -1245,7 +1244,6 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
1245
1244
for each pair: @{key: ty::t, val: @tydesc_info} in ccx.tydescs.items() {
1246
1245
let glue_fn_ty = T_ptr(T_glue_fn(*ccx));
1247
1246
let cmp_fn_ty = T_ptr(T_cmp_glue_fn(*ccx));
1248
- let copy_fn_ty = T_ptr(T_copy_glue_fn(*ccx));
1249
1247
let ti = pair.val;
1250
1248
let take_glue =
1251
1249
alt { ti.take_glue } {
@@ -1267,11 +1265,6 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
1267
1265
none. { ccx.stats.n_null_glues += 1u; C_null(cmp_fn_ty) }
1268
1266
some(v) { ccx.stats.n_real_glues += 1u; v }
1269
1267
};
1270
- let copy_glue =
1271
- alt { ti.copy_glue } {
1272
- none. { ccx.stats.n_null_glues += 1u; C_null(copy_fn_ty) }
1273
- some(v) { ccx.stats.n_real_glues += 1u; v }
1274
- };
1275
1268
1276
1269
let shape = shape::shape_of(ccx, pair.key);
1277
1270
let shape_tables =
@@ -1286,7 +1279,7 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
1286
1279
take_glue, // take_glue
1287
1280
drop_glue, // drop_glue
1288
1281
free_glue, // free_glue
1289
- copy_glue , // copy_glue
1282
+ C_null(T_ptr(T_i8())) , // unused
1290
1283
C_null(glue_fn_ty), // sever_glue
1291
1284
C_null(glue_fn_ty), // mark_glue
1292
1285
C_null(glue_fn_ty), // is_stateful
@@ -1304,14 +1297,6 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
1304
1297
}
1305
1298
}
1306
1299
1307
- // NOTE this is currently just a complicated way to do memmove. I'm working on
1308
- // a representation of ivecs that will need pointers into itself, which must
1309
- // be adjusted when copying. Will flesh this out when the time comes.
1310
- fn make_copy_glue(cx: &@block_ctxt, src: ValueRef, dst: ValueRef, t: ty::t) {
1311
- let bcx = memmove_ty(cx, dst, src, t).bcx;
1312
- build_return(bcx);
1313
- }
1314
-
1315
1300
fn make_take_glue(cx: &@block_ctxt, v: ValueRef, t: ty::t) {
1316
1301
let bcx = cx;
1317
1302
// NB: v is an *alias* of type t here, not a direct value.
@@ -1878,7 +1863,6 @@ fn lazily_emit_all_tydesc_glue(cx: &@block_ctxt,
1878
1863
lazily_emit_tydesc_glue(cx, abi::tydesc_field_drop_glue, static_ti);
1879
1864
lazily_emit_tydesc_glue(cx, abi::tydesc_field_free_glue, static_ti);
1880
1865
lazily_emit_tydesc_glue(cx, abi::tydesc_field_cmp_glue, static_ti);
1881
- lazily_emit_tydesc_glue(cx, abi::tydesc_field_copy_glue, static_ti);
1882
1866
}
1883
1867
1884
1868
fn lazily_emit_all_generic_info_tydesc_glues(cx: &@block_ctxt,
@@ -1958,20 +1942,6 @@ fn lazily_emit_tydesc_glue(cx: &@block_ctxt, field: int,
1958
1942
ty_to_str ( bcx_tcx ( cx) , ti. ty ) ] ;
1959
1943
}
1960
1944
}
1961
- } else if field == abi:: tydesc_field_copy_glue {
1962
- alt { ti. copy_glue } {
1963
- some ( _) { }
1964
- none. {
1965
- let lcx = cx. fcx . lcx ;
1966
- let glue_fn =
1967
- declare_generic_glue ( lcx, ti. ty , T_copy_glue_fn ( * lcx. ccx ) ,
1968
- ~"copy") ;
1969
- ti. copy_glue = some ( glue_fn) ;
1970
- make_generic_glue ( lcx, cx. sp , ti. ty , glue_fn,
1971
- copy_helper ( make_copy_glue) ,
1972
- ti. ty_params , ~"copy") ;
1973
- }
1974
- }
1975
1945
}
1976
1946
}
1977
1947
}
@@ -2060,47 +2030,6 @@ fn call_cmp_glue(cx: &@block_ctxt, lhs: ValueRef, rhs: ValueRef, t: ty::t,
2060
2030
ret rslt( r. bcx , Load ( r. bcx , llcmpresultptr) ) ;
2061
2031
}
2062
2032
2063
- fn call_copy_glue ( cx : & @block_ctxt , dst : ValueRef , src : ValueRef , t : ty:: t ,
2064
- take : bool ) -> @block_ctxt {
2065
- // You can't call this on immediate types. Those are simply copied with
2066
- // Load/Store.
2067
- assert ! type_is_immediate( bcx_ccx( cx) , t) ;
2068
- let srcptr = BitCast ( cx, src, T_ptr ( T_i8 ( ) ) ) ;
2069
- let dstptr = BitCast ( cx, dst, T_ptr ( T_i8 ( ) ) ) ;
2070
- let ti = none;
2071
- let { bcx, val: lltydesc } =
2072
- get_tydesc ( cx, t, false , tps_normal, ti) . result ;
2073
- lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_copy_glue, ti) ;
2074
- let lltydescs = GEP
2075
- ( bcx, lltydesc, [ C_int ( 0 ) , C_int ( abi:: tydesc_field_first_param) ] ) ;
2076
- lltydescs = Load ( bcx, lltydescs) ;
2077
-
2078
- let llfn = alt ti {
2079
- none. {
2080
- Load ( bcx, GEP
2081
- ( bcx, lltydesc, [ C_int ( 0 ) , C_int ( abi:: tydesc_field_copy_glue) ] ) )
2082
- }
2083
- some ( sti) { option:: get ( sti. copy_glue ) }
2084
- } ;
2085
- Call ( bcx, llfn, [ C_null ( T_ptr ( T_nil ( ) ) ) , bcx. fcx . lltaskptr ,
2086
- C_null ( T_ptr ( T_nil ( ) ) ) , lltydescs, srcptr, dstptr] ) ;
2087
- if take {
2088
- lazily_emit_tydesc_glue ( cx, abi:: tydesc_field_take_glue, ti) ;
2089
- llfn = alt ti {
2090
- none. {
2091
- Load ( bcx, GEP ( bcx, lltydesc,
2092
- [ C_int ( 0 ) ,
2093
- C_int ( abi:: tydesc_field_take_glue) ] ) )
2094
- }
2095
- some ( sti) { option:: get ( sti. take_glue ) }
2096
- } ;
2097
- Call ( bcx, llfn, [ C_null ( T_ptr ( T_nil ( ) ) ) , bcx. fcx . lltaskptr ,
2098
- C_null ( T_ptr ( T_nil ( ) ) ) , lltydescs, dstptr] ) ;
2099
- }
2100
- ret bcx;
2101
- }
2102
-
2103
-
2104
2033
// Compares two values. Performs the simple scalar comparison if the types are
2105
2034
// scalar and calls to comparison glue otherwise.
2106
2035
fn compare ( cx : & @block_ctxt , lhs : ValueRef , rhs : ValueRef , t : ty:: t ,
0 commit comments