Class CopyInstruction


  • public class CopyInstruction
    extends IRInstruction
    A value copy, inserted mainly during phi elimination.
    • Constructor Detail

      • CopyInstruction

        public CopyInstruction​(SSAValue result,
                               Value source)
        Creates a copy and registers a use of an SSA source.
        Parameters:
        result - the SSA value receiving the copy
        source - the value being copied
    • Method Detail

      • getSource

        public Value getSource()
        Returns:
        the source
      • replaceOperand

        public void replaceOperand​(Value oldValue,
                                   Value newValue)
        Description copied from class: IRInstruction
        Replaces an operand value with a new value.
        Specified by:
        replaceOperand in class IRInstruction
        Parameters:
        oldValue - the value to replace
        newValue - the replacement value
      • accept

        public <T> T accept​(IRVisitor<T> visitor)
        Description copied from class: IRInstruction
        Accepts a visitor for this instruction.
        Specified by:
        accept in class IRInstruction
        Type Parameters:
        T - the return type
        Parameters:
        visitor - the visitor to accept
        Returns:
        the visitor result