Class AbstractFlowAnalysis<F>

java.lang.Object
sootup.analysis.intraprocedural.AbstractFlowAnalysis<F>
Type Parameters:
F - abstraction type for the Facts
Direct Known Subclasses:
FlowAnalysis

public abstract class AbstractFlowAnalysis<F> 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 Details

  • Constructor Details

    • AbstractFlowAnalysis

      public AbstractFlowAnalysis(ControlFlowGraph<? extends BasicBlock<?>> graph)
      Constructs a flow analysis on the given ControlFlowGraph.
  • Method Details

    • newInitialFlow

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

      protected F entryInitialFlow()
      Returns the initial flow value for entry/ exit graph nodes.
    • treatTrapHandlersAsEntries

      protected boolean treatTrapHandlersAsEntries()
      Determines whether entryInitialFlow() is applied to trap handlers.
    • isForward

      protected abstract boolean isForward()
      Returns true if this analysis is forwards.
    • merge

      protected abstract void merge(@NonNull F in1, @NonNull F in2, @NonNull F 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(@NonNull Stmt succNode, @NonNull F in1, @NonNull F in2, @NonNull F 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(@NonNull F source, @NonNull F dest)
      Creates a copy of the source flow object in dest.
    • execute

      protected abstract void execute()
      Carries out the actual flow analysis. Typically called from a concrete FlowAnalysis's constructor.
    • getFlowBefore

      public @NonNull F getFlowBefore(@NonNull Stmt s)
      Accessor function returning value of IN set for s.
    • mergeInto

      protected void mergeInto(@NonNull Stmt succNode, @NonNull F inout, @NonNull F in)
      Merges in into inout, just before node succNode.