forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UnusedAbstractValue and improve LiveVarAnalysis (#203)
Co-authored-by: Werner Dietl <wdietl@gmail.com> Co-authored-by: zcai <z44cai@uwaterloo.ca>
- Loading branch information
1 parent
567084f
commit 4a1e09d
Showing
7 changed files
with
111 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
23 changes: 23 additions & 0 deletions
23
dataflow/src/main/java/org/checkerframework/dataflow/analysis/UnusedAbstractValue.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.checkerframework.dataflow.analysis; | ||
|
||
import org.checkerframework.javacutil.BugInCF; | ||
|
||
/** | ||
* UnusedAbstractValue is an AbstractValue that is not involved in any lub computation during | ||
* dataflow analysis. For those analyses which handle lub computation at a higher level (e.g., store | ||
* level), it is sufficient to use UnusedAbstractValue and unnecessary to implement another specific | ||
* AbstractValue. Example analysis using UnusedAbstractValue is LiveVariable analysis. This is a | ||
* workaround for issue https://github.com/eisop/checker-framework/issues/200 | ||
*/ | ||
public final class UnusedAbstractValue implements AbstractValue<UnusedAbstractValue> { | ||
|
||
/** This class cannot be instantiated */ | ||
private UnusedAbstractValue() { | ||
throw new AssertionError("Class UnusedAbstractValue cannot be instantiated."); | ||
} | ||
|
||
@Override | ||
public UnusedAbstractValue leastUpperBound(UnusedAbstractValue other) { | ||
throw new BugInCF("UnusedAbstractValue.leastUpperBound was called!"); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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