S
- the Store
used to keep track of intermediate resultspublic abstract class TransferResult<A extends AbstractValue<A>,S extends Store<S>> extends Object
TransferResult
is used as the result type of the individual transfer functions of a
TransferFunction
. It always belongs to the result of the individual transfer function for
a particular Node
, even though that org.checkerframework.dataflow.cfg.node.Node
is not explicitly store in TransferResult
.
A TransferResult
contains one or two stores (for 'then' and 'else'), and zero or more
stores with a cause (TypeMirror
).
Modifier and Type | Field and Description |
---|---|
protected @Nullable Map<TypeMirror,S> |
exceptionalStores
The stores in case the basic block throws an exception (or
null if the corresponding
Node does not throw any exceptions). |
protected A |
resultValue
The abstract value of the
Node associated with
this TransferResult , or null if no value has been produced. |
Constructor and Description |
---|
TransferResult(A resultValue,
@Nullable Map<TypeMirror,S> exceptionalStores) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
containsTwoStores() |
abstract S |
getElseStore() |
S |
getExceptionalStore(TypeMirror exception) |
Map<TypeMirror,S> |
getExceptionalStores() |
abstract S |
getRegularStore() |
A |
getResultValue() |
abstract S |
getThenStore() |
void |
setResultValue(A resultValue) |
abstract boolean |
storeChanged() |
protected final @Nullable Map<TypeMirror,S extends Store<S>> exceptionalStores
null
if the corresponding
Node
does not throw any exceptions). Does not
necessarily contain a store for every exception, in which case the in-store will be used.protected A extends AbstractValue<A> resultValue
Node
associated with
this TransferResult
, or null
if no value has been produced.public TransferResult(A resultValue, @Nullable Map<TypeMirror,S> exceptionalStores)
public A getResultValue()
public void setResultValue(A resultValue)
public abstract S getRegularStore()
Node
corresponding to this transfer function
result.public abstract S getThenStore()
Node
this result belongs to evaluates to true
.public abstract S getElseStore()
Node
this result belongs to evaluates to false
.public S getExceptionalStore(TypeMirror exception)
exception
(or null
if no special handling is required for exceptional edges).public Map<TypeMirror,S> getExceptionalStores()
TypeMirror
to Store
getExceptionalStore(TypeMirror)
public abstract boolean containsTwoStores()
true
if and only if this transfer result contains two stores that are
potentially not equal. Note that the result true
does not imply that getRegularStore
cannot be called (or vice versa for false
). Rather, it indicates
that getThenStore
or getElseStore
can be used to give more precise
results. Otherwise, if the result is false
, then all three methods getRegularStore
, getThenStore
, and getElseStore
return equivalent
stores.public abstract boolean storeChanged()
true
if and only if the transfer function returning this transfer result
changed the regularStore, elseStore, or thenStore.