Search in sources :

Example 1 with DfaInstructionState

use of com.intellij.codeInspection.dataFlow.DfaInstructionState in project intellij-community by JetBrains.

the class SwapInstruction method accept.

@Override
public DfaInstructionState[] accept(DataFlowRunner runner, DfaMemoryState stateBefore, InstructionVisitor visitor) {
    final DfaValue a = stateBefore.pop();
    final DfaValue b = stateBefore.pop();
    stateBefore.push(a);
    stateBefore.push(b);
    Instruction nextInstruction = runner.getInstruction(getIndex() + 1);
    return new DfaInstructionState[] { new DfaInstructionState(nextInstruction, stateBefore) };
}
Also used : DfaInstructionState(com.intellij.codeInspection.dataFlow.DfaInstructionState) DfaValue(com.intellij.codeInspection.dataFlow.value.DfaValue)

Aggregations

DfaInstructionState (com.intellij.codeInspection.dataFlow.DfaInstructionState)1 DfaValue (com.intellij.codeInspection.dataFlow.value.DfaValue)1