N
- node type of the directed graphA
- abstraction typepublic abstract class AbstractFlowAnalysis<N,A>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<N,A> |
filterUnitToBeforeFlow
Filtered: Maps graph nodes to IN sets.
|
protected DirectedGraph<N> |
graph
The graph being analysed.
|
protected java.util.Map<N,A> |
unitToBeforeFlow
Maps graph nodes to IN sets.
|
Constructor and Description |
---|
AbstractFlowAnalysis(DirectedGraph<N> graph)
Constructs a flow analysis on the given
DirectedGraph . |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
copy(A source,
A dest)
Creates a copy of the
source flow object in dest . |
protected abstract void |
doAnalysis()
Carries out the actual flow analysis.
|
protected A |
entryInitialFlow()
Returns the initial flow value for entry/exit graph nodes.
|
A |
getFlowBefore(N s)
Accessor function returning value of IN set for s.
|
protected abstract boolean |
isForward()
Returns true if this analysis is forwards.
|
protected abstract void |
merge(A in1,
A in2,
A out)
Compute the merge of the
in1 and in2 sets, putting the result into out . |
protected void |
merge(N succNode,
A in1,
A in2,
A out)
Merges in1 and in2 into out, just before node succNode.
|
protected void |
mergeInto(N succNode,
A inout,
A in)
Merges in into inout, just before node succNode.
|
protected abstract A |
newInitialFlow()
Returns the flow object corresponding to the initial values for
each graph node.
|
protected boolean |
treatTrapHandlersAsEntries()
Determines whether
entryInitialFlow()
is applied to trap handlers. |
protected java.util.Map<N,A> filterUnitToBeforeFlow
protected DirectedGraph<N> graph
public AbstractFlowAnalysis(DirectedGraph<N> graph)
DirectedGraph
.protected abstract A newInitialFlow()
protected A entryInitialFlow()
newInitialFlow()
protected boolean treatTrapHandlersAsEntries()
entryInitialFlow()
is applied to trap handlers.protected abstract boolean isForward()
protected abstract void merge(A in1, A in2, A out)
in1
and in2
sets, putting the result into out
.
The behavior of this function depends on the implementation ( it may be necessary to check whether
in1
and in2
are equal or aliased ).
Used by the doAnalysis method.protected void merge(N succNode, A in1, A in2, A out)
protected abstract void copy(A source, A dest)
source
flow object in dest
.protected abstract void doAnalysis()