com.ibm.wala.dataflow.IFDS
Class PartiallyCollapsedSupergraph
java.lang.Object
com.ibm.wala.util.graph.AbstractGraph<java.lang.Object>
com.ibm.wala.dataflow.IFDS.PartiallyCollapsedSupergraph
- All Implemented Interfaces:
- ISupergraph<java.lang.Object,CGNode>, EdgeManager<java.lang.Object>, Graph<java.lang.Object>, NodeManager<java.lang.Object>, NumberedEdgeManager<java.lang.Object>, NumberedGraph<java.lang.Object>, NumberedNodeManager<java.lang.Object>, java.lang.Iterable<java.lang.Object>
public class PartiallyCollapsedSupergraph
- extends AbstractGraph<java.lang.Object>
- implements ISupergraph<java.lang.Object,CGNode>
A Supergraph customized for the case when some nodes are "collapsible",
meaning the result for every basic block in a collapsible node is identical.
This graph is an InterproceduralCFG for uncollapsable nodes, hooked up to
collapsed nodes.
|
Constructor Summary |
PartiallyCollapsedSupergraph(CallGraph cg,
CFGCache cfgCache,
java.util.Collection<CGNode> noCollapse,
Filter relevant,
WarningSet warnings)
|
PartiallyCollapsedSupergraph(CallGraph cg,
CFGCache cfgCache,
java.util.Collection<CGNode> noCollapse,
WarningSet warnings)
|
PartiallyCollapsedSupergraph(CallGraph cg,
java.util.Collection<CGNode> noCollapse,
Filter relevant,
WarningSet warnings)
|
PartiallyCollapsedSupergraph(CallGraph cg,
java.util.Collection<CGNode> noCollapse,
WarningSet warnings)
|
| Methods inherited from class com.ibm.wala.util.graph.AbstractGraph |
addEdge, addNode, containsNode, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PartiallyCollapsedSupergraph
public PartiallyCollapsedSupergraph(CallGraph cg,
CFGCache cfgCache,
java.util.Collection<CGNode> noCollapse,
WarningSet warnings)
- Parameters:
cg - Governing call graphnoCollapse - set of nodes in the call graph which cannot be collapsedwarnings - object to track analysis warnings
PartiallyCollapsedSupergraph
public PartiallyCollapsedSupergraph(CallGraph cg,
CFGCache cfgCache,
java.util.Collection<CGNode> noCollapse,
Filter relevant,
WarningSet warnings)
- Parameters:
cg - Governing call graphnoCollapse - set of nodes in the call graph which cannot be collapsedrelevant - set of nodes which are relevant and should be included in the
supergraphwarnings - object to track analysis warnings
PartiallyCollapsedSupergraph
public PartiallyCollapsedSupergraph(CallGraph cg,
java.util.Collection<CGNode> noCollapse,
WarningSet warnings)
- Parameters:
cg - Governing call graphnoCollapse - set of nodes in the call graph which cannot be collapsedwarnings - object to track analysis warnings
PartiallyCollapsedSupergraph
public PartiallyCollapsedSupergraph(CallGraph cg,
java.util.Collection<CGNode> noCollapse,
Filter relevant,
WarningSet warnings)
- Parameters:
cg - Governing call graphnoCollapse - set of nodes in the call graph which cannot be collapsedrelevant - set of nodes which are relevant and should be included in the
supergraphwarnings - object to track analysis warnings
getNodeManager
protected NodeManager<java.lang.Object> getNodeManager()
- Specified by:
getNodeManager in class AbstractGraph<java.lang.Object>
- Returns:
- the object which manages nodes in the graph
getEdgeManager
protected EdgeManager<java.lang.Object> getEdgeManager()
- Specified by:
getEdgeManager in class AbstractGraph<java.lang.Object>
- Returns:
- the object which manages edges in the graph
getMain
public CGNode getMain()
- Specified by:
getMain in interface ISupergraph<java.lang.Object,CGNode>
- Returns:
- an identifier for the main procedure for this supergraph
getEntryForProcedure
public java.lang.Object getEntryForProcedure(java.lang.Object p)
getEntries
public java.lang.Object[] getEntries(java.lang.Object n)
getExitsForProcedure
public java.lang.Object[] getExitsForProcedure(CGNode node)
- Specified by:
getExitsForProcedure in interface ISupergraph<java.lang.Object,CGNode>
- Returns:
- the blocks in the supergraph that represents exit nodes for
procedure p
isCall
public boolean isCall(java.lang.Object object)
- Specified by:
isCall in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
object - a node in this supergraph
- Returns:
- true iff this node includes a call.
isEntry
public boolean isEntry(java.lang.Object object)
- Specified by:
isEntry in interface ISupergraph<java.lang.Object,CGNode>
- Returns:
- true iff this node is an entry node s_p for a procedure
isExit
public boolean isExit(java.lang.Object object)
- Specified by:
isExit in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
object - a node in the supergraph
- Returns:
- true iff this node is an exit node
getCalledNodes
public java.util.Iterator<java.lang.Object> getCalledNodes(java.lang.Object n)
- Specified by:
getCalledNodes in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
n - a "call" node in the supergraph
- Returns:
- an Iterator of nodes that are targets of this call.
getReturnSites
public java.util.Iterator<? extends java.lang.Object> getReturnSites(java.lang.Object object)
- Specified by:
getReturnSites in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
object - a "call" node in the supergraph
- Returns:
- the corresponding return nodes. There may be many, because of
exceptional control flow.
getCallSites
public java.util.Iterator<? extends java.lang.Object> getCallSites(java.lang.Object object)
- Specified by:
getCallSites in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
object - a "return" node in the supergraph
- Returns:
- the corresponding call nodes. There may be many.
getProcOf
public CGNode getProcOf(java.lang.Object n)
- Specified by:
getProcOf in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
n - a node in the supergraph
- Returns:
- an object which represents the procedure which contains n
getEntriesForProcedure
public java.lang.Object[] getEntriesForProcedure(CGNode object)
- Specified by:
getEntriesForProcedure in interface ISupergraph<java.lang.Object,CGNode>
- Returns:
- the blocks in the supergraph that represents entry nodes for
procedure p
getMainEntry
public java.lang.Object getMainEntry()
- Specified by:
getMainEntry in interface ISupergraph<java.lang.Object,CGNode>
- Returns:
- the unique entry node s_main for the main procedure
getMainExit
public java.lang.Object getMainExit()
- Specified by:
getMainExit in interface ISupergraph<java.lang.Object,CGNode>
- Returns:
- the unique entry node e_main for the main procedure
isReturn
public boolean isReturn(java.lang.Object object)
- Specified by:
isReturn in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
object - a node in this supergraph
- Returns:
- true iff this node is a return site.
getUncollapsedGraph
public InterproceduralCFG getUncollapsedGraph()
- Returns:
- the portion of this graph that is a normal, uncollapsed, ICFG
classifyEdge
public byte classifyEdge(java.lang.Object src,
java.lang.Object dest)
- Specified by:
classifyEdge in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
src - node in the supergraphdest - a successor of src in the supergraph
- Returns:
- one of CALL_EDGE, RETURN_EDGE, CALL_TO_RETURN_EDGE, or OTHER
getNormalSuccessors
public java.util.Iterator<java.lang.Object> getNormalSuccessors(java.lang.Object call)
- In forward problems, a call node will have no normal successors.
- Specified by:
getNormalSuccessors in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
call - a "call" node in the supergraph
- Returns:
- an Iterator of nodes that are normal (non-call) successors of this
call. This should only apply to backwards problems, where we might
have, say, a call and a goto flow into a return site.
- See Also:
ISupergraph.getNormalSuccessors(java.lang.Object)
getNumberOfBlocks
public int getNumberOfBlocks(CGNode procedure)
- Specified by:
getNumberOfBlocks in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
procedure - an object that represents a procedure
- Returns:
- the number of blocks from this procedure in this supergraph
getLocalBlockNumber
public int getLocalBlockNumber(java.lang.Object n)
- Specified by:
getLocalBlockNumber in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
n - a node in the supergraph
- Returns:
- the "logical" basic block number of n in its procedure
getLocalBlock
public java.lang.Object getLocalBlock(CGNode procedure,
int i)
- Specified by:
getLocalBlock in interface ISupergraph<java.lang.Object,CGNode>
- Parameters:
procedure - an object that represents a procedurei - the "logical" basic block number of a node in the procedure
- Returns:
- the corresponding node in the supergraph
getNumber
public int getNumber(java.lang.Object N)
- Specified by:
getNumber in interface NumberedNodeManager<java.lang.Object>
getNode
public java.lang.Object getNode(int number)
- Specified by:
getNode in interface NumberedNodeManager<java.lang.Object>
getMaxNumber
public int getMaxNumber()
- Specified by:
getMaxNumber in interface NumberedNodeManager<java.lang.Object>
iterateNodes
public java.util.Iterator<java.lang.Object> iterateNodes(IntSet s)
- Specified by:
iterateNodes in interface NumberedNodeManager<java.lang.Object>
- Returns:
- iterator of nodes with the numbers in set s
getSuccNodeNumbers
public IntSet getSuccNodeNumbers(java.lang.Object node)
- Specified by:
getSuccNodeNumbers in interface NumberedEdgeManager<java.lang.Object>
- Returns:
- the numbers identifying the immediate successors of node
getPredNodeNumbers
public IntSet getPredNodeNumbers(java.lang.Object node)
- Specified by:
getPredNodeNumbers in interface NumberedEdgeManager<java.lang.Object>
- Returns:
- the numbers identifying the immediate predecessors of node
getCallGraph
public CallGraph getCallGraph()