-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement references VarDebugInfo #115030
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
Not sure who has expertise to review this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, there's obviously still the debuginfo to work out - but it looks like there's been some suggestions in Zulip for that.
☔ The latest upstream changes (presumably #115094) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing until we have a solution for the codegen part. |
This feature was removed recently in #114904 because implemented unsoundly. This PR proposes a simpler re-implementation.
We introduce an additional
references
field inVarDebugInfo
. This additional field allows to optimize out references that are only used for debuginfo:debug x => _1 _1 = &_2
If debuginfo is the only use of
_1
, this would becomedebug x => &_2
For codegen, we associate the local
_2
with the name*x
. This is suboptimal, as most debugger won't understand that*x
is a name, and not the dereference ofx
.