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 |
class |
BasicCallGraph.NodeImpl
A class that represents the a normal node in a call graph.
|
Modifier and Type | Field and Description |
---|---|
protected Map<MethodReference,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.
|
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() |
Set<CGNode> |
getNodes(MethodReference m) |
int |
getNumberOfNodes()
We override this since this class supports remove() on nodes, but the superclass doesn't.
|
void |
init() |
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 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() |
String |
toString() |
getEdgeManager, getMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodes
addEdge, addNode, edgeString, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeOutgoingEdges
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClassHierarchy, getNumberOfTargets, getPossibleSites, getPossibleTargets
getMaxNumber, getNode, getNumber, iterateNodes
forEach, spliterator
protected final Map<MethodReference,Set<CGNode>> mr2Nodes
public void init() throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelException
protected abstract CGNode makeFakeRootNode() throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelException
protected abstract CGNode makeFakeWorldClinitNode() throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelException
public 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()
CallGraph
root node
of the call graph.getFakeRootNode
in interface CallGraph
public CGNode getFakeWorldClinitNode()
getFakeWorldClinitNode
in interface CallGraph
public void registerEntrypoint(CGNode node)
public Collection<CGNode> getEntrypointNodes()
getEntrypointNodes
in interface CallGraph
public 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)
CallGraph
getNodes
public Set<CGNode> getNodes(MethodReference m)
protected T getInterpreter(CGNode node)
node
- a call graph node we want information aboutpublic int getNumberOfNodes()
public Iterator<CGNode> iterator()
public boolean containsNode(CGNode N)
containsNode
in interface com.ibm.wala.util.graph.NodeManager<CGNode>
containsNode
in class com.ibm.wala.util.graph.AbstractGraph<CGNode>
IllegalArgumentException
- if N is nullpublic 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()
Copyright © 2019. All rights reserved.