1
Fork 0

Avoid invalidating the CFG in MirPatch.

As a part of this change, we adjust MirPatch to not needlessly create unnecessary resume blocks.
This commit is contained in:
Jakob Degen 2022-08-02 18:57:54 -07:00
parent e4417cf020
commit efa5eaa5d1
45 changed files with 32 additions and 209 deletions

View file

@ -83,9 +83,9 @@ impl RemoveNoopLandingPads {
fn remove_nop_landing_pads(&self, body: &mut Body<'_>) {
debug!("body: {:#?}", body);
// make sure there's a single resume block
// make sure there's a resume block
let resume_block = {
let patch = MirPatch::new(body);
let mut patch = MirPatch::new(body);
let resume_block = patch.resume_block();
patch.apply(body);
resume_block