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 --pretty flowgraph=ID to include dataflow results in output. #15371

Merged
merged 1 commit into from
Jul 15, 2014

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Jul 3, 2014

Use one or more of the following -Z flag options to tell the
graphviz renderer to include the corresponding dataflow sets (after
the iterative constraint propagation reaches a fixed-point solution):

  • -Z flowgraph-print-loans : loans computed via middle::borrowck
  • -Z flowgraph-print-moves : moves computed via middle::borrowck::move_data
  • -Z flowgraph-print-assigns : assignments, via middle::borrowck::move_data
  • -Z flowgraph-print-all : all of the available sets are included.

Fix #15016.

@pcwalton
Copy link
Contributor

pcwalton commented Jul 3, 2014

Looks like Travis failed again.

@pnkfelix
Copy link
Member Author

pnkfelix commented Jul 3, 2014

Oh goodness, I left some debugging code in there, silly me.

I will close this PR and reopen it after I have revised my code and actually passed tests locally. Sorry for the noise.

@pnkfelix pnkfelix closed this Jul 3, 2014
@pnkfelix pnkfelix reopened this Jul 4, 2014
@pnkfelix
Copy link
Member Author

pnkfelix commented Jul 5, 2014

BTW in my own review I'd say that the fn_like mod is so strongly tied to ast_map (specifically ast_map::Node) that it probably should be a submodule of ast_map. I.e. I should move that mod to syntax::ast_map::fn_like, the file to libsyntax/ast_map/fn_like and revise the rest of file hierarchy accordingly.

(but maybe not. feedback welcome.)


/// Puts `suffix` on a line below this label, with a blank line separator.
pub fn suffix_line(self, suffix: LabelText) -> LabelText {
let prefix = self.pre_escaped_content().to_string();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

into_string would be more efficient (even more efficient would be preallocating with String::with_capacity and push_str'ing to built it... but that's a lot more effort than adding two characters, likely for little gain).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like there's a bunch of old stuff lying around in here that seems inefficient (e.g. the .escape_default().to_string() above seems unnecessary).

I'll try to address those issues in tandem with this.

@pnkfelix
Copy link
Member Author

pnkfelix commented Jul 7, 2014

re r? @huonw ? (or r? anyone, really...)

@pnkfelix
Copy link
Member Author

(rebased; r? anyone )

@alexcrichton
Copy link
Member

r=me, just one minor comment

Use one or more of the following `-Z` flag options to tell the
graphviz renderer to include the corresponding dataflow sets (after
the iterative constraint propagation reaches a fixed-point solution):

  * `-Z flowgraph-print-loans` : loans computed via middle::borrowck
  * `-Z flowgraph-print-moves` : moves computed via middle::borrowck::move_data
  * `-Z flowgraph-print-assigns` : assignments, via middle::borrowck::move_data
  * `-Z flowgraph-print-all` : all of the available sets are included.

Fix rust-lang#15016.

----

This also adds a module, `syntax::ast_map::blocks`, that captures a
common abstraction shared amongst code blocks and procedure-like
things.  As part of this, moved `ast_map.rs` to subdir
`ast_map/mod.rs`, to follow our directory layout conventions.

(incorporated review feedback from huon, acrichto.)
bors added a commit that referenced this pull request Jul 15, 2014
…excrichton

Use one or more of the following `-Z` flag options to tell the
graphviz renderer to include the corresponding dataflow sets (after
the iterative constraint propagation reaches a fixed-point solution):

  * `-Z flowgraph-print-loans` : loans computed via middle::borrowck
  * `-Z flowgraph-print-moves` : moves computed via middle::borrowck::move_data
  * `-Z flowgraph-print-assigns` : assignments, via middle::borrowck::move_data
  * `-Z flowgraph-print-all` : all of the available sets are included.

Fix #15016.
@bors bors closed this Jul 15, 2014
@bors bors merged commit e64f594 into rust-lang:master Jul 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

side project: include dataflow analysis/analyses in --pretty flowgraph
5 participants