All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opalj.br.instructions.IFXNullInstruction.scala Maven / Gradle / Ivy

The newest version!
/* BSD 2-Clause License - see OPAL/LICENSE for details. */
package org.opalj
package br
package instructions

/**
 * Common superclass of all instructions that perform a conditional jump based on
 * an explicit comparison with `null`.
 *
 * @author Michael Eichberg
 */
trait IFXNullInstructionLike extends SimpleConditionalBranchInstructionLike {

    final def operandCount = 1

    def condition: RelationalOperator

    final def stackSlotsChange: Int = -1

}

trait IFXNullInstruction[T <: IFXNullInstruction[T]]
    extends SimpleConditionalBranchInstruction[T]
    with IFXNullInstructionLike {

    final override def asIFXNullInstruction: this.type = this

}

object IFXNullInstruction {

    def unapply(i: IFXNullInstruction[_]): Some[(RelationalOperator, Int)] = {
        Some((i.condition, i.branchoffset))
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy