rust/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
2.5 KiB
Rust
Raw Normal View History

// MIR for `ezmap` after PreCodegen
fn ezmap(_1: Option<i32>) -> Option<i32> {
debug x => _1; // in scope 0 at $DIR/simple_option_map.rs:+0:14: +0:15
let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/simple_option_map.rs:+0:33: +0:44
scope 1 (inlined map::<i32, i32, [closure@$DIR/simple_option_map.rs:18:12: 18:15]>) { // at $DIR/simple_option_map.rs:18:5: 18:22
debug slf => _1; // in scope 1 at $DIR/simple_option_map.rs:6:17: 6:20
debug f => const ZeroSized: [closure@$DIR/simple_option_map.rs:18:12: 18:15]; // in scope 1 at $DIR/simple_option_map.rs:6:33: 6:34
let mut _2: isize; // in scope 1 at $DIR/simple_option_map.rs:11:9: 11:16
let _3: i32; // in scope 1 at $DIR/simple_option_map.rs:11:14: 11:15
2023-05-26 13:53:34 -05:00
let mut _4: i32; // in scope 1 at $DIR/simple_option_map.rs:11:25: 11:29
scope 2 {
debug x => _3; // in scope 2 at $DIR/simple_option_map.rs:11:14: 11:15
scope 3 (inlined ezmap::{closure#0}) { // at $DIR/simple_option_map.rs:11:25: 11:29
2023-05-26 13:53:34 -05:00
debug n => _3; // in scope 3 at $DIR/simple_option_map.rs:+1:13: +1:14
}
}
}
bb0: {
_2 = discriminant(_1); // scope 1 at $DIR/simple_option_map.rs:10:11: 10:14
switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 1 at $DIR/simple_option_map.rs:10:5: 10:14
}
bb1: {
_0 = Option::<i32>::None; // scope 1 at $DIR/simple_option_map.rs:12:17: 12:21
goto -> bb3; // scope 1 at $DIR/simple_option_map.rs:12:17: 12:21
}
bb2: {
_3 = ((_1 as Some).0: i32); // scope 1 at $DIR/simple_option_map.rs:11:14: 11:15
StorageLive(_4); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
2023-05-26 13:53:34 -05:00
_4 = Add(_3, const 1_i32); // scope 3 at $DIR/simple_option_map.rs:+1:16: +1:21
_0 = Option::<i32>::Some(move _4); // scope 2 at $DIR/simple_option_map.rs:11:20: 11:30
StorageDead(_4); // scope 2 at $DIR/simple_option_map.rs:11:29: 11:30
goto -> bb3; // scope 1 at $DIR/simple_option_map.rs:14:1: 14:2
}
bb3: {
return; // scope 0 at $DIR/simple_option_map.rs:+2:2: +2:2
}
bb4: {
unreachable; // scope 1 at $DIR/simple_option_map.rs:10:11: 10:14
}
}