Skip to content

Commit

Permalink
Strip landing pads in the state transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Aug 12, 2017
1 parent 84af3d8 commit fa18aa3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librustc_mir/transform/generator.rs
Expand Up @@ -27,6 +27,7 @@ use std::borrow::Cow;
use std::iter::once;
use std::mem;
use transform::simplify;
use transform::no_landing_pads::no_landing_pads;

pub struct StateTransform;

Expand Down Expand Up @@ -463,6 +464,8 @@ fn create_generator_drop_shim<'a, 'tcx>(
is_user_variable: false,
};

no_landing_pads(tcx, &mut mir);

// Make sure we remove dead blocks to remove
// unrelated code from the resume part of the function
simplify::remove_dead_blocks(&mut mir);
Expand Down Expand Up @@ -573,6 +576,8 @@ fn creator_generator_resume_function<'a, 'tcx>(

make_generator_state_argument_indirect(tcx, def_id, mir);

no_landing_pads(tcx, &mut mir);

// Make sure we remove dead blocks to remove
// unrelated code from the drop part of the function
simplify::remove_dead_blocks(mir);
Expand Down

0 comments on commit fa18aa3

Please sign in to comment.