added dead branch analysis to CF and constant value checker#153
Closed
txiang61 wants to merge 16 commits intoopprop:masterfrom
txiang61:dead_branch
Closed
added dead branch analysis to CF and constant value checker#153txiang61 wants to merge 16 commits intoopprop:masterfrom txiang61:dead_branch
txiang61 wants to merge 16 commits intoopprop:masterfrom
txiang61:dead_branch
Conversation
…er (typetools#3396) This change is need for AnnotatedTypeCopierWithReplacement to behave correctly for primitives. Similar to visitNull, we want the primitives to have the annotations to be replaced. This PR also includes a small refactoring of the AnnotatedTypeCopier.
wmdietl
reviewed
Jul 20, 2020
Member
wmdietl
left a comment
There was a problem hiding this comment.
A few comments about the rough structure. Let's discuss in detail.
dataflow/src/main/java/org/checkerframework/dataflow/analysis/ConditionEvaluator.java
Outdated
Show resolved
Hide resolved
dataflow/src/main/java/org/checkerframework/dataflow/analysis/ConditionEvaluator.java
Outdated
Show resolved
Hide resolved
framework/src/main/java/org/checkerframework/common/value/ValueAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Override | ||
| public ConditionalFlow visitEqualTo(EqualToNode node, TransferInput<CFValue, CFStore> in) { | ||
| CFValue leftValue = in.getValueOfSubNode(node.getLeftOperand()); |
Member
There was a problem hiding this comment.
The first five lines of all these methods are the same. Can you extract that logic and pass in a lambda with the body of the then branches?
| Map<Node, Constant> contents; | ||
|
|
||
| /** Indicate whether this store is in a dead branch or not. */ | ||
| private boolean deadBranch = false; |
Member
There was a problem hiding this comment.
Why have a field here and in the super class?
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.
No description provided.