Skip to content

Commit 8718952

Browse files
committed
---
yaml --- r: 5114 b: refs/heads/master c: 458ac89 h: refs/heads/master v: v3
1 parent 7229c54 commit 8718952

File tree

5 files changed

+5
-90
lines changed

5 files changed

+5
-90
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: ad3dcc0689b87c32fe7142c49846be75ef516a81
2+
refs/heads/master: 458ac89894bce025553aeda1a9a991e1ca3c05ed

trunk/src/comp/back/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const tydesc_field_align: int = 2;
5252
const tydesc_field_take_glue: int = 3;
5353
const tydesc_field_drop_glue: int = 4;
5454
const tydesc_field_free_glue: int = 5;
55-
const tydesc_field_copy_glue: int = 6;
55+
const tydesc_field_unused: int = 6;
5656
const tydesc_field_sever_glue: int = 7;
5757
const tydesc_field_mark_glue: int = 8;
5858
const tydesc_field_is_stateful: int = 9;

trunk/src/comp/middle/trans.rs

+1-72
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,6 @@ fn declare_tydesc(cx: &@local_ctxt, sp: &span, t: ty::t, ty_params: &[uint])
11491149
mutable drop_glue: none::<ValueRef>,
11501150
mutable free_glue: none::<ValueRef>,
11511151
mutable cmp_glue: none::<ValueRef>,
1152-
mutable copy_glue: none::<ValueRef>,
11531152
ty_params: ty_params};
11541153
log ~"--- declare_tydesc " + ty_to_str(cx.ccx.tcx, t);
11551154
ret info;
@@ -1245,7 +1244,6 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
12451244
for each pair: @{key: ty::t, val: @tydesc_info} in ccx.tydescs.items() {
12461245
let glue_fn_ty = T_ptr(T_glue_fn(*ccx));
12471246
let cmp_fn_ty = T_ptr(T_cmp_glue_fn(*ccx));
1248-
let copy_fn_ty = T_ptr(T_copy_glue_fn(*ccx));
12491247
let ti = pair.val;
12501248
let take_glue =
12511249
alt { ti.take_glue } {
@@ -1267,11 +1265,6 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
12671265
none. { ccx.stats.n_null_glues += 1u; C_null(cmp_fn_ty) }
12681266
some(v) { ccx.stats.n_real_glues += 1u; v }
12691267
};
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-
};
12751268
12761269
let shape = shape::shape_of(ccx, pair.key);
12771270
let shape_tables =
@@ -1286,7 +1279,7 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
12861279
take_glue, // take_glue
12871280
drop_glue, // drop_glue
12881281
free_glue, // free_glue
1289-
copy_glue, // copy_glue
1282+
C_null(T_ptr(T_i8())), // unused
12901283
C_null(glue_fn_ty), // sever_glue
12911284
C_null(glue_fn_ty), // mark_glue
12921285
C_null(glue_fn_ty), // is_stateful
@@ -1304,14 +1297,6 @@ fn emit_tydescs(ccx: &@crate_ctxt) {
13041297
}
13051298
}
13061299
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-
13151300
fn make_take_glue(cx: &@block_ctxt, v: ValueRef, t: ty::t) {
13161301
let bcx = cx;
13171302
// 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,
18781863
lazily_emit_tydesc_glue(cx, abi::tydesc_field_drop_glue, static_ti);
18791864
lazily_emit_tydesc_glue(cx, abi::tydesc_field_free_glue, static_ti);
18801865
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);
18821866
}
18831867
18841868
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,
19581942
ty_to_str(bcx_tcx(cx), ti.ty)];
19591943
}
19601944
}
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-
}
19751945
}
19761946
}
19771947
}
@@ -2060,47 +2030,6 @@ fn call_cmp_glue(cx: &@block_ctxt, lhs: ValueRef, rhs: ValueRef, t: ty::t,
20602030
ret rslt(r.bcx, Load(r.bcx, llcmpresultptr));
20612031
}
20622032

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-
21042033
// Compares two values. Performs the simple scalar comparison if the types are
21052034
// scalar and calls to comparison glue otherwise.
21062035
fn compare(cx: &@block_ctxt, lhs: ValueRef, rhs: ValueRef, t: ty::t,

trunk/src/comp/middle/trans_common.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ type tydesc_info =
8787
mutable drop_glue: option::t<ValueRef>,
8888
mutable free_glue: option::t<ValueRef>,
8989
mutable cmp_glue: option::t<ValueRef>,
90-
mutable copy_glue: option::t<ValueRef>,
9190
ty_params: [uint]};
9291

9392
/*
@@ -620,14 +619,6 @@ fn T_cmp_glue_fn(cx: &crate_ctxt) -> TypeRef {
620619
ret t;
621620
}
622621

623-
fn T_copy_glue_fn(cx: &crate_ctxt) -> TypeRef {
624-
let s = ~"copy_glue_fn";
625-
if cx.tn.name_has_type(s) { ret cx.tn.get_type(s); }
626-
let t = T_tydesc_field(cx, abi::tydesc_field_copy_glue);
627-
cx.tn.associate(s, t);
628-
ret t;
629-
}
630-
631622
fn T_tydesc(taskptr_type: TypeRef) -> TypeRef {
632623
let tydesc = T_named_struct(~"tydesc");
633624
let tydescpp = T_ptr(T_ptr(tydesc));
@@ -638,13 +629,10 @@ fn T_tydesc(taskptr_type: TypeRef) -> TypeRef {
638629
let cmp_glue_fn_ty =
639630
T_ptr(T_fn([T_ptr(T_i1()), taskptr_type, T_ptr(tydesc), tydescpp,
640631
pvoid, pvoid, T_i8()], T_void()));
641-
let copy_glue_fn_ty =
642-
T_ptr(T_fn([T_ptr(T_nil()), taskptr_type, T_ptr(T_nil()), tydescpp,
643-
pvoid, pvoid], T_void()));
644632

645633
let elems =
646634
[tydescpp, T_int(), T_int(), glue_fn_ty, glue_fn_ty, glue_fn_ty,
647-
copy_glue_fn_ty, glue_fn_ty, glue_fn_ty, glue_fn_ty, cmp_glue_fn_ty,
635+
T_ptr(T_i8()), glue_fn_ty, glue_fn_ty, glue_fn_ty, cmp_glue_fn_ty,
648636
T_ptr(T_i8()), T_ptr(T_i8()), T_int(), T_int()];
649637
set_struct_body(tydesc, elems);
650638
ret tydesc;

trunk/src/rt/rust_internal.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ struct rust_timer {
257257

258258
typedef void CDECL (glue_fn)(void *, rust_task *, void *,
259259
const type_desc **, void *);
260-
typedef void CDECL (copy_glue_fn)(void *, rust_task *, void *,
261-
const type_desc **, void *, void *);
262260
typedef void CDECL (cmp_glue_fn)(void *, rust_task *, void *,
263261
const type_desc **,
264262
void *, void *, int8_t);
@@ -277,7 +275,7 @@ struct type_desc {
277275
glue_fn *take_glue;
278276
glue_fn *drop_glue;
279277
glue_fn *free_glue;
280-
copy_glue_fn *copy_glue;
278+
void *unused;
281279
glue_fn *sever_glue; // For GC.
282280
glue_fn *mark_glue; // For GC.
283281
uintptr_t is_stateful;

0 commit comments

Comments
 (0)