Class BlockNode


  • public class BlockNode
    extends CPGNode
    CPG node wrapping a basic block of SSA IR.
    • Constructor Detail

      • BlockNode

        public BlockNode​(long id,
                         IRBlock block)
        Creates a node for a basic block.
        Parameters:
        id - the unique node id
        block - the wrapped IR block
    • Method Detail

      • getBlock

        public IRBlock getBlock()
        Returns:
        the block
      • 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
      • isEntry

        public boolean isEntry()
        Returns:
        whether the block is the method entry block
      • isEntryBlock

        public boolean isEntryBlock()
        Returns:
        whether the block is the method entry block
      • isExitBlock

        public boolean isExitBlock()
        Returns:
        whether the block is an exit block
      • hasTerminator

        public boolean hasTerminator()
        Returns:
        whether the block ends in a terminator instruction
      • getInstructionCount

        public int getInstructionCount()
        Returns:
        the number of instructions in the block, phis included