Class ConstantPropagation.Analysis

java.lang.Object
pascal.taie.analysis.dataflow.analysis.AbstractDataflowAnalysis<Stmt,CPFact>
pascal.taie.analysis.dataflow.analysis.constprop.ConstantPropagation.Analysis
All Implemented Interfaces:
DataflowAnalysis<Stmt,CPFact>
Enclosing class:
ConstantPropagation

public static class ConstantPropagation.Analysis extends AbstractDataflowAnalysis<Stmt,CPFact>
  • Constructor Details

    • Analysis

      public Analysis(CFG<Stmt> cfg, boolean edgeRefine)
  • Method Details

    • isForward

      public boolean isForward()
      Returns:
      true if this analysis is forward, otherwise false.
    • newBoundaryFact

      public CPFact newBoundaryFact()
      Returns:
      new fact in boundary conditions, i.e., the fact for entry (exit) node in forward (backward) analysis.
    • newBoundaryFact

      public CPFact newBoundaryFact(IR ir)
    • newInitialFact

      public CPFact newInitialFact()
      Returns:
      new initial fact for non-boundary nodes.
    • meetInto

      public void meetInto(CPFact fact, CPFact target)
      Description copied from interface: DataflowAnalysis
      Meets a fact into another (target) fact. This function will be used to handle control-flow confluences.
    • meetValue

      public Value meetValue(Value v1, Value v2)
      Meets two Values. This method computes the greatest lower bound of two Values.
    • transferNode

      public boolean transferNode(Stmt stmt, CPFact in, CPFact out)
      Description copied from interface: DataflowAnalysis
      Node Transfer function for the analysis. The function transfers data-flow from in (out) fact to out (in) fact for forward (backward) analysis.
      Returns:
      true if the transfer changed the out (in) fact, otherwise false.
    • needTransferEdge

      public boolean needTransferEdge(CFGEdge<Stmt> edge)
      Description copied from class: AbstractDataflowAnalysis
      By default, a data-flow analysis does not have edge transfer, i.e., does not need to perform transfer for any edges.
      Specified by:
      needTransferEdge in interface DataflowAnalysis<Stmt,CPFact>
      Overrides:
      needTransferEdge in class AbstractDataflowAnalysis<Stmt,CPFact>
      Returns:
      true if this analysis needs to perform transfer for given edge, otherwise false.
    • transferEdge

      public CPFact transferEdge(CFGEdge<Stmt> edge, CPFact nodeFact)
      Description copied from interface: DataflowAnalysis
      Edge Transfer function for this analysis. Note that this function should NOT modify nodeFact.
      Specified by:
      transferEdge in interface DataflowAnalysis<Stmt,CPFact>
      Overrides:
      transferEdge in class AbstractDataflowAnalysis<Stmt,CPFact>
      Parameters:
      edge - the edge that the transfer function is applied on
      nodeFact - the fact of the source node of the edge. Note that which node is the source node of an edge depends on the direction of the analysis.
      Returns:
      the resulting edge fact