Package com.tonic.analysis.pdg.node
Class PDGInstructionNode
- java.lang.Object
-
- com.tonic.analysis.pdg.node.PDGNode
-
- com.tonic.analysis.pdg.node.PDGInstructionNode
-
public class PDGInstructionNode extends PDGNode
A PDG node standing for a single IR instruction, typed PHI for phis and INSTRUCTION otherwise.
-
-
Constructor Summary
Constructors Constructor Description PDGInstructionNode(int id, IRInstruction instruction, IRBlock block, int instructionIndex)Creates a node for an instruction, deriving its node type from whether the instruction is a phi.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SSAValuegetDefinedValue()IRInstructiongetInstruction()intgetInstructionIndex()StringgetLabel()List<Value>getUsedValues()booleanhasResult()booleanisPhi()booleanisTerminator()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
-
PDGInstructionNode
public PDGInstructionNode(int id, IRInstruction instruction, IRBlock block, int instructionIndex)Creates a node for an instruction, deriving its node type from whether the instruction is a phi.- Parameters:
id- the graph-unique node idinstruction- the instruction representedblock- the block containing the instructioninstructionIndex- the position within the block, counting phis first
-
-
Method Detail
-
getInstruction
public IRInstruction getInstruction()
- Returns:
- the instruction
-
getInstructionIndex
public int getInstructionIndex()
- Returns:
- the instruction index
-
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
-
isPhi
public boolean isPhi()
- Returns:
- true if the instruction is a phi
-
isTerminator
public boolean isTerminator()
- Returns:
- true if the instruction ends its block
-
hasResult
public boolean hasResult()
- Returns:
- true if the instruction defines a value
-
-