-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #33989 - eddyb:mir-viz, r=nikomatsakis
[MIR] Make scopes debuginfo-specific (visibility scopes). Fixes #32949 by having MIR (visibility) scopes mimic the lexical structure. Unlike #33235, this PR also removes all scopes without variable bindings. Printing of scopes also changed, e.g. for: ```rust fn foo(x: i32, y: i32) { let a = 0; let b = 0; let c = 0; } ``` Before my changes: ```rust fn foo(arg0: i32, arg1: i32) -> () { let var0: i32; // "x" in scope 1 at <anon>:1:8: 1:9 let var1: i32; // "y" in scope 1 at <anon>:1:16: 1:17 let var2: i32; // "a" in scope 3 at <anon>:1:30: 1:31 let var3: i32; // "b" in scope 6 at <anon>:1:41: 1:42 let var4: i32; // "c" in scope 9 at <anon>:1:52: 1:53 ... scope tree: 0 1 2 3 { 4 5 6 { 7 8 9 10 11 } } } ``` After my changes: ```rust fn foo(arg0: i32, arg1: i32) -> () { scope 1 { let var0: i32; // "x" in scope 1 at <anon>:1:8: 1:9 let var1: i32; // "y" in scope 1 at <anon>:1:16: 1:17 scope 2 { let var2: i32; // "a" in scope 2 at <anon>:1:30: 1:31 scope 3 { let var3: i32; // "b" in scope 3 at <anon>:1:41: 1:42 scope 4 { let var4: i32; // "c" in scope 4 at <anon>:1:52: 1:53 } } } } ... }
- Loading branch information
Showing
30 changed files
with
478 additions
and
493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.