Class ForwardFlowAnalysisExtended<N,​A>


  • public abstract class ForwardFlowAnalysisExtended<N,​A>
    extends Object
    Abstract class that provides a fixed-point iteration for forward flow analyses that need to distinguish between the different successors of a unit in an exceptional unit graph. Note that this class does not extend FlowAnalysis as it has a different definition of a flow function (namely one that does not only include the current unit, but also the successor). For the same reason, it does not integrate into the interactive analysis infrastructure of Soot either.
    Author:
    Steven Arzt
    • Field Detail

      • unitToBeforeFlow

        protected Map<N,​Map<N,​A>> unitToBeforeFlow
        Maps graph nodes to IN sets.
      • unitToAfterFlow

        protected Map<N,​Map<N,​A>> unitToAfterFlow
        Maps graph nodes to OUT sets.
    • Constructor Detail

      • ForwardFlowAnalysisExtended

        public ForwardFlowAnalysisExtended​(DirectedGraph<N> graph)
        Construct the analysis from a DirectedGraph representation of a Body.
    • Method Detail

      • constructOrderer

        protected Orderer<N> constructOrderer()
        Default implementation constructing a PseudoTopologicalOrderer.
        Returns:
        an Orderer to order the nodes for the fixed-point iteration
      • newInitialFlow

        protected abstract A newInitialFlow()
        Returns the flow object corresponding to the initial values for each graph node.
      • entryInitialFlow

        protected abstract A entryInitialFlow()
        Returns the initial flow value for entry/exit graph nodes.
      • copy

        protected abstract void copy​(A source,
                                     A dest)
        Creates a copy of the source flow object in dest.
      • merge

        protected abstract void merge​(A in1,
                                      A in2,
                                      A out)
        Compute the merge of the 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.
      • 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.
      • mergeInto

        protected void mergeInto​(N succNode,
                                 A inout,
                                 A in)
        Merges in into inout, just before node succNode.
      • getFromMap

        public A getFromMap​(Map<N,​Map<N,​A>> map,
                            N s,
                            N t)
      • putToMap

        public void putToMap​(Map<N,​Map<N,​A>> map,
                             N s,
                             N t,
                             A val)
      • doAnalysis

        protected void doAnalysis()
      • flowThrough

        protected abstract void flowThrough​(A in,
                                            N cur,
                                            N next,
                                            A out)
      • getFlowBefore

        public A getFlowBefore​(N s)
        Accessor function returning value of IN set for s.