soot.toolkits.scalar
Class FlowAnalysis<N,A>

java.lang.Object
  extended by soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
      extended by 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.


Field Summary
protected  Map<N,A> filterUnitToAfterFlow
          Filtered: Maps graph nodes to OUT sets.
protected  Map<N,A> unitToAfterFlow
          Maps graph nodes to OUT sets.
 
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
filterUnitToBeforeFlow, graph, unitToBeforeFlow
 
Constructor Summary
FlowAnalysis(DirectedGraph<N> graph)
          Constructs a flow analysis on the given DirectedGraph.
 
Method Summary
protected  Orderer<N> constructOrderer()
          Default implementation constructing a PseudoTopologicalOrderer.
protected abstract  void flowThrough(A in, N d, A out)
          Given the merge of the out sets, compute the in set for s (or in to out, depending on direction).
 A getFlowAfter(N s)
          Accessor function returning value of OUT set for s.
 
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
copy, doAnalysis, entryInitialFlow, getFlowBefore, isForward, merge, merge, mergeInto, newInitialFlow, treatTrapHandlersAsEntries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unitToAfterFlow

protected Map<N,A> unitToAfterFlow
Maps graph nodes to OUT sets.


filterUnitToAfterFlow

protected Map<N,A> filterUnitToAfterFlow
Filtered: Maps graph nodes to OUT sets.

Constructor Detail

FlowAnalysis

public FlowAnalysis(DirectedGraph<N> graph)
Constructs a flow analysis on the given DirectedGraph.

Method Detail

flowThrough

protected abstract void flowThrough(A in,
                                    N d,
                                    A out)
Given the merge of the out sets, compute the in set for s (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).


getFlowAfter

public A getFlowAfter(N s)
Accessor function returning value of OUT set for s.


constructOrderer

protected Orderer<N> constructOrderer()
Default implementation constructing a PseudoTopologicalOrderer.

Returns:
an Orderer to order the nodes for the fixed-point iteration