org.jtool.jxplatform.graph.pdg
Class DD

java.lang.Object
  extended byorg.jtool.jxplatform.graph.GraphEdge
      extended byorg.jtool.jxplatform.graph.pdg.Dependence
          extended byorg.jtool.jxplatform.graph.pdg.DD
All Implemented Interfaces:
GraphEdgeSort, GraphElement

public class DD
extends Dependence

A data dependence edge of PDGs.

Author:
Katsuhsa Maruyama

Field Summary
protected  PDGNode loopCarriedNode
          A loop carried node if this edge carries a variable for loop.
protected  JxVariable var
          A variable that this edge carries.
 
Fields inherited from class org.jtool.jxplatform.graph.GraphEdge
dst, sort, src
 
Fields inherited from interface org.jtool.jxplatform.graph.GraphEdgeSort
antiDependence, CDs, DDs, deforderDependence, defuseDependence, fallControlDependence, fallThroughFlow, falseControlDependence, falseControlFlow, flows, outputDependence, parameterFlow, parameterIn, parameterOut, trueControlDependence, trueControlFlow
 
Constructor Summary
protected DD()
          Creates a new, empty object.
protected DD(PDGNode src, PDGNode dst)
          Creates a new edge.
protected DD(PDGNode src, PDGNode dst, JxVariable jv)
          Creates a new edge.
 
Method Summary
 boolean equals(GraphElement elem)
          Tests if this edge equals to a given edge.
 PDGNode getLoopCarriedNode()
          Returns the loop carried node of this edge.
 JxVariable getVariable()
          Returns the variable carried by this edge.
 boolean hasLoopCarriedNode()
          Tests if this edge has a loop carried node.
 boolean isAnti()
          Tests if this edge is an anti dependence.
 boolean isDefOrder()
          Tests if this edge is a def-order dependence.
 boolean isDefUse()
          Tests if this edge is a def-use dependence.
 boolean isOutput()
          Tests if this edge is an output dependence.
 boolean isParameterIn()
          Tests if this edge is a parameter-in dependence.
 boolean isParameterOut()
          Tests if this edge is a parameter-out dependence.
 void print(java.lang.StringBuffer buf)
          Collects information about this edge for printing.
protected  void setAnti()
          Sets this edge as the anti dependence.
protected  void setDefOrder()
          Sets this edge as the def-order dependence.
protected  void setDefUse()
          Sets this edge as the def-use dependence.
protected  void setLoopCarriedNode(PDGNode node)
          Sets a loop carried node of this edge.
protected  void setOutput()
          Sets this edge as the output dependence.
protected  void setParameterIn()
          Sets this edge as the parameter-in data dependence.
protected  void setParameterOut()
          Sets this edge as the parameter-out dependence.
protected  void setVariable(JxVariable jv)
          Sets a variable carried by this edge.
 
Methods inherited from class org.jtool.jxplatform.graph.pdg.Dependence
isCD, isDD, print, write
 
Methods inherited from class org.jtool.jxplatform.graph.GraphEdge
getDstNode, getSort, getSrcNode, setDstNode, setSort, setSrcNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

var

protected JxVariable var
A variable that this edge carries.


loopCarriedNode

protected PDGNode loopCarriedNode
A loop carried node if this edge carries a variable for loop. The default value is null. This means that this edge has no loop carreied node.

Constructor Detail

DD

protected DD()
Creates a new, empty object.


DD

protected DD(PDGNode src,
             PDGNode dst)
Creates a new edge.

Parameters:
src - A source node of this edge.
dst - A destination node of this edge.

DD

protected DD(PDGNode src,
             PDGNode dst,
             JxVariable jv)
Creates a new edge.

Parameters:
src - A source node of this edge.
dst - A destination node of this edge.
jv - A variable carried by this edge.
Method Detail

setVariable

protected void setVariable(JxVariable jv)
Sets a variable carried by this edge.

Parameters:
jv - A varible.

getVariable

public JxVariable getVariable()
Returns the variable carried by this edge.

Returns:
The variable carried by this edge.

setLoopCarriedNode

protected void setLoopCarriedNode(PDGNode node)
Sets a loop carried node of this edge.

Parameters:
node - A PDG node which carries any variable for loop.

getLoopCarriedNode

public PDGNode getLoopCarriedNode()
Returns the loop carried node of this edge.

Returns:
The loop carried node of this edge.

hasLoopCarriedNode

public boolean hasLoopCarriedNode()
Tests if this edge has a loop carried node.

Returns:
true if this edge has a loop carried node, otherwise false.

equals

public boolean equals(GraphElement elem)
Tests if this edge equals to a given edge.

Specified by:
equals in interface GraphElement
Overrides:
equals in class Dependence
Parameters:
elem - A edge to be checked.
Returns:
true if the edges are equal, otherwise false.

setDefUse

protected void setDefUse()
Sets this edge as the def-use dependence.


isDefUse

public boolean isDefUse()
Tests if this edge is a def-use dependence.

Returns:
true if this edge is a def-use dependence, otherwise false.

setDefOrder

protected void setDefOrder()
Sets this edge as the def-order dependence.


isDefOrder

public boolean isDefOrder()
Tests if this edge is a def-order dependence.

Returns:
true if this edge is a def-order dependence, otherwise false.

setOutput

protected void setOutput()
Sets this edge as the output dependence.


isOutput

public boolean isOutput()
Tests if this edge is an output dependence.

Returns:
true if this edge is an output dependence, otherwise false.

setAnti

protected void setAnti()
Sets this edge as the anti dependence.


isAnti

public boolean isAnti()
Tests if this edge is an anti dependence.

Returns:
true if this edge is an anti dependence, otherwise false.

setParameterIn

protected void setParameterIn()
Sets this edge as the parameter-in data dependence.


isParameterIn

public boolean isParameterIn()
Tests if this edge is a parameter-in dependence.

Returns:
true if this edge is a parameter-in dependence, otherwise false.

setParameterOut

protected void setParameterOut()
Sets this edge as the parameter-out dependence.


isParameterOut

public boolean isParameterOut()
Tests if this edge is a parameter-out dependence.

Returns:
true if this edge is a parameter-out dependence, otherwise false.

print

public void print(java.lang.StringBuffer buf)
Collects information about this edge for printing.

Overrides:
print in class Dependence
Parameters:
buf - The information about the edge.