-
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
Extend mir dump to dump each region #45013
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @arielb1 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
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 great @chrisvittal!
☔ The latest upstream changes (presumably #44901) made this pull request unmergeable. Please resolve the merge conflicts. |
Extend `dump_mir` and functions it calls in order to allow callers to add custom information. We do this by adding an enum `PassWhere` and an extra argument of type `FnMut(PassWhere, &mut Write) -> io::Result<()>`. This callback is responsible for printing the extra information when MIR is dumped at various stages. For the "nll" pass, use the new mechanism to dump the `Region` information after the header, but before the control flow graph for every function. In the interest of keeping the output somewhat concise, implement a custom Debug impl for `Region` Open Questions: * What should we call what has been called `PassWhere` so far?
a1205ce
to
54d63a0
Compare
@bors r+ |
📌 Commit 54d63a0 has been approved by |
⌛ Testing commit 54d63a0 with merge 147d3fdbe4441b3e43dc5305d81fe21d7642b3fd... |
💔 Test failed - status-travis |
@bors retry
|
…akis Extend mir dump to dump each region Building on #44878, implement the feature discussed in #44872. Through discussions on the WG-nll-gitter, @nikomatsakis and I decided to implement this by extending `dump_mir` and all functions that it calls to take a callback of signature `FnMut(PassWhere, &mut Write) -> io::Result<()>` where `PassWhere` is an enum that represents possible locations that we may want to print out extra data in the process of dumping the MIR. I'm not particularly wedded to the name `PassWhere`, but I felt that simply calling the enum `Where` wasn't the right thing to name it. This work depends strongly on #44878, and should be rebased on the final version of that tree, whatever that may be.
☀️ Test successful - status-appveyor, status-travis |
Building on #44878, implement the feature discussed in #44872.
Through discussions on the WG-nll-gitter, @nikomatsakis and I decided to implement this by extending
dump_mir
and all functions that it calls to take a callback of signatureFnMut(PassWhere, &mut Write) -> io::Result<()>
wherePassWhere
is an enum that represents possible locations that we may want to print out extra data in the process of dumping the MIR.I'm not particularly wedded to the name
PassWhere
, but I felt that simply calling the enumWhere
wasn't the right thing to name it.This work depends strongly on #44878, and should be rebased on the final version of that tree, whatever that may be.