Class IRMethodCloner


  • public class IRMethodCloner
    extends Object
    Utility class for deep-cloning IR methods.
    • Constructor Detail

      • IRMethodCloner

        public IRMethodCloner​(String prefix)
        Creates a new cloner with a prefix for renamed blocks.
        Parameters:
        prefix - prefix for cloned block names (e.g., "inline_")
      • IRMethodCloner

        public IRMethodCloner()
        Creates a new cloner with default prefix.
    • Method Detail

      • clone

        public IRMethod clone​(IRMethod source)
        Clones an IRMethod, creating fresh copies of all blocks, instructions, and values.
        Parameters:
        source - the method to clone
        Returns:
        a new IRMethod with cloned contents
      • getValueMapping

        public Map<SSAValue,​SSAValue> getValueMapping()
        Gets the value mapping from original to cloned values.
        Returns:
        unmodifiable view of the value mapping
      • getBlockMapping

        public Map<IRBlock,​IRBlock> getBlockMapping()
        Gets the block mapping from original to cloned blocks.
        Returns:
        unmodifiable view of the block mapping