public abstract class BasicCallGraph<T> extends com.ibm.wala.util.graph.AbstractNumberedGraph<CGNode> implements CallGraph
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BasicCallGraph.Key |
static class |
BasicCallGraph.NodeImpl
A class that represents the a normal node in a call graph.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<MethodReference,java.util.Set<CGNode>> |
mr2Nodes
A mapping from MethodReference to Set of nodes that represent this methodReference.
|
| Constructor and Description |
|---|
BasicCallGraph() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsNode(CGNode N)
This implementation is necessary because the underlying SparseNumberedGraph may not support
node membership tests.
|
abstract CGNode |
findOrCreateNode(IMethod method,
Context C)
Use with extreme care.
|
java.util.Collection<CGNode> |
getEntrypointNodes()
Note: not all successors of the root node are entrypoints
|
CGNode |
getFakeRootNode()
Return the (fake) interprocedural
root node of the call graph. |
CGNode |
getFakeWorldClinitNode() |
protected T |
getInterpreter(CGNode node) |
protected CGNode |
getNode(BasicCallGraph.Key K) |
CGNode |
getNode(IMethod method,
Context C)
If you want to get all the nodes corresponding to a particular method, regardless of
context, then use
getNodes |
protected com.ibm.wala.util.graph.NumberedNodeManager<CGNode> |
getNodeManager() |
java.util.Set<CGNode> |
getNodes(MethodReference m) |
int |
getNumberOfNodes()
We override this since this class supports remove() on nodes, but the superclass doesn't.
|
void |
init() |
java.util.Iterator<CGNode> |
iterator()
We override this since this class supports remove() on nodes, but the superclass doesn't.
|
protected abstract CGNode |
makeFakeRootNode() |
protected abstract CGNode |
makeFakeWorldClinitNode() |
static java.lang.String |
nodeToString(CallGraph CG,
CGNode n) |
void |
registerEntrypoint(CGNode node)
record that a node is an entrypoint
|
protected void |
registerNode(BasicCallGraph.Key K,
CGNode N) |
void |
removeNodeAndEdges(CGNode N) |
void |
setInterpreter(T interpreter) |
void |
summarizeByPackage() |
java.lang.String |
toString() |
getEdgeManager, getMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodesaddEdge, addNode, edgeString, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeOutgoingEdges, streamclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetClassHierarchy, getNumberOfTargets, getPossibleSites, getPossibleTargetsgetMaxNumber, getNode, getNumber, iterateNodesprotected final java.util.Map<MethodReference,java.util.Set<CGNode>> mr2Nodes
TODO: rhs of mapping doesn't have to be a set if it's a singleton; could be a node instead.
TODO: this is a bit redundant with the nodes Map. Restructure these data structures for space efficiency.
public void init()
throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionprotected abstract CGNode makeFakeRootNode() throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionprotected abstract CGNode makeFakeWorldClinitNode() throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionpublic abstract CGNode findOrCreateNode(IMethod method, Context C) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelException - TODOprotected void registerNode(BasicCallGraph.Key K, CGNode N)
protected CGNode getNode(BasicCallGraph.Key K)
public CGNode getFakeRootNode()
CallGraphroot node of the call graph.getFakeRootNode in interface CallGraphpublic CGNode getFakeWorldClinitNode()
getFakeWorldClinitNode in interface CallGraphpublic void registerEntrypoint(CGNode node)
public java.util.Collection<CGNode> getEntrypointNodes()
getEntrypointNodes in interface CallGraphpublic java.lang.String toString()
toString in class com.ibm.wala.util.graph.AbstractGraph<CGNode>public void removeNodeAndEdges(CGNode N) throws com.ibm.wala.util.debug.UnimplementedError
public CGNode getNode(IMethod method, Context C)
CallGraphgetNodespublic java.util.Set<CGNode> getNodes(MethodReference m)
protected T getInterpreter(CGNode node)
node - a call graph node we want information aboutpublic int getNumberOfNodes()
public java.util.Iterator<CGNode> iterator()
public boolean containsNode(CGNode N)
public void setInterpreter(T interpreter)
protected com.ibm.wala.util.graph.NumberedNodeManager<CGNode> getNodeManager()
getNodeManager in class com.ibm.wala.util.graph.AbstractNumberedGraph<CGNode>public void summarizeByPackage()