-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add reaching definitions analysis #181
Conversation
…uild.gradle under dataflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first round of comments.
...w/src/main/java/org/checkerframework/dataflow/reachdefinitions/ReachDefinitionsTransfer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my previous feedback. Maybe you can also take a look at my comments in #177 because these two PRs have similar structure.
...rc/main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsStore.java
Outdated
Show resolved
Hide resolved
...main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsTransfer.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsValue.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File .gitignore
needs to add the new generated files as ignorable. After running the tests, git status
shouldn't show Out.txt
and the class files in the new test directory as new.
...rc/main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsStore.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsStore.java
Outdated
Show resolved
Hide resolved
...main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsTransfer.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsValue.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsValue.java
Outdated
Show resolved
Hide resolved
dataflow/src/test/java/reachingdefinitions/ReachingDefinitions.java
Outdated
Show resolved
Hide resolved
…uild.gradle under dataflow
…uild.gradle under dataflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Another round of comments.
|
||
/** | ||
* A ReachingDefinitionsNode contains a CFG node, which can only be a AssignmentNode. It is used to | ||
* represent the estimate of reaching definitions at certain CFG block during dataflow analysis. We |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plural in reaching definitions
is odd, as there is only a single AssignmentNode
field. So should this be singular, in the description and class name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks!
...rc/main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsStore.java
Outdated
Show resolved
Hide resolved
ReachingDefinitionsNode generatedDefNode = it.next(); | ||
// It's preferred to use "==" to compare two nodes in checker framework, | ||
// but in this case we use `equals` to only measure value equality. | ||
// If we use "==", two expressions from different nodes with same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try to reword? Something reads odd here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
} | ||
|
||
/** | ||
* Add the information of a reaching definition into the reaching definitions set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Add the information of a reaching definition into the reaching definitions set. | |
* Add a reaching definition to the reaching definitions set. |
/** We do not call widenedUpperBound in this analysis. */ | ||
@Override | ||
public ReachingDefinitionsStore widenedUpperBound(ReachingDefinitionsStore previous) { | ||
throw new BugInCF("wub of reaching definitions get called!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! According to BusyExpr, I removed it.
...main/java/org/checkerframework/dataflow/reachingdefinitions/ReachingDefinitionsTransfer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
In the end run ./gradlew reformat
to fix the formatting issues.
dataflow/src/main/java/org/checkerframework/dataflow/reachingdef/ReachingDefinitionStore.java
Outdated
Show resolved
Hide resolved
dataflow/src/main/java/org/checkerframework/dataflow/reachingdef/ReachingDefinitionStore.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.