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
ConstructorsConstructorDescriptionCreates a new LiveVarStore.LiveVarStore(Set<LiveVarNode> liveVarNodeSet) Creates a new LiveVarStore. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUseInExpression(Node expression) Adds the information of live variables in an expression to the live variable set.booleanReturns true if the objectsaandbcan be aliases.copy()Returns an exact copy of this store.booleanReturns true if this is equal to the given argument.inthashCode()voidkillLiveVar(LiveVarNode variable) Removes the information of a live variable from the live variable set.leastUpperBound(LiveVarStore other) Computes the least upper bound of two stores.voidputLiveVar(LiveVarNode variable) Adds the information of a live variable into the live variable set.toString()visualize(CFGVisualizer<?, LiveVarStore, ?> viz) Delegates visualization responsibility to a visualizer.widenedUpperBound(LiveVarStore previous) This method should not be called, since it is not used by the backward analysis.
-
Constructor Details
-
LiveVarStore
public LiveVarStore()Creates a new LiveVarStore. -
LiveVarStore
Creates a new LiveVarStore.- Parameters:
liveVarNodeSet- the set of live variable nodes. The parameter is captured and the caller should not retain an alias.
-
-
Method Details
-
putLiveVar
Adds the information of a live variable into the live variable set.- Parameters:
variable- a live variable
-
killLiveVar
Removes the information of a live variable from the live variable set.- Parameters:
variable- a live variable
-
addUseInExpression
Adds the information of live variables in an expression to the live variable set.- Parameters:
expression- a node
-
equals
Description copied from interface:StoreReturns true if this is equal to the given argument.- Specified by:
equalsin interfaceStore<LiveVarStore>- Overrides:
equalsin 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:StoreReturns an exact copy of this store.- Specified by:
copyin interfaceStore<LiveVarStore>- Returns:
- an exact copy of this store
-
leastUpperBound
Description copied from interface:StoreComputes 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:
leastUpperBoundin interfaceStore<LiveVarStore>
- Does not change
-
widenedUpperBound
This method should not be called, since it is not used by the backward analysis.- Specified by:
widenedUpperBoundin interfaceStore<LiveVarStore>- Parameters:
previous- must be the previous store
-
canAlias
Description copied from interface:StoreReturns true if the objectsaandbcan be aliases. Returns a conservative answer (i.e., returnstrueif not enough information is available to determine aliasing).- Specified by:
canAliasin interfaceStore<LiveVarStore>- Parameters:
a- a Java expressionb- a Java expression- Returns:
- true if
aandbcan be aliases
-
visualize
Description copied from interface:StoreDelegates visualization responsibility to a visualizer.- Specified by:
visualizein interfaceStore<LiveVarStore>- Parameters:
viz- the visualizer to visualize this store- Returns:
- the String representation of this store
-
toString
-