com.ibm.wala.demandpa.flowgraph
Interface IFlowGraph

All Superinterfaces:
EdgeManager<java.lang.Object>, Graph<java.lang.Object>, java.lang.Iterable<java.lang.Object>, LabeledEdgeManager<java.lang.Object,IFlowLabel>, LabeledGraph<java.lang.Object,IFlowLabel>, NodeManager<java.lang.Object>
All Known Implementing Classes:
AbstractDemandFlowGraph, AbstractFlowGraph, DemandPointerFlowGraph, DemandValueFlowGraph

public interface IFlowGraph
extends LabeledGraph<java.lang.Object,IFlowLabel>


Method Summary
 void addSubgraphForNode(CGNode node)
          add representation of flow for a node, if not already present
 SSAInvokeInstruction getInstrReturningTo(LocalPointerKey pk)
          get the SSAInvokeInstruction whose return value is assigned to a pointer key.
 java.util.Iterator<SSAInvokeInstruction> getInstrsPassingParam(LocalPointerKey pk)
           
 java.util.Set<CGNode> getPossibleTargets(CGNode caller, CallSiteReference site, LocalPointerKey actualPk)
          get the callees that should be considered at a particular call site
 java.util.Set<CallSiteAndCGNode> getPotentialCallers(PointerKey formalPk)
           
 java.util.Iterator<PointerKey> getReadsOfInstanceField(PointerKey pk, IField f)
           
 java.util.Iterator<? extends java.lang.Object> getReadsOfStaticField(StaticFieldKey sfk)
           
 java.util.Iterator<PointerKey> getWritesToInstanceField(PointerKey pk, IField f)
           
 java.util.Iterator<? extends java.lang.Object> getWritesToStaticField(StaticFieldKey sfk)
           
 boolean hasSubgraphForNode(CGNode node)
           
 boolean isParam(LocalPointerKey pk)
           
 void visitPreds(java.lang.Object node, IFlowLabel.IFlowLabelVisitor v)
          Apply a visitor to the predecessors of some node.
 void visitSuccs(java.lang.Object node, IFlowLabel.IFlowLabelVisitor v)
          Apply a visitor to the successors of some node.
 
Methods inherited from interface com.ibm.wala.util.graph.Graph
removeNodeAndEdges
 
Methods inherited from interface com.ibm.wala.util.graph.NodeManager
addNode, containsNode, getNumberOfNodes, iterator, removeNode
 
Methods inherited from interface com.ibm.wala.util.graph.EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
 
Methods inherited from interface com.ibm.wala.util.graph.labeled.LabeledEdgeManager
addEdge, getDefaultLabel, getEdgeLabels, getPredLabels, getPredNodeCount, getPredNodes, getSuccLabels, getSuccNodeCount, getSuccNodes, hasEdge, removeEdge
 
Methods inherited from interface com.ibm.wala.util.graph.EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
 

Method Detail

visitSuccs

void visitSuccs(java.lang.Object node,
                IFlowLabel.IFlowLabelVisitor v)
Apply a visitor to the successors of some node.

Parameters:
node -
v -

visitPreds

void visitPreds(java.lang.Object node,
                IFlowLabel.IFlowLabelVisitor v)
Apply a visitor to the predecessors of some node.

Parameters:
node -
v -

addSubgraphForNode

void addSubgraphForNode(CGNode node)
                        throws java.lang.IllegalArgumentException
add representation of flow for a node, if not already present

Parameters:
node -
Throws:
java.lang.IllegalArgumentException - if node == null

hasSubgraphForNode

boolean hasSubgraphForNode(CGNode node)

isParam

boolean isParam(LocalPointerKey pk)
Parameters:
pk -
Returns:
true iff pk is a formal parameter

getInstrsPassingParam

java.util.Iterator<SSAInvokeInstruction> getInstrsPassingParam(LocalPointerKey pk)
Parameters:
pk -
Returns:
the SSAInvokeInstructions passing some pointer as a parameter

getInstrReturningTo

SSAInvokeInstruction getInstrReturningTo(LocalPointerKey pk)
get the SSAInvokeInstruction whose return value is assigned to a pointer key.

Parameters:
pk -
Returns:
the instruction, or null if no return value is assigned to pk

getWritesToStaticField

java.util.Iterator<? extends java.lang.Object> getWritesToStaticField(StaticFieldKey sfk)
                                                                      throws java.lang.IllegalArgumentException
Parameters:
sfk - the static field
Returns:
all the variables whose values are written to sfk
Throws:
java.lang.IllegalArgumentException - if sfk == null

getReadsOfStaticField

java.util.Iterator<? extends java.lang.Object> getReadsOfStaticField(StaticFieldKey sfk)
                                                                     throws java.lang.IllegalArgumentException
Parameters:
sfk - the static field
Returns:
all the variables that get the value of sfk
Throws:
java.lang.IllegalArgumentException - if sfk == null

getWritesToInstanceField

java.util.Iterator<PointerKey> getWritesToInstanceField(PointerKey pk,
                                                        IField f)

getReadsOfInstanceField

java.util.Iterator<PointerKey> getReadsOfInstanceField(PointerKey pk,
                                                       IField f)

getPotentialCallers

java.util.Set<CallSiteAndCGNode> getPotentialCallers(PointerKey formalPk)
Parameters:
formalPk - a PointerKey representing either a formal parameter or return value
Returns:
the CallSiteAndCGNodes representing pointer callers of formalPk's method

getPossibleTargets

java.util.Set<CGNode> getPossibleTargets(CGNode caller,
                                         CallSiteReference site,
                                         LocalPointerKey actualPk)
get the callees that should be considered at a particular call site

Parameters:
caller - the caller
site - the call site
actualPk - a LocalPointerKey corresponding to the actual parameter or return value of interest. This may be used to filter out certain callees.
Returns:
the callees of interest