Class PDGRegionNode


  • public class PDGRegionNode
    extends PDGNode
    PDG node standing for a control region - entry, exit or a structured region - over a set of covered blocks, defining and using no values.
    • Constructor Detail

      • PDGRegionNode

        public PDGRegionNode​(int id,
                             PDGNodeType type,
                             String regionName,
                             IRBlock primaryBlock)
        Creates a region node, seeding the covered set with the primary block when one is given.
        Parameters:
        id - the node id
        type - the node type
        regionName - the region name used as the label
        primaryBlock - the block the region starts at, may be null
    • Method Detail

      • getRegionName

        public String getRegionName()
        Returns:
        the region name
      • getCoveredBlocks

        public Set<IRBlock> getCoveredBlocks()
        Returns:
        the covered blocks
      • createEntry

        public static PDGRegionNode createEntry​(int id,
                                                String methodName,
                                                IRBlock entryBlock)
        Creates the entry node for a method, named "ENTRY:" plus the method name.
        Parameters:
        id - the node id
        methodName - the method the node heads
        entryBlock - the entry block, may be null
        Returns:
        the new node
      • createExit

        public static PDGRegionNode createExit​(int id,
                                               String methodName,
                                               IRBlock exitBlock)
        Creates the exit node for a method, named "EXIT:" plus the method name.
        Parameters:
        id - the node id
        methodName - the method the node closes
        exitBlock - the exit block, may be null
        Returns:
        the new node
      • createRegion

        public static PDGRegionNode createRegion​(int id,
                                                 String name,
                                                 IRBlock block)
        Creates a plain region node.
        Parameters:
        id - the node id
        name - the region name
        block - the block the region starts at
        Returns:
        the new node
      • addCoveredBlock

        public void addCoveredBlock​(IRBlock block)
        Adds a block to the set this region covers.
        Parameters:
        block - the block to cover
      • coversBlock

        public boolean coversBlock​(IRBlock block)
        Tests whether a block is part of this region.
        Parameters:
        block - the block to test
        Returns:
        true if the block is covered
      • 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
      • isEntry

        public boolean isEntry()
        Returns:
        true if this is the entry node
      • isExit

        public boolean isExit()
        Returns:
        true if this is the exit node