summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/dataflow-const-prop/enum.main.DataflowConstProp.diff
blob: fce18fae4362f17224dfcc0ed6213575176167c5 (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
- // MIR for `main` before DataflowConstProp
+ // MIR for `main` after DataflowConstProp
  
  fn main() -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/enum.rs:+0:11: +0:11
      let _1: E;                           // in scope 0 at $DIR/enum.rs:+1:9: +1:10
      let mut _3: isize;                   // in scope 0 at $DIR/enum.rs:+2:23: +2:31
      scope 1 {
          debug e => _1;                   // in scope 1 at $DIR/enum.rs:+1:9: +1:10
          let _2: i32;                     // in scope 1 at $DIR/enum.rs:+2:9: +2:10
          let _4: i32;                     // in scope 1 at $DIR/enum.rs:+2:29: +2:30
          let _5: i32;                     // in scope 1 at $DIR/enum.rs:+2:44: +2:45
          scope 2 {
              debug x => _2;               // in scope 2 at $DIR/enum.rs:+2:9: +2:10
          }
          scope 3 {
              debug x => _4;               // in scope 3 at $DIR/enum.rs:+2:29: +2:30
          }
          scope 4 {
              debug x => _5;               // in scope 4 at $DIR/enum.rs:+2:44: +2:45
          }
      }
  
      bb0: {
          StorageLive(_1);                 // scope 0 at $DIR/enum.rs:+1:9: +1:10
          Deinit(_1);                      // scope 0 at $DIR/enum.rs:+1:13: +1:21
          ((_1 as V1).0: i32) = const 0_i32; // scope 0 at $DIR/enum.rs:+1:13: +1:21
          discriminant(_1) = 0;            // scope 0 at $DIR/enum.rs:+1:13: +1:21
          StorageLive(_2);                 // scope 1 at $DIR/enum.rs:+2:9: +2:10
          _3 = discriminant(_1);           // scope 1 at $DIR/enum.rs:+2:19: +2:20
          switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 1 at $DIR/enum.rs:+2:13: +2:20
      }
  
      bb1: {
          StorageLive(_5);                 // scope 1 at $DIR/enum.rs:+2:44: +2:45
          _5 = ((_1 as V2).0: i32);        // scope 1 at $DIR/enum.rs:+2:44: +2:45
          _2 = _5;                         // scope 4 at $DIR/enum.rs:+2:50: +2:51
          StorageDead(_5);                 // scope 1 at $DIR/enum.rs:+2:50: +2:51
          goto -> bb4;                     // scope 1 at $DIR/enum.rs:+2:50: +2:51
      }
  
      bb2: {
          unreachable;                     // scope 1 at $DIR/enum.rs:+2:19: +2:20
      }
  
      bb3: {
          StorageLive(_4);                 // scope 1 at $DIR/enum.rs:+2:29: +2:30
          _4 = ((_1 as V1).0: i32);        // scope 1 at $DIR/enum.rs:+2:29: +2:30
          _2 = _4;                         // scope 3 at $DIR/enum.rs:+2:35: +2:36
          StorageDead(_4);                 // scope 1 at $DIR/enum.rs:+2:35: +2:36
          goto -> bb4;                     // scope 1 at $DIR/enum.rs:+2:35: +2:36
      }
  
      bb4: {
          _0 = const ();                   // scope 0 at $DIR/enum.rs:+0:11: +3:2
          StorageDead(_2);                 // scope 1 at $DIR/enum.rs:+3:1: +3:2
          StorageDead(_1);                 // scope 0 at $DIR/enum.rs:+3:1: +3:2
          return;                          // scope 0 at $DIR/enum.rs:+3:2: +3:2
      }
  }