Added 'markedAsDead' flag to InstructionImpl

to be used in tests
This commit is contained in:
Svetlana Isakova
2014-06-23 10:00:20 +04:00
parent 8680ff4e88
commit e4a0651224
6 changed files with 7 additions and 17 deletions
@@ -21,6 +21,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.cfg.pseudocode.PseudocodeImpl;
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.Instruction;
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionImpl;
import org.jetbrains.jet.lang.resolve.BindingContext;
import java.util.*;
@@ -108,7 +109,7 @@ public abstract class AbstractControlFlowTest extends AbstractPseudocodeTest {
//check edges directions
Collection<Instruction> instructions = pseudocode.getInstructionsIncludingDeadCode();
for (Instruction instruction : instructions) {
if (!instruction.getDead()) {
if (!((InstructionImpl)instruction).getMarkedAsDead()) {
for (Instruction nextInstruction : instruction.getNextInstructions()) {
assertTrue("instruction '" + instruction + "' has '" + nextInstruction + "' among next instructions list, but not vice versa",
nextInstruction.getPreviousInstructions().contains(instruction));
@@ -140,7 +140,7 @@ public abstract class AbstractPseudocodeTest extends KotlinTestWithEnvironment {
@NotNull Set<Instruction> remainedAfterPostProcessInstructions
) {
boolean isRemovedThroughPostProcess = !remainedAfterPostProcessInstructions.contains(instruction);
assert isRemovedThroughPostProcess == ((InstructionImpl)instruction).getDead();
assert isRemovedThroughPostProcess == ((InstructionImpl)instruction).getMarkedAsDead();
return isRemovedThroughPostProcess ? "-" : " ";
}