Package com.ibm.wala.ipa.slicer.thin
Class CISDG
- java.lang.Object
-
- com.ibm.wala.ipa.slicer.thin.CISDG
-
- All Implemented Interfaces:
IClassHierarchyDweller
,ISDG
,EdgeManager<Statement>
,Graph<Statement>
,NodeManager<Statement>
,NumberedEdgeManager<Statement>
,NumberedGraph<Statement>
,NumberedNodeManager<Statement>
,Iterable<Statement>
public class CISDG extends Object implements ISDG
A context-insensitive SDG. This class assumes that it is given a normal NO_HEAP SDG. It adds context-insensitive heap information directly from heap stores to corresponding loads, based on an underlying pointer analysis.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CISDG(SDG<InstanceKey> noHeap, Map<Statement,Set<PointerKey>> mod, Map<Statement,Set<PointerKey>> ref)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdge(Statement src, Statement dst)
void
addNode(Statement n)
add a node to this graphboolean
containsNode(Statement N)
boolean
equals(Object obj)
IClassHierarchy
getClassHierarchy()
Slicer.ControlDependenceOptions
getCOptions()
Slicer.ControlDependenceOptions
used to construct this graph.int
getMaxNumber()
Statement
getNode(int number)
int
getNumber(Statement N)
int
getNumberOfNodes()
PDG
getPDG(CGNode node)
Get the program dependence graph constructed for a particular node.int
getPredNodeCount(Statement N)
Return the number ofimmediate predecessor
nodes of nIntSet
getPredNodeNumbers(Statement node)
Iterator<Statement>
getPredNodes(Statement N)
Return anIterator
over the immediate predecessor nodes of n This method never returnsnull
.int
getSuccNodeCount(Statement N)
Return the number ofimmediate successor
nodes of this Node in the GraphIntSet
getSuccNodeNumbers(Statement node)
Iterator<Statement>
getSuccNodes(Statement N)
Return an Iterator over the immediate successor nodes of nboolean
hasEdge(Statement src, Statement dst)
int
hashCode()
Iterator<? extends Statement>
iterateLazyNodes()
Iterate over the nodes which have been discovered so far, but do NOT eagerly construct the entire graph.Iterator<Statement>
iterateNodes(IntSet s)
Iterator<Statement>
iterator()
void
removeAllIncidentEdges(Statement node)
void
removeEdge(Statement src, Statement dst)
void
removeIncomingEdges(Statement node)
void
removeNode(Statement n)
remove a node from this graphvoid
removeNodeAndEdges(Statement N)
remove a node and all its incident edgesvoid
removeOutgoingEdges(Statement node)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CISDG
protected CISDG(SDG<InstanceKey> noHeap, Map<Statement,Set<PointerKey>> mod, Map<Statement,Set<PointerKey>> ref)
-
-
Method Detail
-
addEdge
public void addEdge(Statement src, Statement dst)
- Specified by:
addEdge
in interfaceEdgeManager<Statement>
-
addNode
public void addNode(Statement n)
Description copied from interface:NodeManager
add a node to this graph- Specified by:
addNode
in interfaceNodeManager<Statement>
-
containsNode
public boolean containsNode(Statement N)
- Specified by:
containsNode
in interfaceNodeManager<Statement>
- Returns:
- true iff the graph contains the specified node
-
getCOptions
public Slicer.ControlDependenceOptions getCOptions()
Description copied from interface:ISDG
Slicer.ControlDependenceOptions
used to construct this graph.- Specified by:
getCOptions
in interfaceISDG
-
getMaxNumber
public int getMaxNumber()
- Specified by:
getMaxNumber
in interfaceNumberedNodeManager<Statement>
-
getNode
public Statement getNode(int number)
- Specified by:
getNode
in interfaceNumberedNodeManager<Statement>
-
getNumber
public int getNumber(Statement N)
- Specified by:
getNumber
in interfaceNumberedNodeManager<Statement>
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodes
in interfaceNodeManager<Statement>
- Returns:
- the number of nodes in this graph
-
getPDG
public PDG getPDG(CGNode node)
Description copied from interface:ISDG
Get the program dependence graph constructed for a particular node.
-
getPredNodeCount
public int getPredNodeCount(Statement N)
Description copied from interface:EdgeManager
Return the number ofimmediate predecessor
nodes of n- Specified by:
getPredNodeCount
in interfaceEdgeManager<Statement>
- Returns:
- the number of immediate predecessors of n.
-
getPredNodeNumbers
public IntSet getPredNodeNumbers(Statement node)
- Specified by:
getPredNodeNumbers
in interfaceNumberedEdgeManager<Statement>
- Returns:
- the numbers identifying the immediate predecessors of node
-
getPredNodes
public Iterator<Statement> getPredNodes(Statement N)
Description copied from interface:EdgeManager
Return anIterator
over the immediate predecessor nodes of n This method never returnsnull
.- Specified by:
getPredNodes
in interfaceEdgeManager<Statement>
- Returns:
- an
Iterator
over the immediate predecessor nodes of this Node.
-
getSuccNodeCount
public int getSuccNodeCount(Statement N)
Description copied from interface:EdgeManager
Return the number ofimmediate successor
nodes of this Node in the Graph- Specified by:
getSuccNodeCount
in interfaceEdgeManager<Statement>
- Returns:
- the number of immediate successor Nodes of this Node in the Graph.
-
getSuccNodeNumbers
public IntSet getSuccNodeNumbers(Statement node)
- Specified by:
getSuccNodeNumbers
in interfaceNumberedEdgeManager<Statement>
- Returns:
- the numbers identifying the immediate successors of node
-
getSuccNodes
public Iterator<Statement> getSuccNodes(Statement N)
Description copied from interface:EdgeManager
Return an Iterator over the immediate successor nodes of nThis method never returns
null
.- Specified by:
getSuccNodes
in interfaceEdgeManager<Statement>
- Returns:
- an Iterator over the immediate successor nodes of n
-
hasEdge
public boolean hasEdge(Statement src, Statement dst)
- Specified by:
hasEdge
in interfaceEdgeManager<Statement>
-
iterateLazyNodes
public Iterator<? extends Statement> iterateLazyNodes()
Description copied from interface:ISDG
Iterate over the nodes which have been discovered so far, but do NOT eagerly construct the entire graph.- Specified by:
iterateLazyNodes
in interfaceISDG
-
iterateNodes
public Iterator<Statement> iterateNodes(IntSet s)
- Specified by:
iterateNodes
in interfaceNumberedNodeManager<Statement>
- Returns:
- iterator of nodes with the numbers in set s
-
removeAllIncidentEdges
public void removeAllIncidentEdges(Statement node)
- Specified by:
removeAllIncidentEdges
in interfaceEdgeManager<Statement>
-
removeEdge
public void removeEdge(Statement src, Statement dst)
- Specified by:
removeEdge
in interfaceEdgeManager<Statement>
-
removeIncomingEdges
public void removeIncomingEdges(Statement node)
- Specified by:
removeIncomingEdges
in interfaceEdgeManager<Statement>
-
removeNode
public void removeNode(Statement n)
Description copied from interface:NodeManager
remove a node from this graph- Specified by:
removeNode
in interfaceNodeManager<Statement>
-
removeNodeAndEdges
public void removeNodeAndEdges(Statement N)
Description copied from interface:Graph
remove a node and all its incident edges- Specified by:
removeNodeAndEdges
in interfaceGraph<Statement>
-
removeOutgoingEdges
public void removeOutgoingEdges(Statement node)
- Specified by:
removeOutgoingEdges
in interfaceEdgeManager<Statement>
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
- Specified by:
getClassHierarchy
in interfaceIClassHierarchyDweller
-
-