Package soot.toolkits.scalar
Class FlowAnalysis<N,A>
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
-
- soot.toolkits.scalar.FlowAnalysis<N,A>
-
- Direct Known Subclasses:
BackwardFlowAnalysis,ForwardFlowAnalysis
public abstract class FlowAnalysis<N,A> extends AbstractFlowAnalysis<N,A>
An abstract class providing a framework for carrying out dataflow analysis. Subclassing either BackwardFlowAnalysis or ForwardFlowAnalysis and providing implementations for the abstract methods will allow Soot to compute the corresponding flow analysis.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFlowAnalysis.Flow
-
Field Summary
Fields Modifier and Type Field Description protected Map<N,A>filterUnitToAfterFlowFiltered: Maps graph nodes to OUT sets.protected Map<N,A>unitToAfterFlowMaps graph nodes to OUT sets.-
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
filterUnitToBeforeFlow, graph, unitToBeforeFlow
-
-
Constructor Summary
Constructors Constructor Description FlowAnalysis(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 voidcopyFreshToExisting(A in, A dest)Copies a *fresh* copy of in to dest.protected abstract voidflowThrough(A in, N d, A out)Given the merge of theoutsets, compute theinset fors(or in to out, depending on direction).protected FlowAnalysis.FlowgetFlow(N from, N mergeNode)You can specify which flow set you would like to use of nodefromAgetFlowAfter(N s)Accessor function returning value of OUT set for s.AgetFlowBefore(N s)Accessor function returning value of IN set for s.protected booleanomissible(N n)If a flow node can be omitted returntrue, otherwisefalse.-
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
copy, doAnalysis, entryInitialFlow, isForward, merge, merge, mergeInto, newInitialFlow, treatTrapHandlersAsEntries
-
-
-
-
Constructor Detail
-
FlowAnalysis
public FlowAnalysis(DirectedGraph<N> graph)
Constructs a flow analysis on the givenDirectedGraph.
-
-
Method Detail
-
flowThrough
protected abstract void flowThrough(A in, N d, A out)
Given the merge of theoutsets, compute theinset fors(or in to out, depending on direction). This function often causes confusion, because the same interface is used for both forward and backward flow analyses. The first parameter is always the argument to the flow function (i.e. it is the "in" set in a forward analysis and the "out" set in a backward analysis), and the third parameter is always the result of the flow function (i.e. it is the "out" set in a forward analysis and the "in" set in a backward analysis).- Parameters:
in- the input flowd- the current nodeout- the returned flow
-
getFlowBefore
public A getFlowBefore(N s)
Description copied from class:AbstractFlowAnalysisAccessor function returning value of IN set for s.- Overrides:
getFlowBeforein classAbstractFlowAnalysis<N,A>
-
omissible
protected boolean omissible(N n)
If a flow node can be omitted returntrue, otherwisefalse. There is no guarantee a node will be omitted. A omissible node does not influence the result of an analysis. If you are unsure, don't overwrite this method- Parameters:
n- the node to check- Returns:
false
-
getFlow
protected FlowAnalysis.Flow getFlow(N from, N mergeNode)
You can specify which flow set you would like to use of nodefrom- Parameters:
from-mergeNode-- Returns:
- Flow.OUT
-
-