71 lines
3.8 KiB
Rust
71 lines
3.8 KiB
Rust
// MIR for `int_range` after PreCodegen
|
|
|
|
fn int_range(_1: usize, _2: usize) -> () {
|
|
debug start => _1; // in scope 0 at $DIR/loops.rs:+0:18: +0:23
|
|
debug end => _2; // in scope 0 at $DIR/loops.rs:+0:32: +0:35
|
|
let mut _0: (); // return place in scope 0 at $DIR/loops.rs:+0:44: +0:44
|
|
let mut _3: std::ops::Range<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
let mut _4: std::ops::Range<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
let mut _5: &mut std::ops::Range<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
let mut _6: std::option::Option<usize>; // in scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
let mut _7: isize; // in scope 0 at $DIR/loops.rs:+1:5: +3:6
|
|
let _9: (); // in scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
scope 1 {
|
|
debug iter => _4; // in scope 1 at $DIR/loops.rs:+1:14: +1:24
|
|
let _8: usize; // in scope 1 at $DIR/loops.rs:+1:9: +1:10
|
|
scope 2 {
|
|
debug i => _8; // in scope 2 at $DIR/loops.rs:+1:9: +1:10
|
|
}
|
|
scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) { // at $DIR/loops.rs:7:14: 7:24
|
|
debug self => _5; // in scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
|
|
}
|
|
}
|
|
scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) { // at $DIR/loops.rs:7:14: 7:24
|
|
debug self => _3; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
|
}
|
|
|
|
bb0: {
|
|
_3 = std::ops::Range::<usize> { start: _1, end: _2 }; // scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
StorageLive(_4); // scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
_4 = move _3; // scope 0 at $DIR/loops.rs:+1:14: +1:24
|
|
goto -> bb1; // scope 1 at $DIR/loops.rs:+1:5: +3:6
|
|
}
|
|
|
|
bb1: {
|
|
StorageLive(_6); // scope 1 at $DIR/loops.rs:+1:14: +1:24
|
|
_5 = &mut _4; // scope 1 at $DIR/loops.rs:+1:14: +1:24
|
|
_6 = <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next(_5) -> bb2; // scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
|
|
// mir::Constant
|
|
// + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
|
|
// + literal: Const { ty: for<'a> fn(&'a mut std::ops::Range<usize>) -> Option<<std::ops::Range<usize> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next}, val: Value(<ZST>) }
|
|
}
|
|
|
|
bb2: {
|
|
_7 = discriminant(_6); // scope 1 at $DIR/loops.rs:+1:14: +1:24
|
|
switchInt(move _7) -> [0: bb3, 1: bb4, otherwise: bb6]; // scope 1 at $DIR/loops.rs:+1:14: +1:24
|
|
}
|
|
|
|
bb3: {
|
|
StorageDead(_6); // scope 1 at $DIR/loops.rs:+3:5: +3:6
|
|
StorageDead(_4); // scope 0 at $DIR/loops.rs:+3:5: +3:6
|
|
return; // scope 0 at $DIR/loops.rs:+4:2: +4:2
|
|
}
|
|
|
|
bb4: {
|
|
_8 = ((_6 as Some).0: usize); // scope 1 at $DIR/loops.rs:+1:9: +1:10
|
|
_9 = opaque::<usize>(_8) -> bb5; // scope 2 at $DIR/loops.rs:+2:9: +2:18
|
|
// mir::Constant
|
|
// + span: $DIR/loops.rs:8:9: 8:15
|
|
// + literal: Const { ty: fn(usize) {opaque::<usize>}, val: Value(<ZST>) }
|
|
}
|
|
|
|
bb5: {
|
|
StorageDead(_6); // scope 1 at $DIR/loops.rs:+3:5: +3:6
|
|
goto -> bb1; // scope 1 at $DIR/loops.rs:+1:5: +3:6
|
|
}
|
|
|
|
bb6: {
|
|
unreachable; // scope 1 at $DIR/loops.rs:+1:14: +1:24
|
|
}
|
|
}
|