Skip to content
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

Merged
merged 10 commits into from
Oct 13, 2017

Conversation

chrisvittal
Copy link
Contributor

@chrisvittal chrisvittal commented Oct 4, 2017

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.

@rust-highfive
Copy link
Collaborator

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.

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Oct 4, 2017

r? @nikomatsakis

Copy link
Contributor

@nikomatsakis nikomatsakis left a 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!

@bors
Copy link
Contributor

bors commented Oct 4, 2017

☔ The latest upstream changes (presumably #44901) made this pull request unmergeable. Please resolve the merge conflicts.

Nashenas88 and others added 10 commits October 4, 2017 23:50
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?
@chrisvittal chrisvittal force-pushed the mir_pretty_printing_pr branch from a1205ce to 54d63a0 Compare October 5, 2017 04:13
@shepmaster shepmaster added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 6, 2017
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 9, 2017

📌 Commit 54d63a0 has been approved by nikomatsakis

@nikomatsakis
Copy link
Contributor

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned arielb1 Oct 9, 2017
@nikomatsakis nikomatsakis added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 10, 2017
@bors
Copy link
Contributor

bors commented Oct 10, 2017

⌛ Testing commit 54d63a0 with merge 147d3fdbe4441b3e43dc5305d81fe21d7642b3fd...

@bors
Copy link
Contributor

bors commented Oct 11, 2017

💔 Test failed - status-travis

@kennytm
Copy link
Member

kennytm commented Oct 11, 2017

@bors retry

@bors
Copy link
Contributor

bors commented Oct 13, 2017

⌛ Testing commit 54d63a0 with merge 91eb6fe...

bors added a commit that referenced this pull request Oct 13, 2017
…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.
@bors
Copy link
Contributor

bors commented Oct 13, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 91eb6fe to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants