auto merge of #6178 : erickt/rust/remove-drop, r=graydon

This patch removes ty::LegacyDtor, which is no longer used.
This commit is contained in:
bors 2013-05-02 08:18:38 -07:00
commit 1c64f7a0f7
2 changed files with 7 additions and 20 deletions

View File

@ -443,11 +443,8 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) {
// Call the dtor if there is one // Call the dtor if there is one
match ty::ty_dtor(bcx.tcx(), did) { match ty::ty_dtor(bcx.tcx(), did) {
ty::NoDtor => bcx, ty::NoDtor => bcx,
ty::LegacyDtor(ref dt_id) => {
trans_struct_drop(bcx, t, v, *dt_id, did, substs, false)
}
ty::TraitDtor(ref dt_id) => { ty::TraitDtor(ref dt_id) => {
trans_struct_drop(bcx, t, v, *dt_id, did, substs, true) trans_struct_drop(bcx, t, v, *dt_id, did, substs)
} }
} }
} }
@ -461,8 +458,7 @@ pub fn trans_struct_drop(bcx: block,
v0: ValueRef, v0: ValueRef,
dtor_did: ast::def_id, dtor_did: ast::def_id,
class_did: ast::def_id, class_did: ast::def_id,
substs: &ty::substs, substs: &ty::substs)
take_ref: bool)
-> block { -> block {
let repr = adt::represent_type(bcx.ccx(), t); let repr = adt::represent_type(bcx.ccx(), t);
let drop_flag = adt::trans_drop_flag_ptr(bcx, repr, v0); let drop_flag = adt::trans_drop_flag_ptr(bcx, repr, v0);
@ -484,15 +480,10 @@ pub fn trans_struct_drop(bcx: block,
// (self) // (self)
assert!((params.len() == 2)); assert!((params.len() == 2));
// If we need to take a reference to the class (because it's using // Take a reference to the class (because it's using the Drop trait),
// the Drop trait), do so now. // do so now.
let llval; let llval = alloca(bcx, val_ty(v0));
if take_ref {
llval = alloca(bcx, val_ty(v0));
Store(bcx, v0, llval); Store(bcx, v0, llval);
} else {
llval = v0;
}
let self_arg = PointerCast(bcx, llval, params[1]); let self_arg = PointerCast(bcx, llval, params[1]);
let args = ~[C_null(T_ptr(T_i8())), self_arg]; let args = ~[C_null(T_ptr(T_i8())), self_arg];
@ -534,10 +525,7 @@ pub fn make_drop_glue(bcx: block, v0: ValueRef, t: ty::t) {
let tcx = bcx.tcx(); let tcx = bcx.tcx();
match ty::ty_dtor(tcx, did) { match ty::ty_dtor(tcx, did) {
ty::TraitDtor(dtor) => { ty::TraitDtor(dtor) => {
trans_struct_drop(bcx, t, v0, dtor, did, substs, true) trans_struct_drop(bcx, t, v0, dtor, did, substs)
}
ty::LegacyDtor(dtor) => {
trans_struct_drop(bcx, t, v0, dtor, did, substs, false)
} }
ty::NoDtor => { ty::NoDtor => {
// No dtor? Just the default case // No dtor? Just the default case

View File

@ -3728,7 +3728,6 @@ pub fn item_path_str(cx: ctxt, id: ast::def_id) -> ~str {
pub enum DtorKind { pub enum DtorKind {
NoDtor, NoDtor,
LegacyDtor(def_id),
TraitDtor(def_id) TraitDtor(def_id)
} }