Class BusyExprStore
java.lang.Object
org.checkerframework.dataflow.busyexpr.BusyExprStore
- All Implemented Interfaces:
Store<BusyExprStore>
A busy expression store contains a set of busy expressions 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 BusyExprStore.BusyExprStore(@Growable @Shrinkable Set<BusyExprValue> busyExprValueSet) Creates a new BusyExprStore. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds expressions to the store, and adds sub-expressions to the store recursively.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.booleanexprContainsVariable(Node expr, Node var) Returns true if the expression contains variable var.inthashCode()voidkillBusyExpr(Node var) Kills expressions if they contain variable var.leastUpperBound(BusyExprStore other) Computes the least upper bound of two stores.voidAdds busy expression e to the busy expression value set.toString()visualize(CFGVisualizer<?, BusyExprStore, ?> viz) Delegates visualization responsibility to a visualizer.widenedUpperBound(BusyExprStore previous) Computes an upper bound of two stores that is wider than the least upper bound of the two stores.
-
Constructor Details
-
BusyExprStore
Creates a new BusyExprStore.- Parameters:
busyExprValueSet- a set of busy expression abstract values. The parameter is captured and the caller should not retain an alias.
-
BusyExprStore
public BusyExprStore()Creates a new BusyExprStore.
-
-
Method Details
-
killBusyExpr
Kills expressions if they contain variable var.- Parameters:
var- a variable
-
exprContainsVariable
Returns true if the expression contains variable var. Note that.equalsis used in the return statement to verify value equality, as the statement decides whether the two nodes have the same value, not whether they represent the same CFG node.- Parameters:
expr- the expression checkedvar- the variable- Returns:
- true if the expression contains the variable
-
putBusyExpr
Adds busy expression e to the busy expression value set.- Parameters:
e- the busy expression to be added
-
addUseInExpression
Adds expressions to the store, and adds sub-expressions to the store recursively.- Parameters:
e- the expression to be added
-
copy
Description copied from interface:StoreReturns an exact copy of this store.- Specified by:
copyin interfaceStore<BusyExprStore>- 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<BusyExprStore>
- Does not change
-
widenedUpperBound
Description copied from interface:StoreComputes an upper bound of two stores that is wider than the least upper bound of the two stores. Used to jump to a higher abstraction to allow faster termination of the fixed point computations inAnalysis.previousmust be the previous store.A particular analysis might not require widening and should implement this method by calling leastUpperBound.
Important: This method must fulfill the following contract:
- Does not change
this. - Does not change
previous. - 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:
widenedUpperBoundin interfaceStore<BusyExprStore>- Parameters:
previous- must be the previous store
- Does not change
-
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<BusyExprStore>- 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<BusyExprStore>- Parameters:
viz- the visualizer to visualize this store- Returns:
- the String representation of this store
-
toString
-
equals
Description copied from interface:StoreReturns true if this is equal to the given argument.- Specified by:
equalsin interfaceStore<BusyExprStore>- 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()
-