2020-04-04 12:15:01 -05:00
|
|
|
- // MIR for `main` before ConstProp
|
|
|
|
+ // MIR for `main` after ConstProp
|
|
|
|
|
|
|
|
fn main() -> () {
|
2020-06-08 07:14:45 -05:00
|
|
|
let mut _0: (); // return place in scope 0 at $DIR/discriminant.rs:10:11: 10:11
|
|
|
|
let _1: i32; // in scope 0 at $DIR/discriminant.rs:11:9: 11:10
|
|
|
|
let mut _2: i32; // in scope 0 at $DIR/discriminant.rs:11:13: 11:64
|
|
|
|
let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:11:34: 11:44
|
|
|
|
let mut _4: isize; // in scope 0 at $DIR/discriminant.rs:11:21: 11:31
|
2020-04-04 12:15:01 -05:00
|
|
|
scope 1 {
|
2020-06-08 07:14:45 -05:00
|
|
|
debug x => _1; // in scope 1 at $DIR/discriminant.rs:11:9: 11:10
|
2020-04-04 12:15:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2020-06-08 07:14:45 -05:00
|
|
|
StorageLive(_1); // scope 0 at $DIR/discriminant.rs:11:9: 11:10
|
|
|
|
StorageLive(_2); // scope 0 at $DIR/discriminant.rs:11:13: 11:64
|
|
|
|
StorageLive(_3); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
|
|
|
|
- _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
|
|
|
|
+ _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
|
2020-04-04 12:15:01 -05:00
|
|
|
// ty::Const
|
|
|
|
- // + ty: bool
|
|
|
|
+ // + ty: std::option::Option<bool>
|
|
|
|
// + val: Value(Scalar(0x01))
|
|
|
|
// mir::Constant
|
2020-06-08 07:14:45 -05:00
|
|
|
- // + span: $DIR/discriminant.rs:11:39: 11:43
|
2020-04-04 12:15:01 -05:00
|
|
|
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
|
2020-06-08 07:14:45 -05:00
|
|
|
- _4 = discriminant(_3); // scope 0 at $DIR/discriminant.rs:11:21: 11:31
|
2020-06-19 11:57:15 -05:00
|
|
|
- switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
|
2020-06-08 07:14:45 -05:00
|
|
|
+ // + span: $DIR/discriminant.rs:11:34: 11:44
|
2020-04-04 12:15:01 -05:00
|
|
|
+ // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
|
2020-06-19 11:57:15 -05:00
|
|
|
+ _4 = const 1_isize; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
|
2020-04-04 12:15:01 -05:00
|
|
|
+ // ty::Const
|
|
|
|
+ // + ty: isize
|
2020-04-04 15:25:54 -05:00
|
|
|
+ // + val: Value(Scalar(0x00000001))
|
2020-04-04 12:15:01 -05:00
|
|
|
+ // mir::Constant
|
2020-06-08 07:14:45 -05:00
|
|
|
+ // + span: $DIR/discriminant.rs:11:21: 11:31
|
2020-04-04 15:25:54 -05:00
|
|
|
+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
|
2020-06-19 11:57:15 -05:00
|
|
|
+ switchInt(const 1_isize) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
|
2020-04-04 12:15:01 -05:00
|
|
|
+ // ty::Const
|
|
|
|
+ // + ty: isize
|
2020-04-04 15:25:54 -05:00
|
|
|
+ // + val: Value(Scalar(0x00000001))
|
2020-04-04 12:15:01 -05:00
|
|
|
+ // mir::Constant
|
2020-06-08 07:14:45 -05:00
|
|
|
+ // + span: $DIR/discriminant.rs:11:21: 11:31
|
2020-04-04 15:25:54 -05:00
|
|
|
+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
|
2020-04-04 12:15:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2020-06-19 11:57:15 -05:00
|
|
|
_2 = const 10_i32; // scope 0 at $DIR/discriminant.rs:11:59: 11:61
|
2020-04-04 12:15:01 -05:00
|
|
|
// ty::Const
|
|
|
|
// + ty: i32
|
|
|
|
// + val: Value(Scalar(0x0000000a))
|
|
|
|
// mir::Constant
|
2020-06-08 07:14:45 -05:00
|
|
|
// + span: $DIR/discriminant.rs:11:59: 11:61
|
2020-04-04 12:15:01 -05:00
|
|
|
// + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
|
2020-06-08 07:14:45 -05:00
|
|
|
goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64
|
2020-04-04 12:15:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2020-07-22 03:29:37 -05:00
|
|
|
- switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:11:26: 11:30
|
|
|
|
+ switchInt(const true) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:11:26: 11:30
|
|
|
|
+ // ty::Const
|
|
|
|
+ // + ty: bool
|
|
|
|
+ // + val: Value(Scalar(0x01))
|
|
|
|
+ // mir::Constant
|
|
|
|
+ // + span: $DIR/discriminant.rs:11:26: 11:30
|
|
|
|
+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
|
2020-04-04 12:15:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2020-06-19 11:57:15 -05:00
|
|
|
_2 = const 42_i32; // scope 0 at $DIR/discriminant.rs:11:47: 11:49
|
2020-04-04 12:15:01 -05:00
|
|
|
// ty::Const
|
|
|
|
// + ty: i32
|
|
|
|
// + val: Value(Scalar(0x0000002a))
|
|
|
|
// mir::Constant
|
2020-06-08 07:14:45 -05:00
|
|
|
// + span: $DIR/discriminant.rs:11:47: 11:49
|
2020-04-04 12:15:01 -05:00
|
|
|
// + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
|
2020-06-08 07:14:45 -05:00
|
|
|
goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64
|
2020-04-04 12:15:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
2020-06-19 11:57:15 -05:00
|
|
|
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:11:13: 11:68
|
2020-04-04 12:15:01 -05:00
|
|
|
// ty::Const
|
|
|
|
// + ty: i32
|
|
|
|
// + val: Value(Scalar(0x00000000))
|
|
|
|
// mir::Constant
|
2020-06-08 07:14:45 -05:00
|
|
|
// + span: $DIR/discriminant.rs:11:67: 11:68
|
2020-04-04 12:15:01 -05:00
|
|
|
// + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
|
2020-06-08 07:14:45 -05:00
|
|
|
StorageDead(_2); // scope 0 at $DIR/discriminant.rs:11:67: 11:68
|
|
|
|
StorageDead(_3); // scope 0 at $DIR/discriminant.rs:11:68: 11:69
|
|
|
|
_0 = const (); // scope 0 at $DIR/discriminant.rs:10:11: 12:2
|
2020-04-14 02:14:58 -05:00
|
|
|
// ty::Const
|
|
|
|
// + ty: ()
|
|
|
|
// + val: Value(Scalar(<ZST>))
|
|
|
|
// mir::Constant
|
2020-06-08 07:14:45 -05:00
|
|
|
// + span: $DIR/discriminant.rs:10:11: 12:2
|
2020-04-14 02:14:58 -05:00
|
|
|
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
|
2020-06-08 07:14:45 -05:00
|
|
|
StorageDead(_1); // scope 0 at $DIR/discriminant.rs:12:1: 12:2
|
|
|
|
return; // scope 0 at $DIR/discriminant.rs:12:2: 12:2
|
2020-04-04 12:15:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|