summary refs log tree commit diff
path: root/src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff
blob: b4d1f087391f31e52bfe4123c54215c147c7fbb1 (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
- // MIR for `hello` before ConstProp
+ // MIR for `hello` after ConstProp
  
  fn hello() -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14
      let mut _1: bool;                    // in scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
      let mut _2: !;                       // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
  
      bb0: {
          StorageLive(_1);                 // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
-         _1 = const <bool as NeedsDrop>::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
+         _1 = const false;                // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
                                           // ty::Const
                                           // + ty: bool
-                                          // + val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None)
+                                          // + val: Value(Scalar(0x00))
                                           // mir::Constant
                                           // + span: $DIR/control-flow-simplification.rs:12:8: 12:21
-                                          // + literal: Const { ty: bool, val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None) }
-         switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+         switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+                                          // ty::Const
+                                          // + ty: bool
+                                          // + val: Value(Scalar(0x00))
+                                          // mir::Constant
+                                          // + span: $DIR/control-flow-simplification.rs:12:5: 14:6
+                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
      }
  
      bb1: {
          _0 = const ();                   // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
                                           // ty::Const
                                           // + ty: ()
                                           // + val: Value(Scalar(<ZST>))
                                           // mir::Constant
                                           // + span: $DIR/control-flow-simplification.rs:12:5: 14:6
                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
          StorageDead(_1);                 // scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2
          return;                          // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
      }
  
      bb2: {
          StorageLive(_2);                 // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
          const std::rt::begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
                                           // ty::Const
                                           // + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}
                                           // + val: Value(Scalar(<ZST>))
                                           // mir::Constant
                                           // + span: $SRC_DIR/libstd/macros.rs:LL:COL
                                           // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar(<ZST>)) }
                                           // ty::Const
                                           // + ty: &str
                                           // + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 })
                                           // mir::Constant
                                           // + span: $SRC_DIR/libstd/macros.rs:LL:COL
                                           // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) }
      }
  }