Class UnaryOpInstruction


  • public class UnaryOpInstruction
    extends IRInstruction
    A unary operation such as negation or a primitive type conversion.
    • Constructor Detail

      • UnaryOpInstruction

        public UnaryOpInstruction​(SSAValue result,
                                  UnaryOp op,
                                  Value operand)
        Creates a unary operation and registers a use of an SSA operand.
        Parameters:
        result - the SSA value receiving the result
        op - the operation to perform
        operand - the operand
    • Method Detail

      • getOp

        public UnaryOp getOp()
        Returns:
        the op
      • getOperand

        public Value getOperand()
        Returns:
        the operand
      • 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