Pseudocode: Replace UnsupportedElementInstruction with UNSUPPORTED_ELEMENT magic.

Generate UNSUPPORTED_ELEMENT for assignments with unresolved left-han side
This commit is contained in:
Alexey Sedunov
2014-07-21 13:45:12 +04:00
parent c32d112e67
commit e11ffb8542
20 changed files with 80 additions and 102 deletions
@@ -24,6 +24,8 @@ 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.InstructionVisitor;
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionWithNext;
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.eval.MagicInstruction;
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.eval.MagicKind;
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.jumps.*;
import org.jetbrains.jet.lang.cfg.pseudocode.instructions.special.*;
import org.jetbrains.jet.lang.psi.JetElement;
@@ -155,7 +157,7 @@ public class CFGraphToDotFilePrinter {
else if (node instanceof NondeterministicJumpInstruction) {
shape = "Mdiamond";
}
else if (node instanceof UnsupportedElementInstruction) {
else if (node instanceof MagicInstruction && ((MagicInstruction) node).getKind() == MagicKind.UNSUPPORTED_ELEMENT) {
shape = "box, fillcolor=red, style=filled";
}
else if (node instanceof LocalFunctionDeclarationInstruction) {
@@ -434,6 +434,11 @@ public class ControlFlowTestGenerated extends AbstractControlFlowTest {
doTest("compiler/testData/cfg/expressions/unresolvedProperty.kt");
}
@TestMetadata("unresolvedWriteLHS.kt")
public void testUnresolvedWriteLHS() throws Exception {
doTest("compiler/testData/cfg/expressions/unresolvedWriteLHS.kt");
}
@TestMetadata("unusedExpressionSimpleName.kt")
public void testUnusedExpressionSimpleName() throws Exception {
doTest("compiler/testData/cfg/expressions/unusedExpressionSimpleName.kt");
@@ -438,6 +438,11 @@ public class PseudoValueTestGenerated extends AbstractPseudoValueTest {
doTest("compiler/testData/cfg/expressions/unresolvedProperty.kt");
}
@TestMetadata("unresolvedWriteLHS.kt")
public void testUnresolvedWriteLHS() throws Exception {
doTest("compiler/testData/cfg/expressions/unresolvedWriteLHS.kt");
}
@TestMetadata("unusedExpressionSimpleName.kt")
public void testUnusedExpressionSimpleName() throws Exception {
doTest("compiler/testData/cfg/expressions/unusedExpressionSimpleName.kt");