Class LiveVarStore
java.lang.Object
org.checkerframework.dataflow.livevariable.LiveVarStore
- All Implemented Interfaces:
Store<LiveVarStore>
A live variable store contains a set of live variables represented by nodes.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.checkerframework.dataflow.analysis.Store
Store.FlowRule, Store.Kind
-
Constructor Summary
ConstructorDescriptionCreate a new LiveVarStore.LiveVarStore
(Set<LiveVarValue> liveVarValueSet) Create a new LiveVarStore. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUseInExpression
(Node expression) Add the information of live variables in an expression to the live variable set.boolean
Can the objectsa
andb
be aliases? Returns a conservative answer (i.e., returnstrue
if not enough information is available to determine aliasing).copy()
Returns an exact copy of this store.boolean
Returns true if this is equal to the given argument.int
hashCode()
void
killLiveVar
(LiveVarValue variable) Remove the information of a live variable from the live variable set.leastUpperBound
(LiveVarStore other) Compute the least upper bound of two stores.void
putLiveVar
(LiveVarValue variable) Add the information of a live variable into the live variable set.toString()
visualize
(CFGVisualizer<?, LiveVarStore, ?> viz) Delegate visualization responsibility to a visualizer.widenedUpperBound
(LiveVarStore previous) It should not be called since it is not used by the backward analysis.
-
Constructor Details
-
LiveVarStore
public LiveVarStore()Create a new LiveVarStore. -
LiveVarStore
Create a new LiveVarStore.- Parameters:
liveVarValueSet
- a set of live variable abstract values
-
-
Method Details
-
putLiveVar
Add the information of a live variable into the live variable set.- Parameters:
variable
- a live variable
-
killLiveVar
Remove the information of a live variable from the live variable set.- Parameters:
variable
- a live variable
-
addUseInExpression
Add the information of live variables in an expression to the live variable set.- Parameters:
expression
- a node
-
equals
Description copied from interface:Store
Returns true if this is equal to the given argument.- Specified by:
equals
in interfaceStore<LiveVarStore>
- Overrides:
equals
in classObject
- Parameters:
obj
- the object to compare against this- Returns:
- true if this is equal to the given argument
-
hashCode
public int hashCode() -
copy
Description copied from interface:Store
Returns an exact copy of this store.- Specified by:
copy
in interfaceStore<LiveVarStore>
- Returns:
- an exact copy of this store
-
leastUpperBound
Description copied from interface:Store
Compute the least upper bound of two stores.Important: This method must fulfill the following contract:
- Does not change
this
. - Does not change
other
. - Returns a fresh object which is not aliased yet.
- Returns an object of the same (dynamic) type as
this
, even if the signature is more permissive. - Is commutative.
- Specified by:
leastUpperBound
in interfaceStore<LiveVarStore>
- Does not change
-
widenedUpperBound
It should not be called since it is not used by the backward analysis.- Specified by:
widenedUpperBound
in interfaceStore<LiveVarStore>
- Parameters:
previous
- must be the previous store
-
canAlias
Description copied from interface:Store
Can the objectsa
andb
be aliases? Returns a conservative answer (i.e., returnstrue
if not enough information is available to determine aliasing).- Specified by:
canAlias
in interfaceStore<LiveVarStore>
-
visualize
Description copied from interface:Store
Delegate visualization responsibility to a visualizer.- Specified by:
visualize
in interfaceStore<LiveVarStore>
- Parameters:
viz
- the visualizer to visualize this store- Returns:
- the String representation of this store
-
toString
-