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

flowgraph: extend cfg to support whole fn item rather than just a block #15020

Closed
pnkfelix opened this issue Jun 18, 2014 · 3 comments
Closed
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

There's a fixme that landed in the dataflow-atop-cfg work:
75340f4#diff-158b34791d327b238be103c2d1867e71R195

In summary: right now there is a bit of a hack in the dataflow code to introduce definitions for all of the patterns bound by the fn_decl for the fn item being analyzed.

It might be much cleaner to just fold all those formals into the graph structure itself, by extending the cfg code so that, in addition to accepting a block as it does today, it also accepts a whole fn item, and then does the right thing for the bindings introduced by the fn_decl.

@pnkfelix
Copy link
Member Author

Note that PR #15371 already extended the --pretty flowgraph interface to accept the node id for an fn item. That's at best tangentially related to the implementation effort outlined in this ticket (which is more about the API for rustc::middle::cfg itself, rather than the command line options presented by rustc::driver), but still: the front-end basics to support this are already in place. :)

@steveklabnik steveklabnik added the A-frontend Area: Compiler frontend (errors, parsing and HIR) label Jan 23, 2015
@steveklabnik
Copy link
Member

Triage: this is a very old ticket, which is a bit in the weeds... but I read this as saying "cfg should work on fn items", which does work? It's not clear to me.

@Mark-Simulacrum Mark-Simulacrum added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 21, 2017
@Mark-Simulacrum
Copy link
Member

per #51002 I'm going to close this as we're trying to kill of cfg entirely

lnicola pushed a commit to lnicola/rust that referenced this issue Jun 19, 2023
Count query entries in memory usage command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants