-
Notifications
You must be signed in to change notification settings - Fork 515
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
mir: begin documenting user variable debuginfo. #571
Conversation
@eddyb cool, I was wondering if something could also be documented on rustc-guide :). |
@eddyb you are my hero |
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.
Left a minor nit. I think ideally there would be a subchapter or mir, "debug info", that could give a few more details about how debug info is represented, built, and maintained across optimizations. It might also be worth leaving a few notes about how debug info is converted to LLVM? (Or maybe pointers into the code where it happens?)
Here the mapping is trivial, but optimizations may complicate the place, | ||
or lead to multiple user variables sharing the same place. | ||
Additionally, closure captures are described using the same system, and so | ||
they're complicated even without optimizations, e.g.: `debug x => (*((*_1).0: &T));`. |
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.
it would be good, I think, to have some links to the data structures that describe this in the MIR. I dont' thnk we have to go into details, but just a few links would help people know where to get started.
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.
I agree, but it feels like this introduction to MIR is trying to stay light, and that makes it awkward to go into details.
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.
yeah, really I think what we need is to add a subsection with more details. For now, I'm going to merge this PR as is.
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.
MIR feels like it should be a chapter with sections for every part, perhaps including thing like semantic constraints. I don't know why I expected that to already be a thing at first, I guess I haven't kept up with rustc-guide
.
This is the companion to rust-lang/rust#56231, which added these separate debuginfo annotations.
I tried to stick in as much information as I could, but the example does not help me - compare its single
scope 1
(with only adebug
inside, nolet
s), with the example in rust-lang/rust#56231.r? @nikomatsakis cc @rust-lang/wg-mir-opt