Class Dataflow<Fact,​AnalysisType extends DataflowAnalysis<Fact>>

    • Field Detail

      • DEBUG

        public static boolean DEBUG
    • Constructor Detail

      • Dataflow

        public Dataflow​(CFG cfg,
                        AnalysisType analysis)
        Constructor.
        Parameters:
        cfg - the control flow graph
        analysis - the DataflowAnalysis to be run
    • Method Detail

      • execute

        public void execute()
                     throws DataflowAnalysisException
        Run the algorithm. Afterwards, caller can use the getStartFact() and getResultFact() methods to to get dataflow facts at start and result points of each block.
        Throws:
        DataflowAnalysisException
      • getNumIterations

        public int getNumIterations()
        Return the number of iterations of the main execution loop.
      • getStartFact

        public Fact getStartFact​(BasicBlock block)
        Get dataflow facts for start of given block.
      • getResultFact

        public Fact getResultFact​(BasicBlock block)
        Get dataflow facts for end of given block.
      • getFactAtLocation

        public Fact getFactAtLocation​(Location location)
                               throws DataflowAnalysisException
        Get dataflow fact at (just before) given Location. Note "before" is meant in the logical sense, so for backward analyses, before means after the location in the control flow sense.
        Parameters:
        location - the Location
        Returns:
        the dataflow value at given Location
        Throws:
        DataflowAnalysisException
      • getFactAfterLocation

        public Fact getFactAfterLocation​(Location location)
                                  throws DataflowAnalysisException
        Get the dataflow fact representing the point just after given Location. Note "after" is meant in the logical sense, so for backward analyses, after means before the location in the control flow sense.
        Parameters:
        location - the Location
        Returns:
        the dataflow value after given Location
        Throws:
        DataflowAnalysisException
      • getAnalysis

        public AnalysisType getAnalysis()
        Get the analysis object.
      • getCFG

        public CFG getCFG()
        Get the CFG object.
      • dumpDataflow

        public void dumpDataflow​(AnalysisType analysis)