public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> extends java.lang.Object implements com.ibm.wala.util.graph.NumberedGraph<BasicBlockInContext<T>>
| Constructor and Description |
|---|
AbstractInterproceduralCFG(CallGraph cg)
Build an Interprocedural CFG from a call graph.
|
AbstractInterproceduralCFG(CallGraph CG,
java.util.function.Predicate<CGNode> relevant)
Build an Interprocedural CFG from a call graph.
|
public AbstractInterproceduralCFG(CallGraph cg)
cg - the call graphpublic AbstractInterproceduralCFG(CallGraph CG, java.util.function.Predicate<CGNode> relevant)
CG - the call graphrelevant - a filter which accepts those call graph nodes which should be included in the
I-CFG. Other nodes are ignored.public void callGraphUpdated()
public abstract ControlFlowGraph<SSAInstruction,T> getCFG(CGNode n)
protected void addEdgesToNonEntryBlock(CGNode n, ControlFlowGraph<?,T> cfg, SSAInstruction[] instrs, T bb)
n - a call graph nodecfg - the CFG for ninstrs - the instructions for node nbb - a basic block in the CFGprotected SSAInstruction getLastInstructionForBlock(T pb, SSAInstruction[] instrs)
public ControlFlowGraph<SSAInstruction,T> getCFG(BasicBlockInContext<T> B) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if B == nullpublic CGNode getCGNode(BasicBlockInContext<T> B) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if B == nullpublic void removeNodeAndEdges(BasicBlockInContext<T> N) throws java.lang.UnsupportedOperationException
removeNodeAndEdges in interface com.ibm.wala.util.graph.Graph<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic java.util.Iterator<BasicBlockInContext<T>> iterator()
iterator in interface com.ibm.wala.util.graph.NodeManager<BasicBlockInContext<T extends ISSABasicBlock>>iterator in interface java.lang.Iterable<BasicBlockInContext<T extends ISSABasicBlock>>public java.util.stream.Stream<BasicBlockInContext<T>> stream()
stream in interface com.ibm.wala.util.graph.NodeManager<BasicBlockInContext<T extends ISSABasicBlock>>public int getNumberOfNodes()
getNumberOfNodes in interface com.ibm.wala.util.graph.NodeManager<BasicBlockInContext<T extends ISSABasicBlock>>public void addNode(BasicBlockInContext<T> n) throws java.lang.UnsupportedOperationException
addNode in interface com.ibm.wala.util.graph.NodeManager<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic void removeNode(BasicBlockInContext<T> n) throws java.lang.UnsupportedOperationException
removeNode in interface com.ibm.wala.util.graph.NodeManager<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic java.util.Iterator<BasicBlockInContext<T>> getPredNodes(BasicBlockInContext<T> N)
getPredNodes in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>public int getPredNodeCount(BasicBlockInContext<T> N)
getPredNodeCount in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>public java.util.Iterator<BasicBlockInContext<T>> getSuccNodes(BasicBlockInContext<T> N)
getSuccNodes in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>public int getSuccNodeCount(BasicBlockInContext<T> N)
getSuccNodeCount in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>public void addEdge(BasicBlockInContext<T> src, BasicBlockInContext<T> dst) throws java.lang.UnsupportedOperationException
addEdge in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic void removeEdge(BasicBlockInContext<T> src, BasicBlockInContext<T> dst) throws java.lang.UnsupportedOperationException
removeEdge in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic void removeAllIncidentEdges(BasicBlockInContext<T> node) throws java.lang.UnsupportedOperationException
removeAllIncidentEdges in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean containsNode(BasicBlockInContext<T> N)
containsNode in interface com.ibm.wala.util.graph.NodeManager<BasicBlockInContext<T extends ISSABasicBlock>>public boolean hasCall(BasicBlockInContext<T> B)
protected boolean hasCall(BasicBlockInContext<T> B, ControlFlowGraph<SSAInstruction,T> cfg)
public java.util.Set<CGNode> getCallTargets(BasicBlockInContext<T> B)
java.lang.IllegalArgumentException - if B is nullprotected CallSiteReference getCallSiteForCallBlock(IBasicBlock<SSAInstruction> B, ControlFlowGraph<SSAInstruction,T> cfg)
CallSiteReference corresponding to the last instruction in B (assumed to be a
call)public void removeIncomingEdges(BasicBlockInContext<T> node) throws java.lang.UnsupportedOperationException
removeIncomingEdges in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic void removeOutgoingEdges(BasicBlockInContext<T> node) throws java.lang.UnsupportedOperationException
removeOutgoingEdges in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>java.lang.UnsupportedOperationExceptionpublic boolean hasEdge(BasicBlockInContext<T> src, BasicBlockInContext<T> dst)
hasEdge in interface com.ibm.wala.util.graph.EdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>public int getNumber(BasicBlockInContext<T> N)
getNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<BasicBlockInContext<T extends ISSABasicBlock>>public BasicBlockInContext<T> getNode(int number) throws com.ibm.wala.util.debug.UnimplementedError
getNode in interface com.ibm.wala.util.graph.NumberedNodeManager<BasicBlockInContext<T extends ISSABasicBlock>>com.ibm.wala.util.debug.UnimplementedErrorpublic int getMaxNumber()
getMaxNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<BasicBlockInContext<T extends ISSABasicBlock>>public java.util.Iterator<BasicBlockInContext<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<BasicBlockInContext<T extends ISSABasicBlock>>com.ibm.wala.util.debug.UnimplementedErrorpublic com.ibm.wala.util.intset.IntSet getSuccNodeNumbers(BasicBlockInContext<T> node)
getSuccNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>public com.ibm.wala.util.intset.IntSet getPredNodeNumbers(BasicBlockInContext<T> node)
getPredNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<BasicBlockInContext<T extends ISSABasicBlock>>public BasicBlockInContext<T> getEntry(CGNode n)
public BasicBlockInContext<T> getExit(CGNode n)
public java.util.Iterator<BasicBlockInContext<T>> getReturnSites(BasicBlockInContext<T> callBlock)
callBlock - node in the IPCFG that ends in a calljava.lang.IllegalArgumentException - if bb is nullpublic java.util.Iterator<BasicBlockInContext<T>> getCallSites(BasicBlockInContext<T> returnBlock, CGNode callee)
public boolean isReturn(BasicBlockInContext<T> bb) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException