mir-opt: a sub-BB of a cleanup BB must also be a cleanup BB
This commit is contained in:
parent
7a0b78da91
commit
15fa788cc3
4 changed files with 322 additions and 1 deletions
|
@ -179,7 +179,7 @@ impl<'tcx> crate::MirPass<'tcx> for EarlyOtherwiseBranch {
|
|||
let eq_targets = SwitchTargets::new(eq_new_targets, parent_targets.otherwise());
|
||||
|
||||
// Create `bbEq` in example above
|
||||
let eq_switch = BasicBlockData::new(Some(Terminator {
|
||||
let mut eq_switch = BasicBlockData::new(Some(Terminator {
|
||||
source_info: bbs[parent].terminator().source_info,
|
||||
kind: TerminatorKind::SwitchInt {
|
||||
// switch on the first discriminant, so we can mark the second one as dead
|
||||
|
@ -187,6 +187,7 @@ impl<'tcx> crate::MirPass<'tcx> for EarlyOtherwiseBranch {
|
|||
targets: eq_targets,
|
||||
},
|
||||
}));
|
||||
eq_switch.is_cleanup = bbs[parent].is_cleanup;
|
||||
|
||||
let eq_bb = patch.new_block(eq_switch);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue