Class InstructionNode


  • public class InstructionNode
    extends CPGNode
    CPG node wrapping a single IR instruction, positioned by block id and index.
    • Constructor Detail

      • InstructionNode

        public InstructionNode​(long id,
                               IRInstruction instruction,
                               int blockId,
                               int instructionIndex)
        Creates a node for an IR instruction.
        Parameters:
        id - the unique node id
        instruction - the wrapped instruction
        blockId - the id of the containing block
        instructionIndex - the instruction's position within the block
    • Method Detail

      • getInstruction

        public IRInstruction getInstruction()
        Returns:
        the instruction
      • getInstructionIndex

        public int getInstructionIndex()
        Returns:
        the instruction index
      • getBlockId

        public int getBlockId()
        Returns:
        the block id
      • getLabel

        public String getLabel()
        Specified by:
        getLabel in class CPGNode
        Returns:
        a short human-readable display label
      • getUnderlying

        public <T> T getUnderlying()
        Specified by:
        getUnderlying in class CPGNode
        Type Parameters:
        T - the expected underlying type
        Returns:
        the wrapped IR or analysis object
      • isInvoke

        public boolean isInvoke()
        Returns:
        whether the instruction is a method invocation
      • isFieldAccess

        public boolean isFieldAccess()
        Returns:
        whether the instruction reads or writes a field
      • isAllocation

        public boolean isAllocation()
        Returns:
        whether the instruction allocates an object or array
      • isReturn

        public boolean isReturn()
        Returns:
        whether the instruction is a return
      • isBranch

        public boolean isBranch()
        Returns:
        whether the instruction is a conditional branch
      • isPhi

        public boolean isPhi()
        Returns:
        whether the instruction is a phi
      • hasResult

        public boolean hasResult()
        Returns:
        whether the instruction produces a result value
      • isTerminator

        public boolean isTerminator()
        Returns:
        whether the instruction ends its block