Package org.jtool.pdg

Interface DependencyGraphEdge

All Known Implementing Classes:
CD, DD, Dependence, InterPDGCD, InterPDGDD, InterPDGEdge

public interface DependencyGraphEdge
A dependence edge of PDGs, ClDGs, and SDGs.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The kind of a dependency graph edge.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the identification number of the destination node of this edge.
    Returns the destination node for this edge.
    Returns the kind of this dependence edge.
    long
    Returns the identification number of the source node of this edge.
    Returns the source node for this edge.
    Returns the variable related to this data dependence.
    default boolean
    Tests if this edge represents a method call dependence.
    default boolean
    Tests if this edge represents a control dependence.
    default boolean
    Tests if this edge represents a class-member dependence.
    default boolean
    Tests if this edge represents a data dependence.
    default boolean
    Tests if this edge represents a declaration dependence.
    default boolean
    Tests if this edge represents a define-order dependence when the two nodes are dominated the same node.
    default boolean
    Tests if this edge represents a define-use dependence.
    default boolean
    Tests if this edge represents a dependence.
    default boolean
    Tests if this edge represents an exception dependence.
    default boolean
    Tests if this edge represents a fall-through control dependence.
    default boolean
    Tests if this edge represents a false control dependence.
    default boolean
    Tests if this edge represents a field access dependence.
    default boolean
    Tests if this edge represents an edge connecting two nodes in different PDGs.
    default boolean
    Tests if this edge represents a loop-carried data dependence.
    default boolean
    Tests if this edge represents a loop-independent data dependence.
    default boolean
    Tests if this edge represents an output dependence.
    default boolean
    Tests if this edge represents a parameter-in dependence.
    default boolean
    Tests if this edge represents a parameter-out dependence.
    default boolean
    Tests if this edge represents a summary data dependence.
    default boolean
    Tests if this edge represents a true control dependence.
    default boolean
    Tests if this edge represents an uncovered field access dependence.
    void
    Sets the kind of this dependence edge.
    sortEdges(Collection<? extends DependencyGraphEdge> collection)
    Sorts the list of edges.
    Sorts the list of dependence edges in reverse order.
  • Method Details

    • getSrcId

      long getSrcId()
      Returns the identification number of the source node of this edge.
      Returns:
      the identification number of the source node
    • getDstId

      long getDstId()
      Returns the identification number of the destination node of this edge.
      Returns:
      the identification number of the destination node
    • getSrcNode

      PDGNode getSrcNode()
      Returns the source node for this edge.
      Returns:
      the source node
    • getDstNode

      PDGNode getDstNode()
      Returns the destination node for this edge.
      Returns:
      the destination node
    • getVariable

      default JVariableReference getVariable()
      Returns the variable related to this data dependence. The value of a variable defined in the source node reaches that used in the destination node.
      Returns:
      the variable storing the passed value
    • setKind

      void setKind(DependencyGraphEdge.Kind kind)
      Sets the kind of this dependence edge. This method is not intended to be invoked by clients.
      Parameters:
      kind - the kind of the dependence edge
    • getKind

      Returns the kind of this dependence edge.
      Returns:
      the kind of the edge
    • isCD

      default boolean isCD()
      Tests if this edge represents a control dependence.
      Returns:
      true if this is a control dependence edge, otherwise false
    • isDD

      default boolean isDD()
      Tests if this edge represents a data dependence.
      Returns:
      true if this is a data dependence edge, otherwise false
    • isDependence

      default boolean isDependence()
      Tests if this edge represents a dependence.
      Returns:
      true if this is a dependence edge, otherwise false
    • isInterPDGEdge

      default boolean isInterPDGEdge()
      Tests if this edge represents an edge connecting two nodes in different PDGs.
      Returns:
      true if this is a connecting edge, otherwise false
    • isTrue

      default boolean isTrue()
      Tests if this edge represents a true control dependence.
      Returns:
      true if this is a true control dependence edge, otherwise false
    • isFalse

      default boolean isFalse()
      Tests if this edge represents a false control dependence.
      Returns:
      true if this is a false control dependence edge, otherwise false
    • isFallThrough

      default boolean isFallThrough()
      Tests if this edge represents a fall-through control dependence.
      Returns:
      true if this is a fall-through control dependence edge, otherwise false
    • isDeclaration

      default boolean isDeclaration()
      Tests if this edge represents a declaration dependence. The defined or used variable needs its declaration.
      Returns:
      true if this is a declaration dependence edge, otherwise false
    • isExceptionCatch

      default boolean isExceptionCatch()
      Tests if this edge represents an exception dependence. The execution of a statement sometimes depends on the occurrence of an exception.
      Returns:
      true if this is an exception dependence edge, otherwise false
    • isClassMember

      default boolean isClassMember()
      Tests if this edge represents a class-member dependence.
      Returns:
      true if this is a class-member dependence edge, otherwise false
    • isCall

      default boolean isCall()
      Tests if this edge represents a method call dependence. The caller is needed to execute a callee.
      Returns:
      true if this is a method call dependence edge, otherwise false
    • isDefUse

      default boolean isDefUse()
      Tests if this edge represents a define-use dependence.
      Returns:
      true if this is a define-use dependence, otherwise false
    • isLIDD

      default boolean isLIDD()
      Tests if this edge represents a loop-independent data dependence. The data dependence occurs when not passing a loop-back control flow.
      Returns:
      true if this is a loop-independent data dependence edge, otherwise false
    • isLCDD

      default boolean isLCDD()
      Tests if this edge represents a loop-carried data dependence. The data dependence occurs when passing a loop-back control flow.
      Returns:
      true if this is a loop-carried data dependence edge, otherwise false
    • isDefOrder

      default boolean isDefOrder()
      Tests if this edge represents a define-order dependence when the two nodes are dominated the same node.
      Returns:
      true if this is a define-order dependence edge, otherwise false
    • isOutput

      default boolean isOutput()
      Tests if this edge represents an output dependence.
      Returns:
      true if this is an output dependence edge, otherwise false
    • isParameterIn

      default boolean isParameterIn()
      Tests if this edge represents a parameter-in dependence. The value of an argument is passed to a parameter of a method.
      Returns:
      true if this is a parameter-in dependence edge, otherwise false
    • isParameterOut

      default boolean isParameterOut()
      Tests if this edge represents a parameter-out dependence. The resulting value of a method is return to a caller.
      Returns:
      true if this is a parameter-out dependence edge, otherwise false
    • isFieldAccess

      default boolean isFieldAccess()
      Tests if this edge represents a field access dependence.
      Returns:
      true if this is a field access dependence edge, otherwise false
    • isSummary

      default boolean isSummary()
      Tests if this edge represents a summary data dependence. The summary dependence edges are created as needed.
      Returns:
      true if this is a summary data dependence edge, otherwise false
    • isUncoveredFieldAccess

      default boolean isUncoveredFieldAccess()
      Tests if this edge represents an uncovered field access dependence.
      Returns:
      true if this is an uncovered field access dependence edge, otherwise false
    • sortEdges

      static List<DependencyGraphEdge> sortEdges(Collection<? extends DependencyGraphEdge> collection)
      Sorts the list of edges.
      Parameters:
      collection - the list of the edges to be sorted
      Returns:
      the sorted list of the edges
    • sortEdgesReverse

      static List<DependencyGraphEdge> sortEdgesReverse(Collection<? extends DependencyGraphEdge> collection)
      Sorts the list of dependence edges in reverse order.
      Parameters:
      collection - the list of the dependence edges to be sorted
      Returns:
      the sorted list of the dependence edges