Package com.ibm.wala.ipa.slicer
Class SDG<T extends InstanceKey>
- java.lang.Object
-
- com.ibm.wala.util.graph.AbstractGraph<T>
-
- com.ibm.wala.util.graph.AbstractNumberedGraph<Statement>
-
- com.ibm.wala.ipa.slicer.SDG<T>
-
- All Implemented Interfaces:
IClassHierarchyDweller
,ISDG
,EdgeManager<Statement>
,Graph<Statement>
,NodeManager<Statement>
,NumberedEdgeManager<Statement>
,NumberedGraph<Statement>
,NumberedNodeManager<Statement>
,Iterable<Statement>
public class SDG<T extends InstanceKey> extends AbstractNumberedGraph<Statement> implements ISDG
System dependence graph. An SDG comprises a set of PDGs, one for each method. We compute these lazily. Prototype implementation. Not efficient.
-
-
Constructor Summary
Constructors Constructor Description SDG(CallGraph cg, PointerAnalysis<T> pa, ModRef modRef, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions)
SDG(CallGraph cg, PointerAnalysis<T> pa, ModRef modRef, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions, HeapExclusions heapExclude)
SDG(CallGraph cg, PointerAnalysis<T> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CallGraph
getCallGraph()
IClassHierarchy
getClassHierarchy()
Slicer.ControlDependenceOptions
getCOptions()
Slicer.ControlDependenceOptions
used to construct this graph.Slicer.DataDependenceOptions
getDOptions()
protected NumberedEdgeManager<Statement>
getEdgeManager()
NumberedNodeManager<Statement>
getNodeManager()
PDG
getPDG(CGNode node)
Get the program dependence graph constructed for a particular node.PointerAnalysis<? extends InstanceKey>
getPointerAnalysis()
Iterator<? extends Statement>
iterateLazyNodes()
iterate over the nodeswithout constructing any new ones.String
toString()
Use this with care.-
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, containsNode, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, 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.util.graph.EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
-
Methods inherited from interface com.ibm.wala.util.graph.Graph
removeNodeAndEdges
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface com.ibm.wala.util.graph.NodeManager
addNode, containsNode, getNumberOfNodes, iterator, removeNode
-
Methods inherited from interface com.ibm.wala.util.graph.NumberedEdgeManager
getPredNodeNumbers, getSuccNodeNumbers
-
Methods inherited from interface com.ibm.wala.util.graph.NumberedNodeManager
getMaxNumber, getNode, getNumber, iterateNodes
-
-
-
-
Constructor Detail
-
SDG
public SDG(CallGraph cg, PointerAnalysis<T> pa, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions)
-
SDG
public SDG(CallGraph cg, PointerAnalysis<T> pa, ModRef modRef, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions)
-
SDG
public SDG(CallGraph cg, PointerAnalysis<T> pa, ModRef modRef, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions, HeapExclusions heapExclude) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
toString
public String toString()
Use this with care. This forces eager construction of the SDG, and SDGs can be big.- Overrides:
toString
in classAbstractGraph<Statement>
- See Also:
AbstractGraph.toString()
-
iterateLazyNodes
public Iterator<? extends Statement> iterateLazyNodes()
iterate over the nodeswithout constructing any new ones. Use with extreme care. May break graph traversals that lazily add more nodes.- Specified by:
iterateLazyNodes
in interfaceISDG
-
getEdgeManager
protected NumberedEdgeManager<Statement> getEdgeManager()
- Specified by:
getEdgeManager
in classAbstractNumberedGraph<Statement>
- Returns:
- the object which manages edges in the graph
-
getNodeManager
public NumberedNodeManager<Statement> getNodeManager()
- Specified by:
getNodeManager
in classAbstractNumberedGraph<Statement>
- Returns:
- the object which manages nodes in the graph
-
getPDG
public PDG getPDG(CGNode node)
Description copied from interface:ISDG
Get the program dependence graph constructed for a particular node.
-
getCOptions
public Slicer.ControlDependenceOptions getCOptions()
Description copied from interface:ISDG
Slicer.ControlDependenceOptions
used to construct this graph.- Specified by:
getCOptions
in interfaceISDG
-
getDOptions
public Slicer.DataDependenceOptions getDOptions()
-
getCallGraph
public CallGraph getCallGraph()
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
- Specified by:
getClassHierarchy
in interfaceIClassHierarchyDweller
-
getPointerAnalysis
public PointerAnalysis<? extends InstanceKey> getPointerAnalysis()
-
-