Class AbstractInterDataflowAnalysis<Method,Node,Fact>

java.lang.Object
pascal.taie.analysis.Analysis
pascal.taie.analysis.ProgramAnalysis<DataflowResult<Node,Fact>>
pascal.taie.analysis.dataflow.inter.AbstractInterDataflowAnalysis<Method,Node,Fact>
Type Parameters:
Method - type of ICFG edges
Node - type of ICFG nodes
Fact - type of data-flow facts
All Implemented Interfaces:
InterDataflowAnalysis<Node,Fact>
Direct Known Subclasses:
InterConstantPropagation

public abstract class AbstractInterDataflowAnalysis<Method,Node,Fact> extends ProgramAnalysis<DataflowResult<Node,Fact>> implements InterDataflowAnalysis<Node,Fact>
Provides common functionalities for InterDataflowAnalysis implementations.
  • Field Details

  • Constructor Details

    • AbstractInterDataflowAnalysis

      public AbstractInterDataflowAnalysis(AnalysisConfig config)
  • Method Details

    • initialize

      protected void initialize()
      If the concrete analysis needs to perform some initialization before the solver starts, then it can overwrite this method.
    • finish

      protected void finish()
      If the concrete analysis needs to perform some finishing work after the solver finishes, then it can overwrite this method.
    • transferNode

      public boolean transferNode(Node node, Fact in, Fact out)
      Dispatches Node to specific node transfer functions for call nodes and non-call nodes.
      Specified by:
      transferNode in interface InterDataflowAnalysis<Method,Node>
      Returns:
      true if the transfer changed the out (int) fact, otherwise false.
    • transferCallNode

      protected abstract boolean transferCallNode(Node node, Fact in, Fact out)
      Transfer function for call node.
    • transferNonCallNode

      protected abstract boolean transferNonCallNode(Node node, Fact in, Fact out)
      Transfer function for non-call node.
    • transferEdge

      public Fact transferEdge(ICFGEdge<Node> edge, Fact out)
      Dispatches ICFGEdge to specific edge transfer functions according to the concrete type of ICFGEdge.
      Specified by:
      transferEdge in interface InterDataflowAnalysis<Method,Node>
      Parameters:
      edge - the ICFG edge that the transfer function is applied on.
      out - the OUT fact of source node of the edge.
      Returns:
      the result of edge transfer function.
    • transferNormalEdge

      protected abstract Fact transferNormalEdge(NormalEdge<Node> edge, Fact out)
    • transferCallToReturnEdge

      protected abstract Fact transferCallToReturnEdge(CallToReturnEdge<Node> edge, Fact out)
    • transferCallEdge

      protected abstract Fact transferCallEdge(CallEdge<Node> edge, Fact callSiteOut)
    • transferReturnEdge

      protected abstract Fact transferReturnEdge(ReturnEdge<Node> edge, Fact returnOut)
    • analyze

      public DataflowResult<Node,Fact> analyze()
      Description copied from class: ProgramAnalysis
      Runs this analysis for the whole program. If the result is not used by following analyses, then this method should return null.
      Specified by:
      analyze in class ProgramAnalysis<DataflowResult<Node,Fact>>
      Returns:
      the analysis result for the whole program. The result will be stored in World.