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 ClassesModifier and TypeInterfaceDescriptionstatic enum
The kind of a dependency graph edge. -
Method Summary
Modifier and TypeMethodDescriptionlong
getDstId()
Returns the identification number of the destination node of this edge.Returns the destination node for this edge.getKind()
Returns the kind of this dependence edge.long
getSrcId()
Returns the identification number of the source node of this edge.Returns the source node for this edge.default JVariableReference
Returns the variable related to this data dependence.default boolean
isCall()
Tests if this edge represents a method call dependence.default boolean
isCD()
Tests if this edge represents a control dependence.default boolean
Tests if this edge represents a class-member dependence.default boolean
isDD()
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
isDefUse()
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
isFalse()
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
isLCDD()
Tests if this edge represents a loop-carried data dependence.default boolean
isLIDD()
Tests if this edge represents a loop-independent data dependence.default boolean
isOutput()
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
isTrue()
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.static List<DependencyGraphEdge>
sortEdges
(Collection<? extends DependencyGraphEdge> collection) Sorts the list of edges.static List<DependencyGraphEdge>
sortEdgesReverse
(Collection<? extends DependencyGraphEdge> collection) 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
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
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
DependencyGraphEdge.Kind 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, otherwisefalse
-
isDD
default boolean isDD()Tests if this edge represents a data dependence.- Returns:
true
if this is a data dependence edge, otherwisefalse
-
isDependence
default boolean isDependence()Tests if this edge represents a dependence.- Returns:
true
if this is a dependence edge, otherwisefalse
-
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, otherwisefalse
-
isTrue
default boolean isTrue()Tests if this edge represents a true control dependence.- Returns:
true
if this is a true control dependence edge, otherwisefalse
-
isFalse
default boolean isFalse()Tests if this edge represents a false control dependence.- Returns:
true
if this is a false control dependence edge, otherwisefalse
-
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, otherwisefalse
-
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, otherwisefalse
-
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, otherwisefalse
-
isClassMember
default boolean isClassMember()Tests if this edge represents a class-member dependence.- Returns:
true
if this is a class-member dependence edge, otherwisefalse
-
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, otherwisefalse
-
isDefUse
default boolean isDefUse()Tests if this edge represents a define-use dependence.- Returns:
true
if this is a define-use dependence, otherwisefalse
-
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, otherwisefalse
-
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, otherwisefalse
-
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, otherwisefalse
-
isOutput
default boolean isOutput()Tests if this edge represents an output dependence.- Returns:
true
if this is an output dependence edge, otherwisefalse
-
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, otherwisefalse
-
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, otherwisefalse
-
isFieldAccess
default boolean isFieldAccess()Tests if this edge represents a field access dependence.- Returns:
true
if this is a field access dependence edge, otherwisefalse
-
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, otherwisefalse
-
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, otherwisefalse
-
sortEdges
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
-