Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions src/librustc_trans/trans/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,23 +507,6 @@ impl<'blk, 'tcx> CleanupMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx> {
self.schedule_clean(cleanup_scope, drop as CleanupObj);
}

/// Schedules a call to `free(val)`. Note that this is a shallow operation.
fn schedule_free_slice(&self,
cleanup_scope: ScopeId,
val: ValueRef,
size: ValueRef,
align: ValueRef,
heap: Heap) {
let drop = box FreeSlice { ptr: val, size: size, align: align, heap: heap };

debug!("schedule_free_slice({:?}, val={}, heap={:?})",
cleanup_scope,
self.ccx.tn().val_to_string(val),
heap);

self.schedule_clean(cleanup_scope, drop as CleanupObj);
}

fn schedule_clean(&self,
cleanup_scope: ScopeId,
cleanup: CleanupObj<'tcx>) {
Expand Down Expand Up @@ -1106,43 +1089,6 @@ impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> {
}
}

#[derive(Copy, Clone)]
pub struct FreeSlice {
ptr: ValueRef,
size: ValueRef,
align: ValueRef,
heap: Heap,
}

impl<'tcx> Cleanup<'tcx> for FreeSlice {
fn must_unwind(&self) -> bool {
true
}

fn clean_on_unwind(&self) -> bool {
true
}

fn is_lifetime_end(&self) -> bool {
false
}

fn trans<'blk>(&self,
bcx: Block<'blk, 'tcx>,
debug_loc: DebugLoc)
-> Block<'blk, 'tcx> {
match self.heap {
HeapExchange => {
glue::trans_exchange_free_dyn(bcx,
self.ptr,
self.size,
self.align,
debug_loc)
}
}
}
}

#[derive(Copy, Clone)]
pub struct LifetimeEnd {
ptr: ValueRef,
Expand Down Expand Up @@ -1253,12 +1199,6 @@ pub trait CleanupMethods<'blk, 'tcx> {
val: ValueRef,
heap: Heap,
content_ty: Ty<'tcx>);
fn schedule_free_slice(&self,
cleanup_scope: ScopeId,
val: ValueRef,
size: ValueRef,
align: ValueRef,
heap: Heap);
fn schedule_clean(&self,
cleanup_scope: ScopeId,
cleanup: CleanupObj<'tcx>);
Expand Down