Class ControlFlowGraph

java.lang.Object
org.apache.bcel.verifier.structurals.ControlFlowGraph

public class ControlFlowGraph extends Object
This class represents a control flow graph of a method.
  • Constructor Details

    • ControlFlowGraph

      public ControlFlowGraph(MethodGen methodGen)
      A Control Flow Graph; with additional JustIce checks
      Parameters:
      methodGen - the method generator instance.
    • ControlFlowGraph

      public ControlFlowGraph(MethodGen methodGen, boolean enableJustIceCheck)
      A Control Flow Graph.
      Parameters:
      methodGen - the method generator instance.
      enableJustIceCheck - if true, additional JustIce checks are performed.
      Since:
      6.0
  • Method Details

    • contextOf

      Returns the InstructionContext of a given instruction.
      Parameters:
      inst - the instruction handle.
      Returns:
      the InstructionContext of the given instruction.
    • contextsOf

      Returns the InstructionContext[] of a given InstructionHandle[], in a naturally ordered manner.
      Parameters:
      insts - the instruction handles.
      Returns:
      the InstructionContext array of the given instruction handles.
    • getInstructionContexts

      Returns an InstructionContext[] with all the InstructionContext instances for the method whose control flow is represented by this ControlFlowGraph (NOT ORDERED!).
      Returns:
      array of InstructionContext instances.
    • isDead

      public boolean isDead(InstructionHandle i)
      Returns true, if and only if the said instruction is not reachable; that means, if it is not part of this ControlFlowGraph.
      Parameters:
      i - the instruction handle.
      Returns:
      true if the instruction is not reachable, false otherwise.