A
- type of the abstract value that is tracked.public class AnalysisResult<A extends AbstractValue<A>,S extends Store<S>> extends Object
AnalysisResult
represents the result of a org.checkerframework.dataflow analysis by
providing the abstract values given a node or a tree. Note that it does not
keep track of custom results computed by some analysis.Modifier and Type | Field and Description |
---|---|
protected HashMap<Element,A> |
finalLocalValues
Map from (effectively final) local variable elements to their abstract value.
|
protected IdentityHashMap<Node,A> |
nodeValues
Abstract values of nodes.
|
protected IdentityHashMap<Block,TransferInput<A,S>> |
stores
The stores before every method call.
|
protected IdentityHashMap<Tree,Node> |
treeLookup
|
Constructor and Description |
---|
AnalysisResult()
Initialize empty result.
|
AnalysisResult(Map<Node,A> nodeValues,
IdentityHashMap<Block,TransferInput<A,S>> stores,
IdentityHashMap<Tree,Node> treeLookup,
HashMap<Element,A> finalLocalValues)
Initialize with a given node-value mapping.
|
Modifier and Type | Method and Description |
---|---|
void |
combine(AnalysisResult<A,S> other)
Combine with another analysis result.
|
HashMap<Element,A> |
getFinalLocalValues() |
@Nullable Node |
getNodeForTree(Tree tree) |
S |
getStoreAfter(Tree tree) |
S |
getStoreBefore(Tree tree) |
A |
getValue(Node n) |
A |
getValue(Tree t) |
protected S |
runAnalysisFor(Node node,
boolean before)
Runs the analysis again within the block of
node and returns the
store at the location of node . |
static <A extends AbstractValue<A>,S extends Store<S>> |
runAnalysisFor(Node node,
boolean before,
TransferInput<A,S> transferInput)
Runs the analysis again within the block of
node and returns the
store at the location of node . |
protected final IdentityHashMap<Node,A extends AbstractValue<A>> nodeValues
protected final IdentityHashMap<Tree,Node> treeLookup
protected final HashMap<Element,A extends AbstractValue<A>> finalLocalValues
protected final IdentityHashMap<Block,TransferInput<A extends AbstractValue<A>,S extends Store<S>>> stores
public AnalysisResult(Map<Node,A> nodeValues, IdentityHashMap<Block,TransferInput<A,S>> stores, IdentityHashMap<Tree,Node> treeLookup, HashMap<Element,A> finalLocalValues)
public AnalysisResult()
public void combine(AnalysisResult<A,S> other)
public HashMap<Element,A> getFinalLocalValues()
public A getValue(Node n)
Node
n
, or null
if
no information is available.public A getValue(Tree t)
Tree
t
, or null
if
no information is available.public S getStoreBefore(Tree tree)
Tree
.protected S runAnalysisFor(Node node, boolean before)
node
and returns the
store at the location of node
. If before
is true, then
the store immediately before the Node
node
is returned.
Otherwise, the store after node
is returned.
If the given Node
cannot be reached (in the control flow graph),
then null
is returned.
public static <A extends AbstractValue<A>,S extends Store<S>> S runAnalysisFor(Node node, boolean before, TransferInput<A,S> transferInput)
node
and returns the
store at the location of node
. If before
is true, then
the store immediately before the Node
node
is returned.
Otherwise, the store after node
is returned.