summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
blob: cd734b10fea4f532bafde9c7ff6b8ea4b5de5560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// MIR for `forward_loop` after PreCodegen

fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
    debug start => _1;
    debug end => _2;
    debug f => _3;
    let mut _0: ();
    let mut _4: std::ops::Range<u32>;
    let mut _5: std::ops::Range<u32>;
    let mut _6: &mut std::ops::Range<u32>;
    let mut _12: std::option::Option<u32>;
    let mut _15: isize;
    let mut _17: &impl Fn(u32);
    let mut _18: (u32,);
    let _19: ();
    scope 1 {
        debug iter => _5;
        let _16: u32;
        scope 2 {
            debug x => _16;
        }
        scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
            debug self => _6;
            scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
                debug self => _6;
                let mut _7: &u32;
                let mut _8: &u32;
                let mut _11: bool;
                let _13: u32;
                let mut _14: u32;
                scope 6 {
                    debug old => _13;
                    scope 7 {
                    }
                }
                scope 8 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) {
                    debug self => _7;
                    debug other => _8;
                    let mut _9: u32;
                    let mut _10: u32;
                }
            }
        }
    }
    scope 3 (inlined <std::ops::Range<u32> as IntoIterator>::into_iter) {
        debug self => _4;
    }

    bb0: {
        _4 = std::ops::Range::<u32> { start: _1, end: _2 };
        StorageLive(_5);
        _5 = move _4;
        goto -> bb1;
    }

    bb1: {
        StorageLive(_12);
        _6 = &mut _5;
        StorageLive(_13);
        StorageLive(_11);
        StorageLive(_7);
        _7 = &(_5.0: u32);
        StorageLive(_8);
        _8 = &(_5.1: u32);
        StorageLive(_9);
        _9 = (_5.0: u32);
        StorageLive(_10);
        _10 = (_5.1: u32);
        _11 = Lt(move _9, move _10);
        StorageDead(_10);
        StorageDead(_9);
        switchInt(move _11) -> [0: bb2, otherwise: bb3];
    }

    bb2: {
        StorageDead(_8);
        StorageDead(_7);
        _12 = Option::<u32>::None;
        goto -> bb5;
    }

    bb3: {
        StorageDead(_8);
        StorageDead(_7);
        _13 = (_5.0: u32);
        StorageLive(_14);
        _14 = <u32 as Step>::forward_unchecked(_13, const 1_usize) -> [return: bb4, unwind unreachable];
    }

    bb4: {
        (_5.0: u32) = move _14;
        StorageDead(_14);
        _12 = Option::<u32>::Some(_13);
        goto -> bb5;
    }

    bb5: {
        StorageDead(_11);
        StorageDead(_13);
        _15 = discriminant(_12);
        switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb10];
    }

    bb6: {
        StorageDead(_12);
        StorageDead(_5);
        drop(_3) -> [return: bb7, unwind unreachable];
    }

    bb7: {
        return;
    }

    bb8: {
        _16 = ((_12 as Some).0: u32);
        StorageLive(_17);
        _17 = &_3;
        StorageLive(_18);
        _18 = (_16,);
        _19 = <impl Fn(u32) as Fn<(u32,)>>::call(move _17, move _18) -> [return: bb9, unwind unreachable];
    }

    bb9: {
        StorageDead(_18);
        StorageDead(_17);
        StorageDead(_12);
        goto -> bb1;
    }

    bb10: {
        unreachable;
    }
}