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

Def-use analysis for parsers and controls #93

Merged
merged 3 commits into from
Sep 28, 2016
Merged

Def-use analysis for parsers and controls #93

merged 3 commits into from
Sep 28, 2016

Conversation

mihaibudiu
Copy link
Contributor

Detection of uninitialized variables and fields built on top of def-use analysis.
testdata should not be in .gitignore

@ChrisDodd
Copy link
Contributor

When I look at this code, it seems like it is duplicating most of the functionality of ControlFlowVisitor and P4WriteContext, so it seems like it could be simplified by using those Visitor mixins.

@ChrisDodd ChrisDodd merged commit a467c1e into p4lang:master Sep 28, 2016
@mihaibudiu
Copy link
Contributor Author

There are some similarities, but I have a hard time wrapping my head around the way these mixins split the work among themselves. There is only one example in the front-end, the DoLocalCopyPropagation, which does not handle many statements, and seems to be broken currently (it does nothing, in part because it is run at the wrong point in the pass sequence).

Also, the def-use analysis handles loops in parsers and does inter-procedural analysis for controls (invoking tables and actions). It's conceivable that the visiting part could be refactored into a subclass of ControlFlowVisitor, and perhaps we should consider doing this at some point.

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.

2 participants