com.ibm.wala.ipa.callgraph
Interface CGNode

All Superinterfaces:
ContextItem, INodeWithNumber
All Known Implementing Classes:
AstCallGraph.AstCGNode, BasicCallGraph.NodeImpl, DelegatingExplicitCallGraph.DelegatingCGNode, ExplicitCallGraph.ExplicitNode

public interface CGNode
extends INodeWithNumber, ContextItem

Basic interface for a node in a call graph.


Method Summary
 boolean addTarget(CallSiteReference site, CGNode target)
          Record that a particular call site might resolve to a call to a particular target node.
 CallGraph getCallGraph()
           
 ControlFlowGraph getCFG(WarningSet warnings)
           
 Context getContext()
          Return the context this CGNode represents.
 DefUse getDU(WarningSet warnings)
           
 IR getIR(WarningSet warnings)
           
 IMethod getMethod()
          Return the method this CGNode represents.
 int getNumberOfTargets(CallSiteReference site)
           
 java.util.Iterator<CallSiteReference> getPossibleSites(CGNode target)
           
 java.util.Set<CGNode> getPossibleTargets(CallSiteReference site)
          Return the set of CGNodes that represent possible targets of a particular call site when invoked in this context.
 java.util.Iterator<CallSiteReference> iterateCallSites()
           
 java.util.Iterator<NewSiteReference> iterateNewSites()
           
 java.util.Iterator<CallSiteReference> iterateSites()
           
 
Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
 

Method Detail

getMethod

IMethod getMethod()
Return the method this CGNode represents. This value will never be null.

Returns:
the target IMethod for this CGNode.

getContext

Context getContext()
Return the context this CGNode represents. This value will never be null.

Returns:
the Context for this CGNode.

getPossibleTargets

java.util.Set<CGNode> getPossibleTargets(CallSiteReference site)
Return the set of CGNodes that represent possible targets of a particular call site when invoked in this context.


iterateSites

java.util.Iterator<CallSiteReference> iterateSites()
Returns:
Iterator of CallSiteReference

getPossibleSites

java.util.Iterator<CallSiteReference> getPossibleSites(CGNode target)
Parameters:
target -
Returns:
iterator of CallSiteReference, the call sites in this node that might dispatch to the target node.

addTarget

boolean addTarget(CallSiteReference site,
                  CGNode target)
Record that a particular call site might resolve to a call to a particular target node. Returns true if this is a new target


getNumberOfTargets

int getNumberOfTargets(CallSiteReference site)
Returns:
the number of nodes that the call site current may resolve to

getCallGraph

CallGraph getCallGraph()
Returns:
the call graph in which this node dwells

getIR

IR getIR(WarningSet warnings)
Returns:
the "default" IR for this node used by the governing call graph

getDU

DefUse getDU(WarningSet warnings)
Returns:
DefUse for the "default" IR for this node used by the governing call graph

getCFG

ControlFlowGraph getCFG(WarningSet warnings)
Returns:
a CFG that represents the node, or null if it's an unmodelled native method

iterateNewSites

java.util.Iterator<NewSiteReference> iterateNewSites()
Returns:
an Iterator of the types that may be allocated by a given method in a given context.

iterateCallSites

java.util.Iterator<CallSiteReference> iterateCallSites()
Returns:
an Iterator of the call statements that may execute in a given method for a given context