Fix debuginfo so that it points to the correct local

This commit is contained in:
Wesley Wiser 2020-06-21 19:34:54 -04:00
parent 9248d90d20
commit 24bfdc98e9
7 changed files with 126 additions and 111 deletions

View file

@ -5,12 +5,12 @@
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46
let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:25: 4:26
- let mut _5: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
scope 1 {
debug x => _3; // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
}
bb0: {
@ -19,9 +19,7 @@
}
bb1: {
_3 = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
((_0 as Some).0: std::boxed::Box<()>) = move _3; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
discriminant(_0) = 1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
_0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
}

View file

@ -5,12 +5,12 @@
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46
let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:25: 4:26
- let mut _5: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
scope 1 {
debug x => _3; // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
}
bb0: {
@ -19,9 +19,7 @@
}
bb1: {
_3 = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
((_0 as Some).0: std::boxed::Box<()>) = move _3; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
discriminant(_0) = 1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
_0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
}

View file

@ -15,22 +15,27 @@
let _10: u32; // in scope 0 at $DIR/simplify_try.rs:6:13: 6:15
let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:7:8: 7:9
scope 1 {
debug y => _2; // in scope 1 at $DIR/simplify_try.rs:6:9: 6:10
- debug y => _2; // in scope 1 at $DIR/simplify_try.rs:6:9: 6:10
+ debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:6:9: 6:10
}
scope 2 {
debug err => _6; // in scope 2 at $DIR/simplify_try.rs:6:14: 6:15
- debug err => _6; // in scope 2 at $DIR/simplify_try.rs:6:14: 6:15
+ debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:6:14: 6:15
scope 3 {
scope 7 {
debug t => _9; // in scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
- debug t => _9; // in scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+ debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
}
scope 8 {
debug v => _8; // in scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
- debug v => _8; // in scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
+ debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:6:14: 6:15
}
}
}
scope 4 {
debug val => _10; // in scope 4 at $DIR/simplify_try.rs:6:13: 6:15
- debug val => _10; // in scope 4 at $DIR/simplify_try.rs:6:13: 6:15
+ debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:6:13: 6:15
scope 5 {
}
}
@ -50,35 +55,37 @@
}
bb1: {
StorageLive(_10); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
_10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
_2 = _10; // scope 5 at $DIR/simplify_try.rs:6:13: 6:15
StorageDead(_10); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
- StorageLive(_10); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
- _10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
- _2 = _10; // scope 5 at $DIR/simplify_try.rs:6:13: 6:15
- StorageDead(_10); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+ _0 = move _3; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:6:15: 6:16
StorageLive(_11); // scope 1 at $DIR/simplify_try.rs:7:8: 7:9
_11 = _2; // scope 1 at $DIR/simplify_try.rs:7:8: 7:9
((_0 as Ok).0: u32) = move _11; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
discriminant(_0) = 0; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
StorageDead(_11); // scope 1 at $DIR/simplify_try.rs:7:9: 7:10
- StorageLive(_11); // scope 1 at $DIR/simplify_try.rs:7:8: 7:9
- _11 = _2; // scope 1 at $DIR/simplify_try.rs:7:8: 7:9
- ((_0 as Ok).0: u32) = move _11; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
- discriminant(_0) = 0; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
- StorageDead(_11); // scope 1 at $DIR/simplify_try.rs:7:9: 7:10
StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:8:1: 8:2
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
bb2: {
StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
_6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
StorageLive(_8); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
StorageLive(_9); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
_9 = _6; // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
_8 = move _9; // scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
StorageDead(_9); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
StorageLive(_12); // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
_12 = move _8; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
((_0 as Err).0: i32) = move _12; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
discriminant(_0) = 1; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
StorageDead(_12); // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
StorageDead(_8); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
- StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
- StorageLive(_8); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
- StorageLive(_9); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
- _9 = _6; // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
- _8 = move _9; // scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
- StorageDead(_9); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
- StorageLive(_12); // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
- _12 = move _8; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
- ((_0 as Err).0: i32) = move _12; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
- discriminant(_0) = 1; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
- StorageDead(_12); // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
- StorageDead(_8); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
- StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+ _0 = move _3; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:6:15: 6:16
StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:8:1: 8:2
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15

View file

@ -14,22 +14,22 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i
let _10: u32; // in scope 0 at $DIR/simplify_try.rs:6:13: 6:15
let mut _11: u32; // in scope 0 at $DIR/simplify_try.rs:7:8: 7:9
scope 1 {
debug y => _2; // in scope 1 at $DIR/simplify_try.rs:6:9: 6:10
debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:6:9: 6:10
}
scope 2 {
debug err => _6; // in scope 2 at $DIR/simplify_try.rs:6:14: 6:15
debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:6:14: 6:15
scope 3 {
scope 7 {
debug t => _9; // in scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
}
scope 8 {
debug v => _8; // in scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
let mut _12: i32; // in scope 8 at $DIR/simplify_try.rs:6:14: 6:15
}
}
}
scope 4 {
debug val => _10; // in scope 4 at $DIR/simplify_try.rs:6:13: 6:15
debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:6:13: 6:15
scope 5 {
}
}
@ -45,45 +45,17 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i
_3 = move _4; // scope 6 at $SRC_DIR/libcore/result.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
_5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
goto -> bb1; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
}
bb1: {
StorageLive(_10); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
_10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
_2 = _10; // scope 5 at $DIR/simplify_try.rs:6:13: 6:15
StorageDead(_10); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
_0 = move _3; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:6:15: 6:16
StorageLive(_11); // scope 1 at $DIR/simplify_try.rs:7:8: 7:9
_11 = _2; // scope 1 at $DIR/simplify_try.rs:7:8: 7:9
((_0 as Ok).0: u32) = move _11; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
discriminant(_0) = 0; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
StorageDead(_11); // scope 1 at $DIR/simplify_try.rs:7:9: 7:10
StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:8:1: 8:2
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
goto -> bb2; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
bb2: {
StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
_6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
StorageLive(_8); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
StorageLive(_9); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
_9 = _6; // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
_8 = move _9; // scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
StorageDead(_9); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
StorageLive(_12); // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
_12 = move _8; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
((_0 as Err).0: i32) = move _12; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
discriminant(_0) = 1; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
StorageDead(_12); // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
StorageDead(_8); // scope 3 at $DIR/simplify_try.rs:6:14: 6:15
StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:6:15: 6:16
StorageDead(_2); // scope 0 at $DIR/simplify_try.rs:8:1: 8:2
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
}
bb3: {
return; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
}

View file

@ -3,25 +3,22 @@
fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i32> {
debug x => _1; // in scope 0 at $DIR/simplify_try.rs:5:17: 5:18
let mut _0: std::result::Result<u32, i32>; // return place in scope 0 at $DIR/simplify_try.rs:5:41: 5:57
let mut _2: isize; // in scope 0 at $DIR/simplify_try.rs:6:14: 6:15
let _3: i32; // in scope 0 at $DIR/simplify_try.rs:6:14: 6:15
let _4: u32; // in scope 0 at $DIR/simplify_try.rs:6:13: 6:15
scope 1 {
debug y => _4; // in scope 1 at $DIR/simplify_try.rs:6:9: 6:10
debug y => ((_0 as Ok).0: u32); // in scope 1 at $DIR/simplify_try.rs:6:9: 6:10
}
scope 2 {
debug err => _3; // in scope 2 at $DIR/simplify_try.rs:6:14: 6:15
debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify_try.rs:6:14: 6:15
scope 3 {
scope 7 {
debug t => _3; // in scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
}
scope 8 {
debug v => _3; // in scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
}
}
}
scope 4 {
debug val => _4; // in scope 4 at $DIR/simplify_try.rs:6:13: 6:15
debug val => ((_0 as Ok).0: u32); // in scope 4 at $DIR/simplify_try.rs:6:13: 6:15
scope 5 {
}
}
@ -30,25 +27,7 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i
}
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
switchInt(move _2) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
}
bb1: {
_4 = ((_1 as Ok).0: u32); // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
((_0 as Ok).0: u32) = move _4; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
discriminant(_0) = 0; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
bb2: {
_3 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
((_0 as Err).0: i32) = move _3; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
discriminant(_0) = 1; // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
goto -> bb3; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
}
bb3: {
_0 = move _1; // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
return; // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
}
}