|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.util.graph.AbstractGraph<T>
com.ibm.wala.util.graph.AbstractNumberedGraph<CGNode>
com.ibm.wala.ipa.callgraph.impl.BasicCallGraph
public abstract class BasicCallGraph
Basic data structure support for a call graph.
| Nested Class Summary | |
|---|---|
protected static class |
BasicCallGraph.Key
|
class |
BasicCallGraph.NodeImpl
A class that represents the a normal node in a call graph. |
| Constructor Summary | |
|---|---|
BasicCallGraph()
|
|
| Method Summary | |
|---|---|
boolean |
containsNode(CGNode N)
This implementation is necessary because the underlying SparseNumberedGraph may not support node membership tests. |
void |
dump(java.lang.String filename)
Dump this callgraph to the specified file in dotty(1) format. |
abstract CGNode |
findOrCreateNode(IMethod method,
Context C)
Method findOrCreateNode. |
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()
|
SSAContextInterpreter |
getInterpreter(CGNode node)
|
protected BasicCallGraph.NodeImpl |
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 NodeManager<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()
|
void |
registerEntrypoint(CGNode node)
record that a node is an entrypoint |
protected void |
registerNode(BasicCallGraph.Key K,
CGNode N)
|
void |
removeNodeAndEdges(CGNode N)
remove a node and all its incident edges |
void |
setInterpreter(SSAContextInterpreter interpreter)
|
java.lang.String |
toString()
|
| Methods inherited from class com.ibm.wala.util.graph.AbstractNumberedGraph |
|---|
getMaxNumber, getNode, getNumber, getPredNodeNumbers, getSuccNodeNumbers, iterateNodes |
| Methods inherited from class com.ibm.wala.util.graph.AbstractGraph |
|---|
addEdge, addNode, getEdgeManager, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeOutgoingEdges |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ibm.wala.ipa.callgraph.CallGraph |
|---|
getClassHierarchy |
| Methods inherited from interface com.ibm.wala.util.graph.NodeManager |
|---|
addNode, 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.NumberedNodeManager |
|---|
getMaxNumber, getNode, getNumber, iterateNodes |
| Methods inherited from interface com.ibm.wala.util.graph.NodeManager |
|---|
addNode, removeNode |
| Methods inherited from interface com.ibm.wala.util.graph.NumberedEdgeManager |
|---|
getPredNodeNumbers, getSuccNodeNumbers |
| Methods inherited from interface com.ibm.wala.util.graph.EdgeManager |
|---|
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges |
| Constructor Detail |
|---|
public BasicCallGraph()
| Method Detail |
|---|
public void init()
protected abstract CGNode makeFakeRootNode()
protected abstract CGNode makeFakeWorldClinitNode()
public abstract CGNode findOrCreateNode(IMethod method,
Context C)
method -
protected void registerNode(BasicCallGraph.Key K,
CGNode N)
protected BasicCallGraph.NodeImpl getNode(BasicCallGraph.Key K)
public CGNode getFakeRootNode()
CallGraphroot node
of the call graph.
getFakeRootNode in interface CallGraphpublic CGNode getFakeWorldClinitNode()
public void registerEntrypoint(CGNode node)
public java.util.Collection<CGNode> getEntrypointNodes()
getEntrypointNodes in interface CallGraphpublic java.lang.String toString()
toString in class AbstractGraph<CGNode>public void dump(java.lang.String filename)
dump in interface CallGraphjava.lang.IllegalArgumentException - if filename is nullpublic void removeNodeAndEdges(CGNode N)
Graph
removeNodeAndEdges in interface Graph<CGNode>removeNodeAndEdges in class AbstractGraph<CGNode>
public CGNode getNode(IMethod method,
Context C)
CallGraphgetNodes
getNode in interface CallGraphmethod -
public java.util.Set<CGNode> getNodes(MethodReference m)
getNodes in interface CallGraphm - a method reference
public SSAContextInterpreter getInterpreter(CGNode node)
public int getNumberOfNodes()
getNumberOfNodes in interface NodeManager<CGNode>getNumberOfNodes in class AbstractGraph<CGNode>NodeManager.getNumberOfNodes()public java.util.Iterator<CGNode> iterator()
iterator in interface NodeManager<CGNode>iterator in interface java.lang.Iterable<CGNode>iterator in class AbstractGraph<CGNode>NodeManager.iterator()public boolean containsNode(CGNode N)
containsNode in interface NodeManager<CGNode>containsNode in class AbstractGraph<CGNode>java.lang.IllegalArgumentException - if N is nullpublic void setInterpreter(SSAContextInterpreter interpreter)
interpreter - protected NodeManager<CGNode> getNodeManager()
getNodeManager in class AbstractGraph<CGNode>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||