public class PDG<T extends InstanceKey> extends Object implements NumberedGraph<Statement>
| Modifier and Type | Class and Description |
|---|---|
static class |
PDG.Dependency
BEGIN Custom change: control deps
|
| Constructor and Description |
|---|
PDG(CGNode node,
PointerAnalysis<T> pa,
Map<CGNode,OrdinalSet<PointerKey>> mod,
Map<CGNode,OrdinalSet<PointerKey>> ref,
Slicer.DataDependenceOptions dOptions,
Slicer.ControlDependenceOptions cOptions,
HeapExclusions exclusions,
CallGraph cg,
ModRef modRef) |
PDG(CGNode node,
PointerAnalysis<T> pa,
Map<CGNode,OrdinalSet<PointerKey>> mod,
Map<CGNode,OrdinalSet<PointerKey>> ref,
Slicer.DataDependenceOptions dOptions,
Slicer.ControlDependenceOptions cOptions,
HeapExclusions exclusions,
CallGraph cg,
ModRef modRef,
boolean ignoreAllocHeapDefs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(Statement src,
Statement dst) |
void |
addNode(Statement n)
add a node to this graph
|
static Map<SSAInstruction,Integer> |
computeInstructionIndices(IR ir) |
boolean |
containsNode(Statement N) |
boolean |
equals(Object obj) |
Set<Statement> |
getCallerParamStatements(SSAAbstractInvokeInstruction call)
return the set of all PARAM_CALLER and HEAP_PARAM_CALLER statements associated with a given call
|
Set<Statement> |
getCallerReturnStatements(SSAAbstractInvokeInstruction call)
return the set of all NORMAL_RETURN_CALLER and HEAP_RETURN_CALLER statements associated with a given call.
|
CGNode |
getCallGraphNode() |
Set<Statement> |
getCallStatements(SSAAbstractInvokeInstruction call)
return the set of all PARAM_CALLER, HEAP_PARAM_CALLER, and NORMAL statements (i.e., the actual call statement) associated with
a given call
|
int |
getMaxNumber() |
Statement |
getNode(int number) |
int |
getNumber(Statement N) |
int |
getNumberOfNodes() |
Statement[] |
getParamCalleeStatements() |
int |
getPredNodeCount(Statement N)
Return the number of
immediate predecessor nodes of n |
IntSet |
getPredNodeNumbers(Statement node) |
Iterator<Statement> |
getPredNodes(Statement N)
Return an
Iterator over the immediate predecessor nodes of n
This method never returns null. |
Statement[] |
getReturnStatements() |
int |
getSuccNodeCount(Statement N)
Return the number of
immediate successor nodes of this Node in the Graph |
IntSet |
getSuccNodeNumbers(Statement node) |
Iterator<Statement> |
getSuccNodes(Statement N)
Return an Iterator over the immediate successor nodes of n
|
boolean |
hasEdge(Statement src,
Statement dst) |
int |
hashCode() |
boolean |
isControlDependend(Statement from,
Statement to)
BEGIN Custom change: control deps
|
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 graph
|
void |
removeNodeAndEdges(Statement N)
remove a node and all its incident edges
|
void |
removeOutgoingEdges(Statement node) |
static Statement |
ssaInstruction2Statement(CGNode node,
SSAInstruction s,
Map<SSAInstruction,Integer> instructionIndices,
IR ir) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic PDG(CGNode node, PointerAnalysis<T> pa, Map<CGNode,OrdinalSet<PointerKey>> mod, Map<CGNode,OrdinalSet<PointerKey>> ref, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions, HeapExclusions exclusions, CallGraph cg, ModRef modRef)
mod - the set of heap locations which may be written (transitively) by this node. These are logically return values in the
SDG.ref - the set of heap locations which may be read (transitively) by this node. These are logically parameters in the SDG.IllegalArgumentException - if node is nullpublic PDG(CGNode node, PointerAnalysis<T> pa, Map<CGNode,OrdinalSet<PointerKey>> mod, Map<CGNode,OrdinalSet<PointerKey>> ref, Slicer.DataDependenceOptions dOptions, Slicer.ControlDependenceOptions cOptions, HeapExclusions exclusions, CallGraph cg, ModRef modRef, boolean ignoreAllocHeapDefs)
mod - the set of heap locations which may be written (transitively) by this node. These are logically return values in the
SDG.ref - the set of heap locations which may be read (transitively) by this node. These are logically parameters in the SDG.IllegalArgumentException - if node is nullpublic Set<Statement> getCallerParamStatements(SSAAbstractInvokeInstruction call) throws IllegalArgumentException
IllegalArgumentExceptionpublic Set<Statement> getCallStatements(SSAAbstractInvokeInstruction call) throws IllegalArgumentException
IllegalArgumentExceptionpublic Set<Statement> getCallerReturnStatements(SSAAbstractInvokeInstruction call) throws IllegalArgumentException
IllegalArgumentExceptionpublic static Statement ssaInstruction2Statement(CGNode node, SSAInstruction s, Map<SSAInstruction,Integer> instructionIndices, IR ir)
public static Map<SSAInstruction,Integer> computeInstructionIndices(IR ir)
public Statement[] getParamCalleeStatements()
public Statement[] getReturnStatements()
public CGNode getCallGraphNode()
public int getPredNodeCount(Statement N) throws UnimplementedError
EdgeManagerimmediate predecessor nodes of ngetPredNodeCount in interface EdgeManager<Statement>UnimplementedErrorpublic Iterator<Statement> getPredNodes(Statement N)
EdgeManagerIterator over the immediate predecessor nodes of n
This method never returns null.getPredNodes in interface EdgeManager<Statement>Iterator over the immediate predecessor nodes of this Node.public int getSuccNodeCount(Statement N) throws UnimplementedError
EdgeManagerimmediate successor nodes of this Node in the GraphgetSuccNodeCount in interface EdgeManager<Statement>UnimplementedErrorpublic Iterator<Statement> getSuccNodes(Statement N)
EdgeManager
This method never returns null.
getSuccNodes in interface EdgeManager<Statement>public boolean hasEdge(Statement src, Statement dst) throws UnimplementedError
hasEdge in interface EdgeManager<Statement>UnimplementedErrorpublic void removeNodeAndEdges(Statement N) throws UnsupportedOperationException
GraphremoveNodeAndEdges in interface Graph<Statement>UnsupportedOperationException - if the graph implementation does not allow removalpublic void addNode(Statement n)
NodeManageraddNode in interface NodeManager<Statement>public boolean containsNode(Statement N)
containsNode in interface NodeManager<Statement>public int getNumberOfNodes()
getNumberOfNodes in interface NodeManager<Statement>public void removeNode(Statement n)
NodeManagerremoveNode in interface NodeManager<Statement>public void addEdge(Statement src, Statement dst)
addEdge in interface EdgeManager<Statement>public void removeAllIncidentEdges(Statement node) throws UnsupportedOperationException
removeAllIncidentEdges in interface EdgeManager<Statement>UnsupportedOperationExceptionpublic void removeEdge(Statement src, Statement dst) throws UnsupportedOperationException
removeEdge in interface EdgeManager<Statement>UnsupportedOperationExceptionpublic void removeIncomingEdges(Statement node) throws UnsupportedOperationException
removeIncomingEdges in interface EdgeManager<Statement>UnsupportedOperationExceptionpublic void removeOutgoingEdges(Statement node) throws UnsupportedOperationException
removeOutgoingEdges in interface EdgeManager<Statement>UnsupportedOperationExceptionpublic int getMaxNumber()
getMaxNumber in interface NumberedNodeManager<Statement>public Statement getNode(int number)
getNode in interface NumberedNodeManager<Statement>public int getNumber(Statement N)
getNumber in interface NumberedNodeManager<Statement>public Iterator<Statement> iterateNodes(IntSet s)
iterateNodes in interface NumberedNodeManager<Statement>public IntSet getPredNodeNumbers(Statement node)
getPredNodeNumbers in interface NumberedEdgeManager<Statement>public IntSet getSuccNodeNumbers(Statement node)
getSuccNodeNumbers in interface NumberedEdgeManager<Statement>