mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
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:
parent
6da319f635
commit
7d38f4a611
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,6 @@ impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators {
|
||||
}
|
||||
}
|
||||
|
||||
simplify::remove_dead_blocks(tcx, body)
|
||||
simplify::remove_dead_blocks(body)
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -65,7 +65,7 @@ impl MirPass<'_> for UnreachablePropagation {
|
||||
}
|
||||
|
||||
if replaced {
|
||||
simplify::remove_dead_blocks(tcx, body);
|
||||
simplify::remove_dead_blocks(body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user