Skip to content

Commit

Permalink
Remove schedule_free_slice
Browse files Browse the repository at this point in the history
Nothing uses it anymore.
  • Loading branch information
michaelwu committed May 6, 2015
1 parent e6378cb commit bfdbda2
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions src/librustc_trans/trans/cleanup.rs
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

0 comments on commit bfdbda2

Please sign in to comment.