com.ibm.wala.ipa.callgraph.propagation
Class PropagationGraph

java.lang.Object
  extended by com.ibm.wala.ipa.callgraph.propagation.PropagationGraph
All Implemented Interfaces:
IFixedPointSystem<PointsToSetVariable>

public class PropagationGraph
extends java.lang.Object
implements IFixedPointSystem<PointsToSetVariable>

A dataflow graph implementation specialized for propagation-based pointer analysis


Constructor Summary
PropagationGraph()
           
 
Method Summary
 void addStatement(GeneralStatement<PointsToSetVariable> eq)
           
 void addStatement(IFixedPointStatement<PointsToSetVariable> statement)
          Add a statement to the system
 void addStatement(UnaryStatement<PointsToSetVariable> eq)
           
 boolean containsStatement(IFixedPointStatement<PointsToSetVariable> eq)
           
 boolean containsVariable(PointsToSetVariable v)
           
 NumberedGraph<PointsToSetVariable> getAssignmentGraph()
          A graph of just the variables in the system.
 Graph<PointsToSetVariable> getFilterAssignmentGraph()
          A graph of just the variables in the system.
 int getNumberOfStatementsThatDef(PointsToSetVariable v)
           
 int getNumberOfStatementsThatUse(PointsToSetVariable v)
          Note that this implementation consults the implicit relation for each and every operator cached.
 java.util.Iterator<AbstractStatement> getStatements()
          Return an Iterator of the IFixedPointStatements in this system
 java.util.Iterator<AbstractStatement> getStatementsThatDef(PointsToSetVariable v)
           
 java.util.Iterator<AbstractStatement> getStatementsThatUse(PointsToSetVariable v)
           
 java.util.Iterator<PointsToSetVariable> getVariables()
          Return an Iterator of the variables in this graph
 void performVerboseAction()
           
 void removeStatement(IFixedPointStatement<PointsToSetVariable> eq)
          removes a given statement
 void removeVariable(PointsToSetVariable p)
           
 void reorder()
          reorder the statements in this system
 java.lang.String spaceReport()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropagationGraph

public PropagationGraph()
Method Detail

addStatement

public void addStatement(GeneralStatement<PointsToSetVariable> eq)
Throws:
java.lang.IllegalArgumentException - if eq is null

addStatement

public void addStatement(UnaryStatement<PointsToSetVariable> eq)
                  throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

removeVariable

public void removeVariable(PointsToSetVariable p)

getStatements

public java.util.Iterator<AbstractStatement> getStatements()
Description copied from interface: IFixedPointSystem
Return an Iterator of the IFixedPointStatements in this system

Specified by:
getStatements in interface IFixedPointSystem<PointsToSetVariable>
Returns:
Iterator

removeStatement

public void removeStatement(IFixedPointStatement<PointsToSetVariable> eq)
                     throws java.lang.IllegalArgumentException
Description copied from interface: IFixedPointSystem
removes a given statement

Specified by:
removeStatement in interface IFixedPointSystem<PointsToSetVariable>
Throws:
java.lang.IllegalArgumentException

reorder

public void reorder()
Description copied from interface: IFixedPointSystem
reorder the statements in this system

Specified by:
reorder in interface IFixedPointSystem<PointsToSetVariable>

getStatementsThatUse

public java.util.Iterator<AbstractStatement> getStatementsThatUse(PointsToSetVariable v)
Specified by:
getStatementsThatUse in interface IFixedPointSystem<PointsToSetVariable>
Returns:
Iterator , the statements that use the variable

getStatementsThatDef

public java.util.Iterator<AbstractStatement> getStatementsThatDef(PointsToSetVariable v)
Specified by:
getStatementsThatDef in interface IFixedPointSystem<PointsToSetVariable>
Returns:
Iterator , the statements that def the variable

getNumberOfStatementsThatUse

public int getNumberOfStatementsThatUse(PointsToSetVariable v)
Note that this implementation consults the implicit relation for each and every operator cached. This will be inefficient if there are many implicit operators.

Specified by:
getNumberOfStatementsThatUse in interface IFixedPointSystem<PointsToSetVariable>
Throws:
java.lang.IllegalArgumentException - if v is null

getNumberOfStatementsThatDef

public int getNumberOfStatementsThatDef(PointsToSetVariable v)
Specified by:
getNumberOfStatementsThatDef in interface IFixedPointSystem<PointsToSetVariable>

getVariables

public java.util.Iterator<PointsToSetVariable> getVariables()
Description copied from interface: IFixedPointSystem
Return an Iterator of the variables in this graph

Specified by:
getVariables in interface IFixedPointSystem<PointsToSetVariable>
Returns:
Iterator

performVerboseAction

public void performVerboseAction()

containsStatement

public boolean containsStatement(IFixedPointStatement<PointsToSetVariable> eq)
                          throws java.lang.IllegalArgumentException
Specified by:
containsStatement in interface IFixedPointSystem<PointsToSetVariable>
Returns:
true iff this system already contains an equation that is equal() to s
Throws:
java.lang.IllegalArgumentException

containsVariable

public boolean containsVariable(PointsToSetVariable v)
Specified by:
containsVariable in interface IFixedPointSystem<PointsToSetVariable>
Returns:
true iff this system already contains a variable that is equal() to v.

addStatement

public void addStatement(IFixedPointStatement<PointsToSetVariable> statement)
                  throws java.lang.IllegalArgumentException,
                         UnimplementedError
Description copied from interface: IFixedPointSystem
Add a statement to the system

Specified by:
addStatement in interface IFixedPointSystem<PointsToSetVariable>
Throws:
java.lang.IllegalArgumentException
UnimplementedError

getAssignmentGraph

public NumberedGraph<PointsToSetVariable> getAssignmentGraph()
A graph of just the variables in the system. v1 -> v2 iff there exists an assignment equation e s.t. e uses v1 and e defs v2.


getFilterAssignmentGraph

public Graph<PointsToSetVariable> getFilterAssignmentGraph()
A graph of just the variables in the system. v1 -> v2 iff there exists an Assingnment or Filter equation e s.t. e uses v1 and e defs v2.


spaceReport

public java.lang.String spaceReport()