Package soot.toolkits.scalar
Class AbstractFlowAnalysis<N,A>
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
-
- Type Parameters:
N- node type of the directed graphA- abstraction type
- Direct Known Subclasses:
BranchedFlowAnalysis,FlowAnalysis
public abstract class AbstractFlowAnalysis<N,A> extends Object
An abstract class providing a meta-framework for carrying out dataflow analysis. This class provides common methods and fields required by the BranchedFlowAnalysis and FlowAnalysis abstract classes.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<N,A>filterUnitToBeforeFlowFiltered: Maps graph nodes to IN sets.protected DirectedGraph<N>graphThe graph being analysed.protected Map<N,A>unitToBeforeFlowMaps graph nodes to IN sets.
-
Constructor Summary
Constructors Constructor Description AbstractFlowAnalysis(DirectedGraph<N> graph)Constructs a flow analysis on the givenDirectedGraph.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcopy(A source, A dest)Creates a copy of thesourceflow object indest.protected abstract voiddoAnalysis()Carries out the actual flow analysis.protected AentryInitialFlow()Returns the initial flow value for entry/exit graph nodes.AgetFlowBefore(N s)Accessor function returning value of IN set for s.protected abstract booleanisForward()Returns true if this analysis is forwards.protected abstract voidmerge(A in1, A in2, A out)Compute the merge of thein1andin2sets, putting the result intoout.protected voidmerge(N succNode, A in1, A in2, A out)Merges in1 and in2 into out, just before node succNode.protected voidmergeInto(N succNode, A inout, A in)Merges in into inout, just before node succNode.protected abstract AnewInitialFlow()Returns the flow object corresponding to the initial values for each graph node.protected booleantreatTrapHandlersAsEntries()Determines whetherentryInitialFlow()is applied to trap handlers.
-
-
-
Constructor Detail
-
AbstractFlowAnalysis
public AbstractFlowAnalysis(DirectedGraph<N> graph)
Constructs a flow analysis on the givenDirectedGraph.
-
-
Method Detail
-
newInitialFlow
protected abstract A newInitialFlow()
Returns the flow object corresponding to the initial values for each graph node.
-
entryInitialFlow
protected A entryInitialFlow()
Returns the initial flow value for entry/exit graph nodes. This is equal tonewInitialFlow()
-
treatTrapHandlersAsEntries
protected boolean treatTrapHandlersAsEntries()
Determines whetherentryInitialFlow()is applied to trap handlers.
-
isForward
protected abstract boolean isForward()
Returns true if this analysis is forwards.
-
merge
protected abstract void merge(A in1, A in2, A out)
Compute the merge of thein1andin2sets, putting the result intoout. The behavior of this function depends on the implementation ( it may be necessary to check whetherin1andin2are equal or aliased ). Used by the doAnalysis method.
-
merge
protected void merge(N succNode, A in1, A in2, A out)
Merges in1 and in2 into out, just before node succNode. By default, this method just calls merge(A,A,A), ignoring the node.
-
copy
protected abstract void copy(A source, A dest)
Creates a copy of thesourceflow object indest.
-
doAnalysis
protected abstract void doAnalysis()
Carries out the actual flow analysis. Typically called from a concrete FlowAnalysis's constructor.
-
-