public class BackwardsSupergraph<T,P> extends java.lang.Object implements ISupergraph<T,P>
In this view, a return is treated like a call, and vice-versa. All normal edges are reversed.
CALL_EDGE, CALL_TO_RETURN_EDGE, OTHER, RETURN_EDGE| Modifier | Constructor and Description |
|---|---|
protected |
BackwardsSupergraph(ISupergraph<T,P> forwardGraph) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(java.lang.Object src,
java.lang.Object dst) |
void |
addNode(java.lang.Object n) |
byte |
classifyEdge(T src,
T dest) |
boolean |
containsNode(T N) |
java.util.Iterator<T> |
getCalledNodes(T ret)
get the "called" (sic) nodes for a return site; i.e., the exit nodes that flow directly to this
return site.
|
java.util.Iterator<? extends T> |
getCallSites(T r,
P callee) |
T[] |
getEntriesForProcedure(P object) |
T[] |
getExitsForProcedure(P object) |
T |
getLocalBlock(P procedure,
int i) |
int |
getLocalBlockNumber(T n) |
int |
getMaxNumber() |
T |
getNode(int number) |
java.util.Iterator<T> |
getNormalSuccessors(T ret)
get the "normal" successors (sic) for a return site; i.e., the "normal" CFG predecessors that
are not call nodes.
|
int |
getNumber(T N) |
int |
getNumberOfBlocks(P procedure) |
int |
getNumberOfNodes() |
int |
getPredNodeCount(T N) |
com.ibm.wala.util.intset.IntSet |
getPredNodeNumbers(java.lang.Object node) |
java.util.Iterator<T> |
getPredNodes(T N) |
com.ibm.wala.util.graph.Graph<P> |
getProcedureGraph()
TODO: for now, this is not inverted.
|
P |
getProcOf(T n) |
java.util.Iterator<? extends T> |
getReturnSites(T c,
P callee) |
int |
getSuccNodeCount(T N) |
com.ibm.wala.util.intset.IntSet |
getSuccNodeNumbers(T node) |
java.util.Iterator<T> |
getSuccNodes(T N) |
boolean |
hasEdge(T src,
T dst) |
boolean |
isCall(T n) |
boolean |
isEntry(T n) |
boolean |
isExit(T n) |
boolean |
isReturn(T n) |
java.util.Iterator<T> |
iterateNodes(com.ibm.wala.util.intset.IntSet s) |
java.util.Iterator<T> |
iterator() |
static <T,P> BackwardsSupergraph<T,P> |
make(ISupergraph<T,P> forwardGraph) |
void |
removeAllIncidentEdges(java.lang.Object node) |
void |
removeEdge(java.lang.Object src,
java.lang.Object dst) |
void |
removeIncomingEdges(java.lang.Object node) |
void |
removeNode(java.lang.Object n) |
void |
removeNodeAndEdges(java.lang.Object N) |
void |
removeOutgoingEdges(T node) |
java.util.stream.Stream<T> |
stream() |
java.lang.String |
toString() |
protected BackwardsSupergraph(ISupergraph<T,P> forwardGraph)
forwardGraph - the graph to ``reverse''public static <T,P> BackwardsSupergraph<T,P> make(ISupergraph<T,P> forwardGraph)
public com.ibm.wala.util.graph.Graph<P> getProcedureGraph()
getProcedureGraph in interface ISupergraph<T,P>public boolean isCall(T n)
isCall in interface ISupergraph<T,P>n - a node in this supergraphpublic java.util.Iterator<T> getCalledNodes(T ret)
getCalledNodes in interface ISupergraph<T,P>ret - a "call" node in the supergraphpublic java.util.Iterator<T> getNormalSuccessors(T ret)
getNormalSuccessors in interface ISupergraph<T,P>ret - a "call" node in the supergraphISupergraph.getCalledNodes(java.lang.Object)public java.util.Iterator<? extends T> getReturnSites(T c, P callee)
getReturnSites in interface ISupergraph<T,P>c - a "call" node in the supergraphcallee - a "called" "procedure" in the supergraph. if callee is null, answer return sites
for which no callee was found.public boolean isExit(T n)
isExit in interface ISupergraph<T,P>n - a node in the supergraphpublic P getProcOf(T n)
getProcOf in interface ISupergraph<T,P>n - a node in the supergraphpublic void removeNodeAndEdges(java.lang.Object N)
throws java.lang.UnsupportedOperationException
removeNodeAndEdges in interface com.ibm.wala.util.graph.Graph<T>java.lang.UnsupportedOperationExceptionpublic java.util.Iterator<T> iterator()
public java.util.stream.Stream<T> stream()
stream in interface com.ibm.wala.util.graph.NodeManager<T>public int getNumberOfNodes()
getNumberOfNodes in interface com.ibm.wala.util.graph.NodeManager<T>public void addNode(java.lang.Object n)
throws java.lang.UnsupportedOperationException
addNode in interface com.ibm.wala.util.graph.NodeManager<T>java.lang.UnsupportedOperationExceptionpublic void removeNode(java.lang.Object n)
throws java.lang.UnsupportedOperationException
removeNode in interface com.ibm.wala.util.graph.NodeManager<T>java.lang.UnsupportedOperationExceptionpublic boolean containsNode(T N)
containsNode in interface com.ibm.wala.util.graph.NodeManager<T>public java.util.Iterator<T> getPredNodes(T N)
getPredNodes in interface com.ibm.wala.util.graph.EdgeManager<T>public int getPredNodeCount(T N)
getPredNodeCount in interface com.ibm.wala.util.graph.EdgeManager<T>public java.util.Iterator<T> getSuccNodes(T N)
getSuccNodes in interface com.ibm.wala.util.graph.EdgeManager<T>public boolean hasEdge(T src, T dst)
hasEdge in interface com.ibm.wala.util.graph.EdgeManager<T>public int getSuccNodeCount(T N)
getSuccNodeCount in interface com.ibm.wala.util.graph.EdgeManager<T>public void addEdge(java.lang.Object src,
java.lang.Object dst)
throws java.lang.UnsupportedOperationException
addEdge in interface com.ibm.wala.util.graph.EdgeManager<T>java.lang.UnsupportedOperationExceptionpublic void removeEdge(java.lang.Object src,
java.lang.Object dst)
throws java.lang.UnsupportedOperationException
removeEdge in interface com.ibm.wala.util.graph.EdgeManager<T>java.lang.UnsupportedOperationExceptionpublic void removeAllIncidentEdges(java.lang.Object node)
throws java.lang.UnsupportedOperationException
removeAllIncidentEdges in interface com.ibm.wala.util.graph.EdgeManager<T>java.lang.UnsupportedOperationExceptionpublic T[] getEntriesForProcedure(P object)
getEntriesForProcedure in interface ISupergraph<T,P>public T[] getExitsForProcedure(P object)
getExitsForProcedure in interface ISupergraph<T,P>public boolean isReturn(T n) throws com.ibm.wala.util.debug.UnimplementedError
isReturn in interface ISupergraph<T,P>n - a node in this supergraphcom.ibm.wala.util.debug.UnimplementedErrorpublic java.util.Iterator<? extends T> getCallSites(T r, P callee)
getCallSites in interface ISupergraph<T,P>r - a "return" node in the supergraphcallee - a "called" "procedure" in the supergraph. if callee is null, answer return sites
for which no callee was found.public boolean isEntry(T n)
isEntry in interface ISupergraph<T,P>public byte classifyEdge(T src, T dest)
classifyEdge in interface ISupergraph<T,P>src - node in the supergraphdest - a successor of src in the supergraphpublic java.lang.String toString()
toString in class java.lang.Objectpublic void removeIncomingEdges(java.lang.Object node)
throws java.lang.UnsupportedOperationException
removeIncomingEdges in interface com.ibm.wala.util.graph.EdgeManager<T>java.lang.UnsupportedOperationExceptionpublic void removeOutgoingEdges(T node) throws java.lang.UnsupportedOperationException
removeOutgoingEdges in interface com.ibm.wala.util.graph.EdgeManager<T>java.lang.UnsupportedOperationExceptionpublic int getNumberOfBlocks(P procedure)
getNumberOfBlocks in interface ISupergraph<T,P>procedure - an object that represents a procedurepublic int getLocalBlockNumber(T n)
getLocalBlockNumber in interface ISupergraph<T,P>n - a node in the supergraphpublic T getLocalBlock(P procedure, int i)
getLocalBlock in interface ISupergraph<T,P>procedure - an object that represents a procedurei - the "logical" basic block number of a node in the procedurepublic int getNumber(T N)
getNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<T>public T getNode(int number)
getNode in interface com.ibm.wala.util.graph.NumberedNodeManager<T>public int getMaxNumber()
getMaxNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<T>public java.util.Iterator<T> iterateNodes(com.ibm.wala.util.intset.IntSet s) throws com.ibm.wala.util.debug.UnimplementedError
iterateNodes in interface com.ibm.wala.util.graph.NumberedNodeManager<T>com.ibm.wala.util.debug.UnimplementedErrorpublic com.ibm.wala.util.intset.IntSet getSuccNodeNumbers(T node)
getSuccNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<T>public com.ibm.wala.util.intset.IntSet getPredNodeNumbers(java.lang.Object node)
throws com.ibm.wala.util.debug.UnimplementedError
getPredNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<T>com.ibm.wala.util.debug.UnimplementedError