soot.toolkits.graph.pdg
Class PDGRegion

java.lang.Object
  extended by soot.toolkits.graph.pdg.PDGRegion
All Implemented Interfaces:
Iterable<PDGNode>, IRegion

public class PDGRegion
extends Object
implements IRegion, Iterable<PDGNode>

This represents a region of control dependence obtained by constructing a program dependence graph. A PDGRegion is slightly different than a weak or strong region; the loops and conditional relations between regions are explicitly represented in the PDGRegion.

Author:
Hossein Sadat-Mohtasham Sep 2009

Constructor Summary
PDGRegion(int id, List<PDGNode> nodes, SootMethod m, SootClass c, UnitGraph ug, PDGNode node)
           
PDGRegion(int id, SootMethod m, SootClass c, UnitGraph ug, PDGNode node)
           
PDGRegion(PDGNode node)
           
 
Method Summary
 void addChildRegion(IRegion chr)
           
 void addPDGNode(PDGNode node)
           
 Object clone()
           
 List<Block> getBlocks()
           
 List<IRegion> getChildRegions()
           
 PDGNode getCorrespondingPDGNode()
           
 Unit getFirst()
           
 int getID()
           
 Unit getLast()
           
 List<PDGNode> getNodes()
           
 IRegion getParent()
           
 SootClass getSootClass()
           
 SootMethod getSootMethod()
           
 UnitGraph getUnitGraph()
           
 List<Unit> getUnits()
           
 List<Unit> getUnits(Unit from, Unit to)
           
 Iterator<PDGNode> iterator()
          return an iterator that know how to follow the control flow in a region.
 boolean occursBefore(Unit u1, Unit u2)
           
 void setParent(IRegion pr)
           
 String toString()
           
 PDGNode unit2PDGNode(Unit u)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDGRegion

public PDGRegion(int id,
                 SootMethod m,
                 SootClass c,
                 UnitGraph ug,
                 PDGNode node)

PDGRegion

public PDGRegion(int id,
                 List<PDGNode> nodes,
                 SootMethod m,
                 SootClass c,
                 UnitGraph ug,
                 PDGNode node)

PDGRegion

public PDGRegion(PDGNode node)
Method Detail

getCorrespondingPDGNode

public PDGNode getCorrespondingPDGNode()

clone

public Object clone()
Overrides:
clone in class Object

getSootMethod

public SootMethod getSootMethod()
Specified by:
getSootMethod in interface IRegion

getSootClass

public SootClass getSootClass()
Specified by:
getSootClass in interface IRegion

getNodes

public List<PDGNode> getNodes()

getUnitGraph

public UnitGraph getUnitGraph()
Specified by:
getUnitGraph in interface IRegion

iterator

public Iterator<PDGNode> iterator()
return an iterator that know how to follow the control flow in a region. This actually returns a ChildPDGFlowIterator that only iterates through the dependent nodes that contribute to the units that belong to a region as defined by a weak region.

Specified by:
iterator in interface Iterable<PDGNode>

getUnits

public List<Unit> getUnits()
Specified by:
getUnits in interface IRegion

unit2PDGNode

public PDGNode unit2PDGNode(Unit u)
Parameters:
a - Statement within the region
Returns:
The PDGNode that contains that unit, if this unit is in this region.

getUnits

public List<Unit> getUnits(Unit from,
                           Unit to)
Specified by:
getUnits in interface IRegion

getLast

public Unit getLast()
Specified by:
getLast in interface IRegion

getFirst

public Unit getFirst()
Specified by:
getFirst in interface IRegion

getBlocks

public List<Block> getBlocks()
Specified by:
getBlocks in interface IRegion

addPDGNode

public void addPDGNode(PDGNode node)

getID

public int getID()
Specified by:
getID in interface IRegion

occursBefore

public boolean occursBefore(Unit u1,
                            Unit u2)
Specified by:
occursBefore in interface IRegion

setParent

public void setParent(IRegion pr)
Specified by:
setParent in interface IRegion

getParent

public IRegion getParent()
Specified by:
getParent in interface IRegion

addChildRegion

public void addChildRegion(IRegion chr)
Specified by:
addChildRegion in interface IRegion

getChildRegions

public List<IRegion> getChildRegions()
Specified by:
getChildRegions in interface IRegion

toString

public String toString()
Overrides:
toString in class Object