Class PDGInstructionNode


  • public class PDGInstructionNode
    extends PDGNode
    A PDG node standing for a single IR instruction, typed PHI for phis and INSTRUCTION otherwise.
    • 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 id
        instruction - the instruction represented
        block - the block containing the instruction
        instructionIndex - 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()
        Specified by:
        getLabel in class PDGNode
        Returns:
        a short human-readable description of what this node represents
      • getDefinedValue

        public SSAValue getDefinedValue()
        Specified by:
        getDefinedValue in class PDGNode
        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