mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Replace locals in debuginfo records during dest_prop
This commit is contained in:
@@ -277,7 +277,6 @@ fn visit_statement(&mut self, statement: &mut Statement<'tcx>, location: Locatio
|
||||
if self.merged_locals.contains(*local) =>
|
||||
{
|
||||
statement.make_nop(true);
|
||||
return;
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
|
||||
+2
-1
@@ -9,11 +9,12 @@
|
||||
let mut _4: bool;
|
||||
|
||||
bb0: {
|
||||
// DBG: _3 = &_1;
|
||||
- // DBG: _3 = &_1;
|
||||
- StorageLive(_4);
|
||||
- _4 = copy _1;
|
||||
- _3 = copy _2;
|
||||
- switchInt(copy _4) -> [1: bb1, otherwise: bb2];
|
||||
+ // DBG: _2 = &_1;
|
||||
+ nop;
|
||||
+ nop;
|
||||
+ nop;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// skip-filecheck
|
||||
//@ test-mir-pass: DestinationPropagation
|
||||
//@ compile-flags: -g -Zmir-enable-passes=+DeadStoreElimination-initial
|
||||
|
||||
@@ -10,6 +9,10 @@
|
||||
// EMIT_MIR dest_prop.remap_debuginfo_locals.DestinationPropagation.diff
|
||||
#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
|
||||
pub fn remap_debuginfo_locals(a: bool, b: &bool) -> &bool {
|
||||
// CHECK-LABEL: fn remap_debuginfo_locals(
|
||||
// CHECK: debug c => [[c:_.*]];
|
||||
// CHECK: bb0:
|
||||
// CHECK-NEXT: DBG: [[c]] = &_1;
|
||||
mir! {
|
||||
let _3: &bool;
|
||||
let _4: bool;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
//@ known-bug: #147485
|
||||
//@ build-pass
|
||||
//@ compile-flags: -g -O
|
||||
|
||||
// Regression test for #147485.
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
pub fn foo(a: bool, b: bool) -> bool {
|
||||
Reference in New Issue
Block a user