Skip to content

Commit 0475c36

Browse files
Add pass names to some common dataflow analyses
1 parent 8e3ce43 commit 0475c36

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

compiler/rustc_mir/src/borrow_check/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ fn do_mir_borrowck<'a, 'tcx>(
205205

206206
let mut flow_inits = MaybeInitializedPlaces::new(tcx, &body, &mdpe)
207207
.into_engine(tcx, &body, def.did.to_def_id())
208+
.pass_name("borrowck")
208209
.iterate_to_fixpoint()
209210
.into_results_cursor(&body);
210211

@@ -264,12 +265,15 @@ fn do_mir_borrowck<'a, 'tcx>(
264265

265266
let flow_borrows = Borrows::new(tcx, &body, regioncx.clone(), &borrow_set)
266267
.into_engine(tcx, &body, def.did.to_def_id())
268+
.pass_name("borrowck")
267269
.iterate_to_fixpoint();
268270
let flow_uninits = MaybeUninitializedPlaces::new(tcx, &body, &mdpe)
269271
.into_engine(tcx, &body, def.did.to_def_id())
272+
.pass_name("borrowck")
270273
.iterate_to_fixpoint();
271274
let flow_ever_inits = EverInitializedPlaces::new(tcx, &body, &mdpe)
272275
.into_engine(tcx, &body, def.did.to_def_id())
276+
.pass_name("borrowck")
273277
.iterate_to_fixpoint();
274278

275279
let movable_generator = match tcx.hir().get(id) {

compiler/rustc_mir/src/transform/check_consts/validation.rs

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl Qualifs<'mir, 'tcx> {
5757
MaybeMutBorrowedLocals::mut_borrows_only(tcx, &body, param_env)
5858
.unsound_ignore_borrow_on_drop()
5959
.into_engine(tcx, &body, def_id.to_def_id())
60+
.pass_name("const_qualification")
6061
.iterate_to_fixpoint()
6162
.into_results_cursor(&body)
6263
});

compiler/rustc_mir/src/transform/elaborate_drops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops {
4444
let inits = MaybeInitializedPlaces::new(tcx, body, &env)
4545
.into_engine(tcx, body, def_id)
4646
.dead_unwinds(&dead_unwinds)
47+
.pass_name("elaborate_drops")
4748
.iterate_to_fixpoint()
4849
.into_results_cursor(body);
4950

5051
let uninits = MaybeUninitializedPlaces::new(tcx, body, &env)
5152
.mark_inactive_variants_as_uninit()
5253
.into_engine(tcx, body, def_id)
5354
.dead_unwinds(&dead_unwinds)
55+
.pass_name("elaborate_drops")
5456
.iterate_to_fixpoint()
5557
.into_results_cursor(body);
5658

@@ -83,6 +85,7 @@ fn find_dead_unwinds<'tcx>(
8385
let mut dead_unwinds = BitSet::new_empty(body.basic_blocks().len());
8486
let mut flow_inits = MaybeInitializedPlaces::new(tcx, body, &env)
8587
.into_engine(tcx, body, def_id)
88+
.pass_name("find_dead_unwinds")
8689
.iterate_to_fixpoint()
8790
.into_results_cursor(body);
8891
for (bb, bb_data) in body.basic_blocks().iter_enumerated() {

compiler/rustc_mir/src/transform/generator.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,10 @@ fn locals_live_across_suspend_points(
467467

468468
// Calculate the MIR locals which have been previously
469469
// borrowed (even if they are still active).
470-
let borrowed_locals_results =
471-
MaybeBorrowedLocals::all_borrows().into_engine(tcx, body_ref, def_id).iterate_to_fixpoint();
470+
let borrowed_locals_results = MaybeBorrowedLocals::all_borrows()
471+
.into_engine(tcx, body_ref, def_id)
472+
.pass_name("generator")
473+
.iterate_to_fixpoint();
472474

473475
let mut borrowed_locals_cursor =
474476
dataflow::ResultsCursor::new(body_ref, &borrowed_locals_results);
@@ -484,6 +486,7 @@ fn locals_live_across_suspend_points(
484486
// Calculate the liveness of MIR locals ignoring borrows.
485487
let mut liveness = MaybeLiveLocals
486488
.into_engine(tcx, body_ref, def_id)
489+
.pass_name("generator")
487490
.iterate_to_fixpoint()
488491
.into_results_cursor(body_ref);
489492

src/tools/clippy/clippy_lints/src/redundant_clone.rs

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantClone {
8787

8888
let maybe_storage_live_result = MaybeStorageLive
8989
.into_engine(cx.tcx, mir, def_id.to_def_id())
90+
.pass_name("redundant_clone")
9091
.iterate_to_fixpoint()
9192
.into_results_cursor(mir);
9293
let mut possible_borrower = {

0 commit comments

Comments
 (0)