Skip to content

Commit 1ac5d4c

Browse files
committed
Create resume block later.
1 parent cf341ea commit 1ac5d4c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

compiler/rustc_mir_transform/src/remove_noop_landing_pads.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ impl<'tcx> crate::MirPass<'tcx> for RemoveNoopLandingPads {
3030
return;
3131
}
3232

33-
// make sure there's a resume block without any statements
34-
let resume_block = {
35-
let mut patch = MirPatch::new(body);
36-
let resume_block = patch.resume_block();
37-
patch.apply(body);
38-
resume_block
39-
};
40-
debug!(?resume_block);
41-
4233
let mut nop_landing_pads = DenseBitSet::new_empty(body.basic_blocks.len());
4334

4435
// This is a post-order traversal, so that if A post-dominates B
@@ -56,6 +47,15 @@ impl<'tcx> crate::MirPass<'tcx> for RemoveNoopLandingPads {
5647
return;
5748
}
5849

50+
// make sure there's a resume block without any statements
51+
let resume_block = {
52+
let mut patch = MirPatch::new(body);
53+
let resume_block = patch.resume_block();
54+
patch.apply(body);
55+
resume_block
56+
};
57+
debug!(?resume_block);
58+
5959
let basic_blocks = body.basic_blocks.as_mut();
6060
for (bb, bbdata) in basic_blocks.iter_enumerated_mut() {
6161
debug!("processing {:?}", bb);

0 commit comments

Comments
 (0)