Package com.tonic.analysis.pdg.sdg.node
Class SDGEntryNode
- java.lang.Object
-
- com.tonic.analysis.pdg.node.PDGNode
-
- com.tonic.analysis.pdg.sdg.node.SDGEntryNode
-
public class SDGEntryNode extends PDGNode
The entry node of one procedure in a system dependence graph, owning that procedure's PDG plus its formal-in and formal-out parameter nodes.
-
-
Constructor Summary
Constructors Constructor Description SDGEntryNode(int id, MethodReference methodRef, IRBlock entryBlock)Creates an entry node for a procedure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFormalIn(SDGFormalInNode formalIn)Registers a parameter node on this entry.SSAValuegetDefinedValue()SDGFormalInNodegetFormalIn(int parameterIndex)Looks up the parameter node at a position.intgetFormalInCount()List<SDGFormalInNode>getFormalIns()SDGFormalOutNodegetFormalOut()StringgetFullSignature()StringgetLabel()StringgetMethodName()MethodReferencegetMethodRef()PDGgetProcedurePDG()List<Value>getUsedValues()booleanhasFormalOut()voidsetFormalOut(SDGFormalOutNode formalOut)Sets the node representing this procedure's return value.voidsetProcedurePDG(PDG procedurePDG)Attaches the dependence graph built for this procedure's body.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
-
SDGEntryNode
public SDGEntryNode(int id, MethodReference methodRef, IRBlock entryBlock)Creates an entry node for a procedure.- Parameters:
id- the graph-unique node idmethodRef- the procedure this node opensentryBlock- the procedure's entry block
-
-
Method Detail
-
getMethodRef
public MethodReference getMethodRef()
- Returns:
- the method ref
-
getProcedurePDG
public PDG getProcedurePDG()
- Returns:
- the dependence graph of the procedure body, or null if not yet attached
-
setProcedurePDG
public void setProcedurePDG(PDG procedurePDG)
Attaches the dependence graph built for this procedure's body.- Parameters:
procedurePDG- the procedure's PDG
-
getFormalOut
public SDGFormalOutNode getFormalOut()
- Returns:
- the formal out
-
setFormalOut
public void setFormalOut(SDGFormalOutNode formalOut)
Sets the node representing this procedure's return value.- Parameters:
formalOut- the formal-out node
-
addFormalIn
public void addFormalIn(SDGFormalInNode formalIn)
Registers a parameter node on this entry.- Parameters:
formalIn- the formal-in node to add
-
getFormalIn
public SDGFormalInNode getFormalIn(int parameterIndex)
Looks up the parameter node at a position.- Parameters:
parameterIndex- the parameter position to match- Returns:
- the matching formal-in node, or null if none is registered
-
getFormalInCount
public int getFormalInCount()
- Returns:
- the number of registered parameter nodes
-
getFormalIns
public List<SDGFormalInNode> getFormalIns()
- Returns:
- an unmodifiable view of the parameter nodes, in registration order
-
hasFormalOut
public boolean hasFormalOut()
- Returns:
- true if a return-value node has been set
-
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
-
getFullSignature
public String getFullSignature()
- Returns:
- owner, name and descriptor of the procedure joined into one string
-
getMethodName
public String getMethodName()
- Returns:
- owner and name of the procedure, without the descriptor
-
-