Package com.tonic.analysis.pdg.sdg.node
Class SDGCallNode
- java.lang.Object
-
- com.tonic.analysis.pdg.node.PDGNode
-
- com.tonic.analysis.pdg.sdg.node.SDGCallNode
-
public class SDGCallNode extends PDGNode
System dependence graph node for a call site, holding the actual-in nodes for its arguments, an optional actual-out node, and a link to the callee entry once resolved.
-
-
Constructor Summary
Constructors Constructor Description SDGCallNode(int id, InvokeInstruction invokeInstruction, CallSite callSite, IRBlock block)Creates a call-site node with no actual-in, actual-out or callee link yet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActualIn(SDGActualInNode actualIn)Appends an argument node; no check is made for a duplicate parameter index.SDGActualInNodegetActualIn(int parameterIndex)Looks up an attached actual-in node by the parameter position it feeds.intgetActualInCount()List<SDGActualInNode>getActualIns()SDGActualOutNodegetActualOut()CallSitegetCallSite()SSAValuegetDefinedValue()InvokeInstructiongetInvokeInstruction()StringgetLabel()StringgetTargetDescriptor()SDGEntryNodegetTargetEntry()StringgetTargetName()StringgetTargetOwner()List<Value>getUsedValues()booleanhasActualOut()booleanhasTargetEntry()voidsetActualOut(SDGActualOutNode actualOut)Attaches the node standing for the value this call returns.voidsetTargetEntry(SDGEntryNode targetEntry)Links this call to the entry node of the resolved callee.StringtoString()-
Methods inherited from class com.tonic.analysis.pdg.node.PDGNode
addIncomingEdge, addOutgoingEdge, equals, getBlock, getControlDependenceEdges, getDataDependenceEdges, getId, getIncomingEdges, getInDegree, getOutDegree, getOutgoingEdges, getPredecessors, getSuccessors, getTaintLabel, getType, hashCode, hasIncomingEdges, hasOutgoingEdges, isTainted, removeIncomingEdge, removeOutgoingEdge, setBlock, setTainted, setTaintLabel
-
-
-
-
Constructor Detail
-
SDGCallNode
public SDGCallNode(int id, InvokeInstruction invokeInstruction, CallSite callSite, IRBlock block)Creates a call-site node with no actual-in, actual-out or callee link yet.- Parameters:
id- node idinvokeInstruction- the invoke this node stands forcallSite- call graph entry for the same invokeblock- block containing the invoke
-
-
Method Detail
-
getInvokeInstruction
public InvokeInstruction getInvokeInstruction()
- Returns:
- the invoke instruction
-
getCallSite
public CallSite getCallSite()
- Returns:
- the call site
-
getActualOut
public SDGActualOutNode getActualOut()
- Returns:
- the actual out
-
setActualOut
public void setActualOut(SDGActualOutNode actualOut)
Attaches the node standing for the value this call returns.- Parameters:
actualOut- actual-out node, or null for a void call
-
getTargetEntry
public SDGEntryNode getTargetEntry()
- Returns:
- the target entry
-
setTargetEntry
public void setTargetEntry(SDGEntryNode targetEntry)
Links this call to the entry node of the resolved callee.- Parameters:
targetEntry- callee entry node
-
addActualIn
public void addActualIn(SDGActualInNode actualIn)
Appends an argument node; no check is made for a duplicate parameter index.- Parameters:
actualIn- node for one argument of this call
-
getActualIn
public SDGActualInNode getActualIn(int parameterIndex)
Looks up an attached actual-in node by the parameter position it feeds.- Parameters:
parameterIndex- parameter position to find- Returns:
- the matching node, or null if none was added for that position
-
getActualInCount
public int getActualInCount()
- Returns:
- the number of actual-in nodes attached
-
getActualIns
public List<SDGActualInNode> getActualIns()
- Returns:
- an unmodifiable view of the actual-in nodes in the order they were added
-
hasActualOut
public boolean hasActualOut()
- Returns:
- true if the call has a node for its returned value
-
hasTargetEntry
public boolean hasTargetEntry()
- Returns:
- true once the call has been linked to a callee entry node
-
getTargetOwner
public String getTargetOwner()
- Returns:
- the owner of the invoked method
-
getTargetName
public String getTargetName()
- Returns:
- the name of the invoked method
-
getTargetDescriptor
public String getTargetDescriptor()
- Returns:
- the descriptor of the invoked method
-
getLabel
public String getLabel()
-
getUsedValues
public List<Value> getUsedValues()
- Specified by:
getUsedValuesin classPDGNode- Returns:
- the values this node reads
-
getDefinedValue
public SSAValue getDefinedValue()
- Specified by:
getDefinedValuein classPDGNode- Returns:
- the value this node defines, or null if it defines none
-
-