Package com.tonic.analysis.ssa.util
Class IRMethodCloner
- java.lang.Object
-
- com.tonic.analysis.ssa.util.IRMethodCloner
-
public class IRMethodCloner extends Object
Utility class for deep-cloning IR methods.
-
-
Constructor Summary
Constructors Constructor Description IRMethodCloner()Creates a new cloner with default prefix.IRMethodCloner(String prefix)Creates a new cloner with a prefix for renamed blocks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IRMethodclone(IRMethod source)Clones an IRMethod, creating fresh copies of all blocks, instructions, and values.Map<IRBlock,IRBlock>getBlockMapping()Gets the block mapping from original to cloned blocks.Map<SSAValue,SSAValue>getValueMapping()Gets the value mapping from original to cloned values.
-
-
-
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
-
-