Conversation
3 tasks
cirras
requested changes
Sep 8, 2026
cirras
left a comment
Collaborator
There was a problem hiding this comment.
Some feedback items to address, but this is looking great. Looking forward to getting this new rule into the analysis.
Collaborator
Author
|
Oops, I didn't mean to commit the test that failed CI. |
Raise statements have an optional `at expression` which should be accessible through the API.
cirras
requested changes
Sep 9, 2026
cirras
requested changes
Sep 10, 2026
A control flow graph is tied more closely to a statement list, rather than a routine implementation. That is because all statement lists can have a control flow graph, particularly `initialization` and `finalization` sections.
This provides the node the control flow graph was constructed from. This will allow consumers to reason about the surrounding context, e.g., subroutines, when using a `ControlFlowGraph`.
cirras
approved these changes
Sep 11, 2026
cirras
left a comment
Collaborator
There was a problem hiding this comment.
I think this is ready to go. Nice work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements #455.
There are two main parts to this PR. Other than the Check, nothing is slated to be added to the public API; everything remains internal.
1. Live variable analysis
The
BlockDataFlowVisitorinspects a single Block, notifying its call site of usages and assignments to variables.LocalDataFlowPropertiesrepresent what variables are assigned or used before assignment for a block. This is a fundamental building block for live variable analysis.LiveVariablescontain the information about which variables are alive coming in and going out of a given block. Additionally, there is some other information about the entire graph that comes in handy when implementing the dead store check.To support these changes, a
LiveVariableinterface was added to abstract across name declarations and references.2. Dead store check
This is the first check that uses variable liveness to add issues. High-level, this check raises issues on assignments of variables that aren't subsequently used, either by going out of scope or being reassigned.
Other changes
Some other changes were made in service of improving the modelling of control flow graphs.