Skip to content

Commit c2e20fd

Browse files
committed
Remove unused TyCtxt from remove_dead_blocks
This context was only needed by code for processing coverage statements, which has been removed.
1 parent 4ad6814 commit c2e20fd

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiler/rustc_mir_transform/src/abort_unwinding_calls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,6 @@ impl<'tcx> MirPass<'tcx> for AbortUnwindingCalls {
113113
}
114114

115115
// We may have invalidated some `cleanup` blocks so clean those up now.
116-
super::simplify::remove_dead_blocks(tcx, body);
116+
super::simplify::remove_dead_blocks(body);
117117
}
118118
}

compiler/rustc_mir_transform/src/dest_prop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
244244
if round_count != 0 {
245245
// Merging can introduce overlap between moved arguments and/or call destination in an
246246
// unreachable code, which validator considers to be ill-formed.
247-
remove_dead_blocks(tcx, body);
247+
remove_dead_blocks(body);
248248
}
249249

250250
trace!(round_count);

compiler/rustc_mir_transform/src/generator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ fn create_generator_drop_shim<'tcx>(
10881088

10891089
// Make sure we remove dead blocks to remove
10901090
// unrelated code from the resume part of the function
1091-
simplify::remove_dead_blocks(tcx, &mut body);
1091+
simplify::remove_dead_blocks(&mut body);
10921092

10931093
// Update the body's def to become the drop glue.
10941094
// This needs to be updated before the AbortUnwindingCalls pass.
@@ -1276,7 +1276,7 @@ fn create_generator_resume_function<'tcx>(
12761276

12771277
// Make sure we remove dead blocks to remove
12781278
// unrelated code from the drop part of the function
1279-
simplify::remove_dead_blocks(tcx, body);
1279+
simplify::remove_dead_blocks(body);
12801280

12811281
pm::run_passes_no_validate(tcx, body, &[&abort_unwinding_calls::AbortUnwindingCalls], None);
12821282

compiler/rustc_mir_transform/src/inline.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'tcx> MirPass<'tcx> for Inline {
6363
if inline(tcx, body) {
6464
debug!("running simplify cfg on {:?}", body.source);
6565
CfgSimplifier::new(body).simplify();
66-
remove_dead_blocks(tcx, body);
66+
remove_dead_blocks(body);
6767
deref_finder(tcx, body);
6868
}
6969
}

compiler/rustc_mir_transform/src/multiple_return_terminators.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators {
3838
}
3939
}
4040

41-
simplify::remove_dead_blocks(tcx, body)
41+
simplify::remove_dead_blocks(body)
4242
}
4343
}

compiler/rustc_mir_transform/src/simplify.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl SimplifyCfg {
6666
pub fn simplify_cfg<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
6767
CfgSimplifier::new(body).simplify();
6868
remove_duplicate_unreachable_blocks(tcx, body);
69-
remove_dead_blocks(tcx, body);
69+
remove_dead_blocks(body);
7070

7171
// FIXME: Should probably be moved into some kind of pass manager
7272
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
335335
}
336336
}
337337

338-
pub fn remove_dead_blocks<'tcx>(_tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
338+
pub fn remove_dead_blocks(body: &mut Body<'_>) {
339339
let reachable = traversal::reachable_as_bitset(body);
340340
let num_blocks = body.basic_blocks.len();
341341
if num_blocks == reachable.count() {

compiler/rustc_mir_transform/src/unreachable_prop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl MirPass<'_> for UnreachablePropagation {
6161
}
6262

6363
if replaced {
64-
simplify::remove_dead_blocks(tcx, body);
64+
simplify::remove_dead_blocks(body);
6565
}
6666
}
6767
}

0 commit comments

Comments
 (0)