1
Fork 0

Remove unneeded field from SwitchTargets

This commit is contained in:
Jakob Degen 2022-12-03 16:03:27 -08:00
parent 14ca83a04b
commit 9fb8da8f8f
131 changed files with 304 additions and 388 deletions

View file

@ -183,7 +183,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
LogicalOp::And => (else_block, shortcircuit_block),
LogicalOp::Or => (shortcircuit_block, else_block),
};
let term = TerminatorKind::if_(this.tcx, lhs, blocks.0, blocks.1);
let term = TerminatorKind::if_(lhs, blocks.0, blocks.1);
this.cfg.terminate(block, source_info, term);
this.cfg.push_assign_constant(

View file

@ -95,7 +95,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let then_block = this.cfg.start_new_block();
let else_block = this.cfg.start_new_block();
let term = TerminatorKind::if_(this.tcx, operand, then_block, else_block);
let term = TerminatorKind::if_(operand, then_block, else_block);
let source_info = this.source_info(expr_span);
this.cfg.terminate(block, source_info, term);

View file

@ -203,7 +203,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
self.source_info(match_start_span),
TerminatorKind::SwitchInt {
discr: Operand::Move(discr),
switch_ty: discr_ty,
targets: switch_targets,
},
);
@ -221,7 +220,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
0 => (second_bb, first_bb),
v => span_bug!(test.span, "expected boolean value but got {:?}", v),
};
TerminatorKind::if_(self.tcx, Operand::Copy(place), true_bb, false_bb)
TerminatorKind::if_(Operand::Copy(place), true_bb, false_bb)
} else {
// The switch may be inexhaustive so we have a catch all block
debug_assert_eq!(options.len() + 1, target_blocks.len());
@ -232,7 +231,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
);
TerminatorKind::SwitchInt {
discr: Operand::Copy(place),
switch_ty,
targets: switch_targets,
}
};
@ -378,7 +376,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
self.cfg.terminate(
block,
source_info,
TerminatorKind::if_(self.tcx, Operand::Move(result), success_block, fail_block),
TerminatorKind::if_(Operand::Move(result), success_block, fail_block),
);
}
@ -482,7 +480,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
self.cfg.terminate(
eq_block,
source_info,
TerminatorKind::if_(self.tcx, Operand::Move(eq_result), success_block, fail_block),
TerminatorKind::if_(Operand::Move(eq_result), success_block, fail_block),
);
}