Remove unused TyCtxt from remove_dead_blocks

This context was only needed by code for processing coverage statements, which
has been removed.
This commit is contained in:
Zalathar 2023-09-07 21:57:24 +10:00
parent 6da319f635
commit 7d38f4a611
7 changed files with 9 additions and 9 deletions

View File

@ -113,6 +113,6 @@ impl<'tcx> MirPass<'tcx> for AbortUnwindingCalls {
}
// We may have invalidated some `cleanup` blocks so clean those up now.
super::simplify::remove_dead_blocks(tcx, body);
super::simplify::remove_dead_blocks(body);
}
}

View File

@ -244,7 +244,7 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
if round_count != 0 {
// Merging can introduce overlap between moved arguments and/or call destination in an
// unreachable code, which validator considers to be ill-formed.
remove_dead_blocks(tcx, body);
remove_dead_blocks(body);
}
trace!(round_count);

View File

@ -1088,7 +1088,7 @@ fn create_generator_drop_shim<'tcx>(
// Make sure we remove dead blocks to remove
// unrelated code from the resume part of the function
simplify::remove_dead_blocks(tcx, &mut body);
simplify::remove_dead_blocks(&mut body);
// Update the body's def to become the drop glue.
// This needs to be updated before the AbortUnwindingCalls pass.
@ -1276,7 +1276,7 @@ fn create_generator_resume_function<'tcx>(
// Make sure we remove dead blocks to remove
// unrelated code from the drop part of the function
simplify::remove_dead_blocks(tcx, body);
simplify::remove_dead_blocks(body);
pm::run_passes_no_validate(tcx, body, &[&abort_unwinding_calls::AbortUnwindingCalls], None);

View File

@ -63,7 +63,7 @@ impl<'tcx> MirPass<'tcx> for Inline {
if inline(tcx, body) {
debug!("running simplify cfg on {:?}", body.source);
CfgSimplifier::new(body).simplify();
remove_dead_blocks(tcx, body);
remove_dead_blocks(body);
deref_finder(tcx, body);
}
}

View File

@ -38,6 +38,6 @@ impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators {
}
}
simplify::remove_dead_blocks(tcx, body)
simplify::remove_dead_blocks(body)
}
}

View File

@ -66,7 +66,7 @@ impl SimplifyCfg {
pub fn simplify_cfg<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
CfgSimplifier::new(body).simplify();
remove_duplicate_unreachable_blocks(tcx, body);
remove_dead_blocks(tcx, body);
remove_dead_blocks(body);
// FIXME: Should probably be moved into some kind of pass manager
body.basic_blocks_mut().raw.shrink_to_fit();
@ -335,7 +335,7 @@ pub fn remove_duplicate_unreachable_blocks<'tcx>(tcx: TyCtxt<'tcx>, body: &mut B
}
}
pub fn remove_dead_blocks<'tcx>(_tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
pub fn remove_dead_blocks(body: &mut Body<'_>) {
let reachable = traversal::reachable_as_bitset(body);
let num_blocks = body.basic_blocks.len();
if num_blocks == reachable.count() {

View File

@ -65,7 +65,7 @@ impl MirPass<'_> for UnreachablePropagation {
}
if replaced {
simplify::remove_dead_blocks(tcx, body);
simplify::remove_dead_blocks(body);
}
}
}