Skip to content

Commit d711c30

Browse files
committed
Remove first_merge from liveness debug logs
1 parent 1700ca0 commit d711c30

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

compiler/rustc_passes/src/liveness.rs

+6-18
Original file line numberDiff line numberDiff line change
@@ -781,19 +781,13 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
781781
debug!("init_from_succ(ln={}, succ={})", self.ln_str(ln), self.ln_str(succ_ln));
782782
}
783783

784-
fn merge_from_succ(&mut self, ln: LiveNode, succ_ln: LiveNode, first_merge: bool) -> bool {
784+
fn merge_from_succ(&mut self, ln: LiveNode, succ_ln: LiveNode) -> bool {
785785
if ln == succ_ln {
786786
return false;
787787
}
788788

789789
let changed = self.rwu_table.union(ln, succ_ln);
790-
debug!(
791-
"merge_from_succ(ln={:?}, succ={}, first_merge={}, changed={})",
792-
ln,
793-
self.ln_str(succ_ln),
794-
first_merge,
795-
changed
796-
);
790+
debug!("merge_from_succ(ln={:?}, succ={}, changed={})", ln, self.ln_str(succ_ln), changed);
797791
changed
798792
}
799793

@@ -893,7 +887,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
893887
};
894888

895889
// Propagate through calls to the closure.
896-
let mut first_merge = true;
897890
loop {
898891
self.init_from_succ(self.closure_ln, succ);
899892
for param in body.params {
@@ -903,10 +896,9 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
903896
})
904897
}
905898

906-
if !self.merge_from_succ(self.exit_ln, self.closure_ln, first_merge) {
899+
if !self.merge_from_succ(self.exit_ln, self.closure_ln) {
907900
break;
908901
}
909-
first_merge = false;
910902
assert_eq!(succ, self.propagate_through_expr(&body.value, self.exit_ln));
911903
}
912904

@@ -1012,7 +1004,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
10121004
//
10131005
let ln = self.live_node(expr.hir_id, expr.span);
10141006
self.init_empty(ln, succ);
1015-
let mut first_merge = true;
10161007
for arm in arms {
10171008
let body_succ = self.propagate_through_expr(&arm.body, succ);
10181009

@@ -1021,8 +1012,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
10211012
body_succ,
10221013
);
10231014
let arm_succ = self.define_bindings_in_pat(&arm.pat, guard_succ);
1024-
self.merge_from_succ(ln, arm_succ, first_merge);
1025-
first_merge = false;
1015+
self.merge_from_succ(ln, arm_succ);
10261016
}
10271017
self.propagate_through_expr(&e, ln)
10281018
}
@@ -1133,7 +1123,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
11331123

11341124
let ln = self.live_node(expr.hir_id, expr.span);
11351125
self.init_from_succ(ln, succ);
1136-
self.merge_from_succ(ln, r_succ, false);
1126+
self.merge_from_succ(ln, r_succ);
11371127

11381128
self.propagate_through_expr(&l, ln)
11391129
}
@@ -1377,7 +1367,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
13771367
*/
13781368

13791369
// first iteration:
1380-
let mut first_merge = true;
13811370
let ln = self.live_node(expr.hir_id, expr.span);
13821371
self.init_empty(ln, succ);
13831372
debug!("propagate_through_loop: using id for loop body {} {:?}", expr.hir_id, body);
@@ -1389,8 +1378,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
13891378
let body_ln = self.propagate_through_block(body, ln);
13901379

13911380
// repeat until fixed point is reached:
1392-
while self.merge_from_succ(ln, body_ln, first_merge) {
1393-
first_merge = false;
1381+
while self.merge_from_succ(ln, body_ln) {
13941382
assert_eq!(body_ln, self.propagate_through_block(body, ln));
13951383
}
13961384

0 commit comments

Comments
 (0)