Interface ExceptionPruningAnalysis<I,T extends IBasicBlock<I>>

All Known Implementing Classes:
ExplodedCFGNullPointerAnalysis, SSACFGNullPointerAnalysis

public interface ExceptionPruningAnalysis<I,T extends IBasicBlock<I>>
This abstract class is used as interface for analysis that remove impossible control flow from a CFG. This is done by detecting exceptions that may always (or never) appear.
Author:
Juergen Graf <graf@kit.edu>
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Computes impossible control flow that is due to exceptions that definitely will not appear or that will always be thrown.
    Returns the result of the analysis: A control flow graph where impossible control flow has been removed.
    getState(T bb)
    Returns the state of a node.
    boolean
    Returns true if the corresponding method contains instructions that may throw an exception which is not caught in the same method.
  • Method Details

    • compute

      Computes impossible control flow that is due to exceptions that definitely will not appear or that will always be thrown. You have to run this method before using getPruned() to extract the result of the analysis.
      Parameters:
      progress - A progress monitor that is used to display the progress of the analysis. It can also be used to detect a cancel request from the user. The common behavior is to cancel the method if progress.isCanceled() is true by throwing a CancelException.
      Returns:
      Number of edges that have been removed from the cfg.
      Throws:
      GraphIntegrity.UnsoundGraphException - Thrown if the original CFG contains inconsistencies.
      CancelException - Thrown if the user requested cancellation through the progress monitor.
    • getCFG

      ControlFlowGraph<I,T> getCFG()
      Returns the result of the analysis: A control flow graph where impossible control flow has been removed. The way how and which impossible flow is detected may vary between different implementations of this class. Run compute(IProgressMonitor) first.
      Returns:
      The improved CFG without edges that were detected as impossible flow.
    • hasExceptions

      boolean hasExceptions()
      Returns true if the corresponding method contains instructions that may throw an exception which is not caught in the same method. Run compute(IPrograssMonitor) first.
      Returns:
      true if the corresponding method contains instructions that may throw an exception which is not caught in the same method
    • getState

      NullPointerState getState(T bb)
      Returns the state of a node. The node has to be part of the cfg.
      Parameters:
      bb - Node
      Returns:
      NullPointerState