Class AbstractDataflowAnalysis<Fact>

java.lang.Object
edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<Fact>
edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<Fact>
All Implemented Interfaces:
DataflowAnalysis<Fact>
Direct Known Subclasses:
BackwardDataflowAnalysis, CallListAnalysis, ForwardDataflowAnalysis, TypeQualifierDataflowAnalysis

public abstract class AbstractDataflowAnalysis<Fact> extends BasicAbstractDataflowAnalysis<Fact>
Abstract base class providing functionality that will be useful for most dataflow analysis implementations that model instructions within basic blocks.
Author:
David Hovemeyer
See Also:
  • Constructor Details

    • AbstractDataflowAnalysis

      public AbstractDataflowAnalysis()
  • Method Details

    • transferInstruction

      public abstract void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, Fact fact) throws DataflowAnalysisException
      Transfer function for a single instruction.
      Parameters:
      handle - the instruction
      basicBlock - the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutines
      fact - which should be modified based on the instruction
      Throws:
      DataflowAnalysisException
    • isFactValid

      @CheckReturnValue public abstract boolean isFactValid(Fact fact)
      Determine whether the given fact is valid (neither top nor bottom).
    • getFactAtLocation

      public Fact getFactAtLocation(Location location) throws DataflowAnalysisException
      Get the dataflow fact representing the point 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.
      Specified by:
      getFactAtLocation in interface DataflowAnalysis<Fact>
      Overrides:
      getFactAtLocation in class BasicAbstractDataflowAnalysis<Fact>
      Parameters:
      location - the location
      Returns:
      the fact at the point just before the 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.
      Specified by:
      getFactAfterLocation in interface DataflowAnalysis<Fact>
      Overrides:
      getFactAfterLocation in class BasicAbstractDataflowAnalysis<Fact>
      Parameters:
      location - the location
      Returns:
      the fact at the point just after the location
      Throws:
      DataflowAnalysisException
    • transfer

      public void transfer(BasicBlock basicBlock, @CheckForNull org.apache.bcel.generic.InstructionHandle end, Fact start, Fact result) throws DataflowAnalysisException
      Description copied from interface: DataflowAnalysis
      Transfer function for the analysis. Taking dataflow facts at start (which might be either the entry or exit of the block, depending on whether the analysis is forwards or backwards), modify result to be the facts at the other end of the block.
      Parameters:
      basicBlock - the basic block
      end - if nonnull, stop before considering this instruction; otherwise, consider all of the instructions in the basic block
      start - dataflow facts at beginning of block (if forward analysis) or end of block (if backwards analysis)
      result - resulting dataflow facts at other end of block
      Throws:
      DataflowAnalysisException