soot.toolkits.graph.pdg
Interface ProgramDependenceGraph

All Superinterfaces:
DirectedGraph, Iterable, MutableEdgeLabelledDirectedGraph
All Known Implementing Classes:
HashMutablePDG

public interface ProgramDependenceGraph
extends MutableEdgeLabelledDirectedGraph

This defines the interface to a Program Dependence Graph as defined in Ferrante, J., Ottenstein, K. J., and Warren, J. D. 1987. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9, 3 (Jul. 1987), 319-349. DOI= http://doi.acm.org/10.1145/24039.24041 Note that this interface should evolve based on the need.

Author:
Hossein Sadat-Mohtasham May 2009

Method Summary
 boolean dependentOn(PDGNode node1, PDGNode node2)
          This method determines if node1 is control-dependent on node2 in this PDG.
 List getDependents(PDGNode node)
          This method returns the list of all dependents of a node in the PDG.
 PDGNode getPDGNode(Object cfgNode)
          This method returns the PDGNode in the PDG corresponding to the given CFG node.
 List<PDGRegion> getPDGRegions()
          This method returns the list of PDGRegions computed by the construction method.
 PDGNode GetStartNode()
           
 IRegion GetStartRegion()
           
 List<Region> getStrongRegions()
           
 List<Region> getWeakRegions()
           
 String toString()
           
 
Methods inherited from interface soot.toolkits.graph.MutableEdgeLabelledDirectedGraph
addEdge, addNode, containsAnyEdge, containsAnyEdge, containsEdge, containsNode, getEdgesForLabel, getLabelsForEdges, getNodes, removeAllEdges, removeAllEdges, removeEdge, removeNode
 
Methods inherited from interface soot.toolkits.graph.DirectedGraph
getHeads, getPredsOf, getSuccsOf, getTails, iterator, size
 

Method Detail

getWeakRegions

List<Region> getWeakRegions()
Returns:
A List of weak regions, generated by RegionAnalysis for the corresponding control flow graph (These are Regions and not PDGRegions.)

getStrongRegions

List<Region> getStrongRegions()
Returns:
A List of strong regions, generated when constructing the program dependence graph (These are Regions and not PDGRegions.)

getPDGRegions

List<PDGRegion> getPDGRegions()
This method returns the list of PDGRegions computed by the construction method.

Returns:
The list of PDGRegions

GetStartRegion

IRegion GetStartRegion()
Returns:
The root region of the PDG.

GetStartNode

PDGNode GetStartNode()
Returns:
The root node of the PDG, which is essentially the same as the start region but packaged in its PDGNode, which can be used to traverse the graph, etc.

dependentOn

boolean dependentOn(PDGNode node1,
                    PDGNode node2)
This method determines if node1 is control-dependent on node2 in this PDG.

Parameters:
node1 -
node2 -
Returns:
returns true if node1 is dependent on node2

getDependents

List getDependents(PDGNode node)
This method returns the list of all dependents of a node in the PDG.

Parameters:
node - is the PDG node whose dependents are desired.
Returns:
a list of dependent nodes

getPDGNode

PDGNode getPDGNode(Object cfgNode)
This method returns the PDGNode in the PDG corresponding to the given CFG node. Note that currently the CFG node has to be a Block.

Parameters:
cfgNode - is expected to be a node in CFG (currently only Block).
Returns:
The node in PDG corresponding to cfgNode.

toString

String toString()
Overrides:
toString in class Object
Returns:
A human readable description of the PDG.