From 6a4043c9a03bbc2a9a80820ff74e6aa8e7190e20 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 4 Dec 2013 14:04:52 +0400 Subject: [PATCH] Do not display trivial sets of next/previous instructions in test data For better readability of test failures --- .../cfg/AnonymousInitializers.instructions | 50 +- .../testData/cfg/ArrayAccess.instructions | 52 +- .../testData/cfg/Assignments.instructions | 84 +-- compiler/testData/cfg/Basic.instructions | 132 ++-- .../cfg/DelegatedProperty.instructions | 34 +- .../testData/cfg/EmptyFunction.instructions | 10 +- .../testData/cfg/FailFunction.instructions | 10 +- compiler/testData/cfg/Finally.instructions | 674 +++++++++--------- .../testData/cfg/FinallyTestCopy.instructions | 220 +++--- compiler/testData/cfg/For.instructions | 42 +- compiler/testData/cfg/If.instructions | 100 +-- .../testData/cfg/LazyBooleans.instructions | 80 +-- .../cfg/LocalDeclarations.instructions | 260 +++---- compiler/testData/cfg/MultiDecl.instructions | 40 +- .../cfg/ObjectExpression.instructions | 44 +- .../cfg/OnlyWhileInFunctionBody.instructions | 38 +- .../cfg/ReturnFromExpression.instructions | 16 +- .../testData/cfg/ShortFunction.instructions | 10 +- .../cfg/arrayAccessExpression.instructions | 28 +- compiler/testData/cfg/arraySet.instructions | 20 +- .../cfg/arraySetPlusAssign.instructions | 30 +- .../cfg/assignmentToThis.instructions | 16 +- .../cfg/backingFieldAccess.instructions | 36 +- .../cfg/deadCode/DeadCode.instructions | 12 +- .../cfg/deadCode/returnInElvis.instructions | 10 +- compiler/testData/cfg/equals.instructions | 28 +- .../cfg/expressionAsFunction.instructions | 16 +- .../cfg/incrementAtTheEnd.instructions | 20 +- compiler/testData/cfg/invoke.instructions | 16 +- .../multiDeclarationWithError.instructions | 24 +- compiler/testData/cfg/notEqual.instructions | 28 +- .../cfg/propertySafeCall.instructions | 16 +- .../testData/cfg/returnsInWhen.instructions | 24 +- .../testData/cfg/thisExpression.instructions | 12 +- .../testData/cfg/typeParameter.instructions | 10 +- compiler/testData/cfg/unresolved.instructions | 18 +- .../cfg/unusedFunctionLiteral.instructions | 34 +- .../jet/cfg/AbstractControlFlowTest.java | 33 +- 38 files changed, 1171 insertions(+), 1156 deletions(-) diff --git a/compiler/testData/cfg/AnonymousInitializers.instructions b/compiler/testData/cfg/AnonymousInitializers.instructions index 7c4f80d9bd4..d9105099c83 100644 --- a/compiler/testData/cfg/AnonymousInitializers.instructions +++ b/compiler/testData/cfg/AnonymousInitializers.instructions @@ -16,45 +16,45 @@ class AnonymousInitializers() { } --------------------- L0: - NEXT:[v(val k = 34)] PREV:[] - v(val k = 34) NEXT:[r(34)] PREV:[] - r(34) NEXT:[w(k)] PREV:[v(val k = 34)] - w(k) NEXT:[v(val i: Int)] PREV:[r(34)] - v(val i: Int) NEXT:[r(12)] PREV:[w(k)] - r(12) NEXT:[w($i)] PREV:[v(val i: Int)] - w($i) NEXT:[v(val j: Int get() = 20)] PREV:[r(12)] - v(val j: Int get() = 20) NEXT:[jmp?(L2)] PREV:[w($i)] - jmp?(L2) NEXT:[r(13), d(get() = 20)] PREV:[v(val j: Int get() = 20)] - d(get() = 20) NEXT:[] PREV:[jmp?(L2)] + + v(val k = 34) + r(34) + w(k) + v(val i: Int) + r(12) + w($i) + v(val j: Int get() = 20) + jmp?(L2) NEXT:[r(13), d(get() = 20)] + d(get() = 20) NEXT:[] L2: - r(13) NEXT:[w($i)] PREV:[jmp?(L2)] - w($i) NEXT:[] PREV:[r(13)] + r(13) PREV:[jmp?(L2)] + w($i) L1: - NEXT:[] PREV:[w($i)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d(get() = 20)] + PREV:[, , d(get() = 20)] L3: - NEXT:[r(20)] PREV:[] - r(20) NEXT:[] PREV:[] + + r(20) L4: - NEXT:[] PREV:[r(20)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == get_j == get() = 20 --------------------- L3: - NEXT:[r(20)] PREV:[] - r(20) NEXT:[] PREV:[] + + r(20) L4: - NEXT:[] PREV:[r(20)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/ArrayAccess.instructions b/compiler/testData/cfg/ArrayAccess.instructions index 74b22740849..c7559866203 100644 --- a/compiler/testData/cfg/ArrayAccess.instructions +++ b/compiler/testData/cfg/ArrayAccess.instructions @@ -10,33 +10,33 @@ fun foo() { } --------------------- L0: - NEXT:[v(val a = Array)] PREV:[] - v(val a = Array) NEXT:[call(Array, )] PREV:[] - call(Array, ) NEXT:[w(a)] PREV:[v(val a = Array)] - w(a) NEXT:[r(3)] PREV:[call(Array, )] - r(3) NEXT:[r(a)] PREV:[w(a)] - r(a) NEXT:[r(10)] PREV:[r(3)] - r(10) NEXT:[r(4)] PREV:[r(a)] - r(4) NEXT:[call(a[10], set)] PREV:[r(10)] - call(a[10], set) NEXT:[r(2)] PREV:[r(4)] - r(2) NEXT:[r(a)] PREV:[call(a[10], set)] - r(a) NEXT:[r(10)] PREV:[r(2)] - r(10) NEXT:[call(a[10], get)] PREV:[r(a)] - call(a[10], get) NEXT:[r(100)] PREV:[r(10)] - r(100) NEXT:[r(a)] PREV:[call(a[10], get)] - r(a) NEXT:[r(10)] PREV:[r(100)] - r(10) NEXT:[call(a[10], get)] PREV:[r(a)] - call(a[10], get) NEXT:[r(1)] PREV:[r(10)] - r(1) NEXT:[call(+=, plus)] PREV:[call(a[10], get)] - call(+=, plus) NEXT:[r(a)] PREV:[r(1)] - r(a) NEXT:[r(10)] PREV:[call(+=, plus)] - r(10) NEXT:[r(1)] PREV:[r(a)] - r(1) NEXT:[call(a[10], set)] PREV:[r(10)] - call(a[10], set) NEXT:[] PREV:[r(1)] + + v(val a = Array) + call(Array, ) + w(a) + r(3) + r(a) + r(10) + r(4) + call(a[10], set) + r(2) + r(a) + r(10) + call(a[10], get) + r(100) + r(a) + r(10) + call(a[10], get) + r(1) + call(+=, plus) + r(a) + r(10) + r(1) + call(a[10], set) L1: - NEXT:[] PREV:[call(a[10], set)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/Assignments.instructions b/compiler/testData/cfg/Assignments.instructions index d378755e555..8399c43d317 100644 --- a/compiler/testData/cfg/Assignments.instructions +++ b/compiler/testData/cfg/Assignments.instructions @@ -4,14 +4,14 @@ class Test { } --------------------- L0: - NEXT:[v(var x : Int;)] PREV:[] - v(var x : Int;) NEXT:[] PREV:[] + + v(var x : Int;) L1: - NEXT:[] PREV:[v(var x : Int;)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == assignments == fun assignments() : Unit { @@ -29,48 +29,48 @@ fun assignments() : Unit { } --------------------- L0: - NEXT:[v(var x = 1)] PREV:[] - v(var x = 1) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w(x)] PREV:[v(var x = 1)] - w(x) NEXT:[r(2)] PREV:[r(1)] - r(2) NEXT:[w(x)] PREV:[w(x)] - w(x) NEXT:[r(x)] PREV:[r(2)] - r(x) NEXT:[r(2)] PREV:[w(x)] - r(2) NEXT:[call(+=, plus)] PREV:[r(x)] - call(+=, plus) NEXT:[w(x)] PREV:[r(2)] - w(x) NEXT:[r(true)] PREV:[call(+=, plus)] - r(true) NEXT:[jf(L2)] PREV:[w(x)] - jf(L2) NEXT:[r(2), r(1)] PREV:[r(true)] - r(1) NEXT:[jmp(L3)] PREV:[jf(L2)] - jmp(L3) NEXT:[w(x)] PREV:[r(1)] + + v(var x = 1) + r(1) + w(x) + r(2) + w(x) + r(x) + r(2) + call(+=, plus) + w(x) + r(true) + jf(L2) NEXT:[r(2), r(1)] + r(1) + jmp(L3) NEXT:[w(x)] L2: - r(2) NEXT:[w(x)] PREV:[jf(L2)] + r(2) PREV:[jf(L2)] L3: - w(x) NEXT:[v(val y = true && false)] PREV:[jmp(L3), r(2)] - v(val y = true && false) NEXT:[r(true)] PREV:[w(x)] - r(true) NEXT:[jf(L4)] PREV:[v(val y = true && false)] - jf(L4) NEXT:[r(true && false), r(false)] PREV:[r(true)] - r(false) NEXT:[r(true && false)] PREV:[jf(L4)] + w(x) PREV:[jmp(L3), r(2)] + v(val y = true && false) + r(true) + jf(L4) NEXT:[r(true && false), r(false)] + r(false) L4: - r(true && false) NEXT:[w(y)] PREV:[jf(L4), r(false)] - w(y) NEXT:[v(val z = false && true)] PREV:[r(true && false)] - v(val z = false && true) NEXT:[r(false)] PREV:[w(y)] - r(false) NEXT:[jf(L5)] PREV:[v(val z = false && true)] - jf(L5) NEXT:[r(false && true), r(true)] PREV:[r(false)] - r(true) NEXT:[r(false && true)] PREV:[jf(L5)] + r(true && false) PREV:[jf(L4), r(false)] + w(y) + v(val z = false && true) + r(false) + jf(L5) NEXT:[r(false && true), r(true)] + r(true) L5: - r(false && true) NEXT:[w(z)] PREV:[jf(L5), r(true)] - w(z) NEXT:[v(val t = Test())] PREV:[r(false && true)] - v(val t = Test()) NEXT:[call(Test, )] PREV:[w(z)] - call(Test, ) NEXT:[w(t)] PREV:[v(val t = Test())] - w(t) NEXT:[r(1)] PREV:[call(Test, )] - r(1) NEXT:[r(t)] PREV:[w(t)] - r(t) NEXT:[w(t.x)] PREV:[r(1)] - w(t.x) NEXT:[] PREV:[r(t)] + r(false && true) PREV:[jf(L5), r(true)] + w(z) + v(val t = Test()) + call(Test, ) + w(t) + r(1) + r(t) + w(t.x) L1: - NEXT:[] PREV:[w(t.x)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/Basic.instructions b/compiler/testData/cfg/Basic.instructions index b85b75bbe58..1633f282884 100644 --- a/compiler/testData/cfg/Basic.instructions +++ b/compiler/testData/cfg/Basic.instructions @@ -18,112 +18,112 @@ fun f(a : Boolean) : Unit { } --------------------- L0: - NEXT:[v(a : Boolean)] PREV:[] - v(a : Boolean) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(1)] PREV:[v(a : Boolean)] - r(1) NEXT:[r(a)] PREV:[w(a)] - r(a) NEXT:[r(2)] PREV:[r(1)] - r(2) NEXT:[call(toLong, toLong)] PREV:[r(a)] - call(toLong, toLong) NEXT:[r(a)] PREV:[r(2)] - r(a) NEXT:[r(3)] PREV:[call(toLong, toLong)] - r(3) NEXT:[call(foo, foo)] PREV:[r(a)] - call(foo, foo) NEXT:[call(genfun, genfun)] PREV:[r(3)] - call(genfun, genfun) NEXT:[jmp?(L2)] PREV:[call(foo, foo)] - jmp?(L2) NEXT:[r({1}), d({1})] PREV:[call(genfun, genfun)] - d({1}) NEXT:[] PREV:[jmp?(L2)] + + v(a : Boolean) + w(a) + r(1) + r(a) + r(2) + call(toLong, toLong) + r(a) + r(3) + call(foo, foo) + call(genfun, genfun) + jmp?(L2) NEXT:[r({1}), d({1})] + d({1}) NEXT:[] L2: - r({1}) NEXT:[call(flfun, flfun)] PREV:[jmp?(L2)] - call(flfun, flfun) NEXT:[r(3)] PREV:[r({1})] - r(3) NEXT:[r(4)] PREV:[call(flfun, flfun)] - r(4) NEXT:[call(equals, equals)] PREV:[r(3)] - call(equals, equals) NEXT:[r(3)] PREV:[r(4)] - r(3) NEXT:[r(4)] PREV:[call(equals, equals)] - r(4) NEXT:[call(equals, equals)] PREV:[r(3)] - call(equals, equals) NEXT:[r(1)] PREV:[r(4)] - r(1) NEXT:[r(2)] PREV:[call(equals, equals)] - r(2) NEXT:[call(+, plus)] PREV:[r(1)] - call(+, plus) NEXT:[r(a)] PREV:[r(2)] - r(a) NEXT:[jf(L5)] PREV:[call(+, plus)] - jf(L5) NEXT:[r(a && true), r(true)] PREV:[r(a)] - r(true) NEXT:[r(a && true)] PREV:[jf(L5)] + r({1}) PREV:[jmp?(L2)] + call(flfun, flfun) + r(3) + r(4) + call(equals, equals) + r(3) + r(4) + call(equals, equals) + r(1) + r(2) + call(+, plus) + r(a) + jf(L5) NEXT:[r(a && true), r(true)] + r(true) L5: - r(a && true) NEXT:[r(a)] PREV:[jf(L5), r(true)] - r(a) NEXT:[jt(L6)] PREV:[r(a && true)] - jt(L6) NEXT:[r(false), r(a || false)] PREV:[r(a)] - r(false) NEXT:[r(a || false)] PREV:[jt(L6)] + r(a && true) PREV:[jf(L5), r(true)] + r(a) + jt(L6) NEXT:[r(false), r(a || false)] + r(false) L6: - r(a || false) NEXT:[] PREV:[jt(L6), r(false)] + r(a || false) PREV:[jt(L6), r(false)] L1: - NEXT:[] PREV:[r(a || false)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d({1})] + PREV:[, , d({1})] L3: - NEXT:[r(1)] PREV:[] - r(1) NEXT:[] PREV:[] + + r(1) L4: - NEXT:[] PREV:[r(1)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == anonymous_0 == {1} --------------------- L3: - NEXT:[r(1)] PREV:[] - r(1) NEXT:[] PREV:[] + + r(1) L4: - NEXT:[] PREV:[r(1)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == foo == fun foo(a : Boolean, b : Int) : Unit {} --------------------- L0: - NEXT:[v(a : Boolean)] PREV:[] - v(a : Boolean) NEXT:[w(a)] PREV:[] - w(a) NEXT:[v(b : Int)] PREV:[v(a : Boolean)] - v(b : Int) NEXT:[w(b)] PREV:[w(a)] - w(b) NEXT:[read (Unit)] PREV:[v(b : Int)] - read (Unit) NEXT:[] PREV:[w(b)] + + v(a : Boolean) + w(a) + v(b : Int) + w(b) + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == genfun == fun genfun() : Unit {} --------------------- L0: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == flfun == fun flfun(f : () -> Any) : Unit {} --------------------- L0: - NEXT:[v(f : () -> Any)] PREV:[] - v(f : () -> Any) NEXT:[w(f)] PREV:[] - w(f) NEXT:[read (Unit)] PREV:[v(f : () -> Any)] - read (Unit) NEXT:[] PREV:[w(f)] + + v(f : () -> Any) + w(f) + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/DelegatedProperty.instructions b/compiler/testData/cfg/DelegatedProperty.instructions index 2a84ad6b7e9..06936f44b5d 100644 --- a/compiler/testData/cfg/DelegatedProperty.instructions +++ b/compiler/testData/cfg/DelegatedProperty.instructions @@ -4,40 +4,40 @@ class Delegate { } --------------------- L0: - NEXT:[] PREV:[] + L1: - NEXT:[] PREV:[] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == a == val a = Delegate() --------------------- L0: - NEXT:[v(val a = Delegate())] PREV:[] - v(val a = Delegate()) NEXT:[call(Delegate, )] PREV:[] - call(Delegate, ) NEXT:[w(a)] PREV:[v(val a = Delegate())] - w(a) NEXT:[] PREV:[call(Delegate, )] + + v(val a = Delegate()) + call(Delegate, ) + w(a) L1: - NEXT:[] PREV:[w(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == b == val b by a --------------------- L0: - NEXT:[v(val b by a)] PREV:[] - v(val b by a) NEXT:[r(a)] PREV:[] - r(a) NEXT:[] PREV:[v(val b by a)] + + v(val b by a) + r(a) L1: - NEXT:[] PREV:[r(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/EmptyFunction.instructions b/compiler/testData/cfg/EmptyFunction.instructions index 06faa1a0195..bd55d8f0e74 100644 --- a/compiler/testData/cfg/EmptyFunction.instructions +++ b/compiler/testData/cfg/EmptyFunction.instructions @@ -2,12 +2,12 @@ fun empty() {} --------------------- L0: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/FailFunction.instructions b/compiler/testData/cfg/FailFunction.instructions index 6833bcd0f15..f324c48951e 100644 --- a/compiler/testData/cfg/FailFunction.instructions +++ b/compiler/testData/cfg/FailFunction.instructions @@ -4,13 +4,13 @@ fun fail() : Nothing { } --------------------- L0: - NEXT:[call(RuntimeException, )] PREV:[] - call(RuntimeException, ) NEXT:[throw (throw java.lang.RuntimeException())] PREV:[] - throw (throw java.lang.RuntimeException()) NEXT:[] PREV:[call(RuntimeException, )] + + call(RuntimeException, ) + throw (throw java.lang.RuntimeException()) NEXT:[] L1: NEXT:[] PREV:[] error: - NEXT:[] PREV:[throw (throw java.lang.RuntimeException())] + PREV:[throw (throw java.lang.RuntimeException())] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/Finally.instructions b/compiler/testData/cfg/Finally.instructions index 692426a56f6..8c03ba3d30a 100644 --- a/compiler/testData/cfg/Finally.instructions +++ b/compiler/testData/cfg/Finally.instructions @@ -8,23 +8,23 @@ fun t1() { } --------------------- L0: - NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] - r(1) NEXT:[jmp(L3 [skipFinallyToErrorBlock])] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[r(1)] + + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(2)] L2 [onExceptionToFinallyBlock]: L4 [start finally]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L5 [finish finally]: - jmp(error) NEXT:[] PREV:[r(2)] + jmp(error) NEXT:[] L3 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L3 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L3 [skipFinallyToErrorBlock])] L1: - NEXT:[] PREV:[r(2)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t2 == fun t2() { @@ -39,33 +39,33 @@ fun t2() { } --------------------- L0: - NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] - r(1) NEXT:[r(2)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L3)] PREV:[r(3)] - jf(L3) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] + + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + r(2) + r(3) + call(>, compareTo) + jf(L3) NEXT:[read (Unit), r(2)] L4 [start finally]: - r(2) NEXT:[ret L1] PREV:[jf(L3)] + r(2) L5 [finish finally]: - ret L1 NEXT:[] PREV:[r(2)] + ret L1 NEXT:[] - jmp(L6) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L3: - read (Unit) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[jf(L3)] + read (Unit) PREV:[jf(L3)] L6: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(2)] L2 [onExceptionToFinallyBlock]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - jmp(error) NEXT:[] PREV:[r(2)] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L7 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L7 [skipFinallyToErrorBlock])] L1: NEXT:[] PREV:[ret L1, r(2)] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t3 == fun t3() { @@ -82,44 +82,44 @@ fun t3() { } --------------------- L0: - NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] - r(1) NEXT:[jmp?(L3)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - jmp?(L3) NEXT:[r({ () => if (2 > 3) { return@ } }), d({ () => if (2 > 3) { return@ } })] PREV:[r(1)] - d({ () => if (2 > 3) { return@ } }) NEXT:[] PREV:[jmp?(L3)] + + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + jmp?(L3) NEXT:[r({ () => if (2 > 3) { return@ } }), d({ () => if (2 > 3) { return@ } })] + d({ () => if (2 > 3) { return@ } }) NEXT:[] L3: - r({ () => if (2 > 3) { return@ } }) NEXT:[jmp(L8 [skipFinallyToErrorBlock])] PREV:[jmp?(L3)] - jmp(L8 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[r({ () => if (2 > 3) { return@ } })] + r({ () => if (2 > 3) { return@ } }) PREV:[jmp?(L3)] + jmp(L8 [skipFinallyToErrorBlock]) NEXT:[r(2)] L2 [onExceptionToFinallyBlock]: L9 [start finally]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L10 [finish finally]: - jmp(error) NEXT:[] PREV:[r(2)] + jmp(error) NEXT:[] L8 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L8 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L8 [skipFinallyToErrorBlock])] L1: - NEXT:[] PREV:[r(2)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, , d({ () => if (2 > 3) { return@ } })] + PREV:[, , d({ () => if (2 > 3) { return@ } })] L4: - NEXT:[r(2)] PREV:[] - r(2) NEXT:[r(3)] PREV:[] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] - jf(L6) NEXT:[read (Unit), ret L5] PREV:[call(>, compareTo)] - ret L5 NEXT:[] PREV:[jf(L6)] + + r(2) + r(3) + call(>, compareTo) + jf(L6) NEXT:[read (Unit), ret L5] + ret L5 NEXT:[] - jmp(L7) NEXT:[] PREV:[] L6: - read (Unit) NEXT:[] PREV:[jf(L6)] + read (Unit) PREV:[jf(L6)] L5: L7: NEXT:[] PREV:[ret L5, read (Unit)] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == anonymous_0 == { () => @@ -129,22 +129,22 @@ sink: } --------------------- L4: - NEXT:[r(2)] PREV:[] - r(2) NEXT:[r(3)] PREV:[] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] - jf(L6) NEXT:[read (Unit), ret L5] PREV:[call(>, compareTo)] - ret L5 NEXT:[] PREV:[jf(L6)] + + r(2) + r(3) + call(>, compareTo) + jf(L6) NEXT:[read (Unit), ret L5] + ret L5 NEXT:[] - jmp(L7) NEXT:[] PREV:[] L6: - read (Unit) NEXT:[] PREV:[jf(L6)] + read (Unit) PREV:[jf(L6)] L5: L7: NEXT:[] PREV:[ret L5, read (Unit)] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t4 == fun t4() { @@ -161,45 +161,45 @@ fun t4() { } --------------------- L0: - NEXT:[jmp?(L2)] PREV:[] - jmp?(L2) NEXT:[r({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } }), d({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } })] PREV:[] - d({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } }) NEXT:[] PREV:[jmp?(L2)] + + jmp?(L2) NEXT:[r({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } }), d({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } })] + d({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } }) NEXT:[] L2: - r({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } }) NEXT:[] PREV:[jmp?(L2)] + r({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } }) PREV:[jmp?(L2)] L1: - NEXT:[] PREV:[r({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } })] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } })] + PREV:[, , d({ () => try { 1 if (2 > 3) { return@ } } finally { 2 } })] L3: - NEXT:[jmp?(L5 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] - r(1) NEXT:[r(2)] PREV:[jmp?(L5 [onExceptionToFinallyBlock])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] - jf(L6) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] + + jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + r(2) + r(3) + call(>, compareTo) + jf(L6) NEXT:[read (Unit), r(2)] L7 [start finally]: - r(2) NEXT:[ret L4] PREV:[jf(L6)] + r(2) L8 [finish finally]: - ret L4 NEXT:[] PREV:[r(2)] + ret L4 NEXT:[] - jmp(L9) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[] L6: - read (Unit) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[jf(L6)] + read (Unit) PREV:[jf(L6)] L9: - jmp(L10 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + jmp(L10 [skipFinallyToErrorBlock]) NEXT:[r(2)] L5 [onExceptionToFinallyBlock]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L5 [onExceptionToFinallyBlock])] - jmp(error) NEXT:[] PREV:[r(2)] + r(2) PREV:[jmp?(L5 [onExceptionToFinallyBlock])] + jmp(error) NEXT:[] L10 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L10 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L10 [skipFinallyToErrorBlock])] L4: NEXT:[] PREV:[ret L4, r(2)] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == anonymous_1 == { () => @@ -214,33 +214,33 @@ sink: } --------------------- L3: - NEXT:[jmp?(L5 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] - r(1) NEXT:[r(2)] PREV:[jmp?(L5 [onExceptionToFinallyBlock])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] - jf(L6) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] + + jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + r(2) + r(3) + call(>, compareTo) + jf(L6) NEXT:[read (Unit), r(2)] L7 [start finally]: - r(2) NEXT:[ret L4] PREV:[jf(L6)] + r(2) L8 [finish finally]: - ret L4 NEXT:[] PREV:[r(2)] + ret L4 NEXT:[] - jmp(L9) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[] L6: - read (Unit) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[jf(L6)] + read (Unit) PREV:[jf(L6)] L9: - jmp(L10 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + jmp(L10 [skipFinallyToErrorBlock]) NEXT:[r(2)] L5 [onExceptionToFinallyBlock]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L5 [onExceptionToFinallyBlock])] - jmp(error) NEXT:[] PREV:[r(2)] + r(2) PREV:[jmp?(L5 [onExceptionToFinallyBlock])] + jmp(error) NEXT:[] L10 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L10 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L10 [skipFinallyToErrorBlock])] L4: NEXT:[] PREV:[ret L4, r(2)] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t5 == fun t5() { @@ -257,40 +257,40 @@ fun t5() { } --------------------- L0: - NEXT:[r(true)] PREV:[] + L2 [loop entry point]: L5 [condition entry point]: - r(true) NEXT:[jmp?(L6 [onExceptionToFinallyBlock])] PREV:[, jmp(L2 [loop entry point])] + r(true) PREV:[, jmp(L2 [loop entry point])] L4 [body entry point]: - jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(true)] - r(1) NEXT:[r(2)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] - jf(L7) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] + jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), r(2)] L8 [start finally]: - r(2) NEXT:[jmp(L3 [loop exit point])] PREV:[jf(L7)] + r(2) L9 [finish finally]: - jmp(L3 [loop exit point]) NEXT:[read (Unit)] PREV:[r(2)] + jmp(L3 [loop exit point]) NEXT:[read (Unit)] - jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[] L7: - read (Unit) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[jf(L7)] + read (Unit) PREV:[jf(L7)] L10: - jmp(L11 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + jmp(L11 [skipFinallyToErrorBlock]) NEXT:[r(2)] L6 [onExceptionToFinallyBlock]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - jmp(error) NEXT:[] PREV:[r(2)] + r(2) PREV:[jmp?(L6 [onExceptionToFinallyBlock])] + jmp(error) NEXT:[] L11 [skipFinallyToErrorBlock]: - r(2) NEXT:[jmp(L2 [loop entry point])] PREV:[jmp(L11 [skipFinallyToErrorBlock])] - jmp(L2 [loop entry point]) NEXT:[r(true)] PREV:[r(2)] + r(2) PREV:[jmp(L11 [skipFinallyToErrorBlock])] + jmp(L2 [loop entry point]) NEXT:[r(true)] L3 [loop exit point]: - read (Unit) NEXT:[] PREV:[jmp(L3 [loop exit point])] + read (Unit) PREV:[jmp(L3 [loop exit point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t6 == fun t6() { @@ -308,40 +308,40 @@ fun t6() { } --------------------- L0: - NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(true)] PREV:[] + + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(true)] L3 [loop entry point]: L6 [condition entry point]: - r(true) NEXT:[r(1)] PREV:[jmp?(L2 [onExceptionToFinallyBlock]), jmp(L3 [loop entry point])] + r(true) PREV:[jmp?(L2 [onExceptionToFinallyBlock]), jmp(L3 [loop entry point])] L5 [body entry point]: - r(1) NEXT:[r(2)] PREV:[r(true)] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] - jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] PREV:[call(>, compareTo)] - jmp(L4 [loop exit point]) NEXT:[read (Unit)] PREV:[jf(L7)] + r(1) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] + jmp(L4 [loop exit point]) NEXT:[read (Unit)] - jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[] L7: - read (Unit) NEXT:[jmp(L3 [loop entry point])] PREV:[jf(L7)] + read (Unit) PREV:[jf(L7)] L8: - jmp(L3 [loop entry point]) NEXT:[r(true)] PREV:[read (Unit)] + jmp(L3 [loop entry point]) NEXT:[r(true)] L4 [loop exit point]: - read (Unit) NEXT:[r(5)] PREV:[jmp(L4 [loop exit point])] - r(5) NEXT:[jmp(L9 [skipFinallyToErrorBlock])] PREV:[read (Unit)] - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[r(5)] + read (Unit) PREV:[jmp(L4 [loop exit point])] + r(5) + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] L2 [onExceptionToFinallyBlock]: L10 [start finally]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L11 [finish finally]: - jmp(error) NEXT:[] PREV:[r(2)] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L9 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L9 [skipFinallyToErrorBlock])] L1: - NEXT:[] PREV:[r(2)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t7 == fun t7() { @@ -358,39 +358,39 @@ fun t7() { } --------------------- L0: - NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(true)] PREV:[] + + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(true)] L3 [loop entry point]: L6 [condition entry point]: - r(true) NEXT:[r(1)] PREV:[jmp?(L2 [onExceptionToFinallyBlock]), jmp(L3 [loop entry point])] + r(true) PREV:[jmp?(L2 [onExceptionToFinallyBlock]), jmp(L3 [loop entry point])] L5 [body entry point]: - r(1) NEXT:[r(2)] PREV:[r(true)] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] - jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] PREV:[call(>, compareTo)] - jmp(L4 [loop exit point]) NEXT:[read (Unit)] PREV:[jf(L7)] + r(1) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] + jmp(L4 [loop exit point]) NEXT:[read (Unit)] - jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[] L7: - read (Unit) NEXT:[jmp(L3 [loop entry point])] PREV:[jf(L7)] + read (Unit) PREV:[jf(L7)] L8: - jmp(L3 [loop entry point]) NEXT:[r(true)] PREV:[read (Unit)] + jmp(L3 [loop entry point]) NEXT:[r(true)] L4 [loop exit point]: - read (Unit) NEXT:[jmp(L9 [skipFinallyToErrorBlock])] PREV:[jmp(L4 [loop exit point])] - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + read (Unit) PREV:[jmp(L4 [loop exit point])] + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] L2 [onExceptionToFinallyBlock]: L10 [start finally]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L11 [finish finally]: - jmp(error) NEXT:[] PREV:[r(2)] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L9 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L9 [skipFinallyToErrorBlock])] L1: - NEXT:[] PREV:[r(2)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t8 == fun t8(a : Int) { @@ -407,47 +407,47 @@ fun t8(a : Int) { } --------------------- L0: - NEXT:[v(a : Int)] PREV:[] - v(a : Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(1)] PREV:[v(a : Int)] - r(1) NEXT:[r(a)] PREV:[w(a)] - r(a) NEXT:[call(.., rangeTo)] PREV:[r(1)] - call(.., rangeTo) NEXT:[v(i)] PREV:[r(a)] - v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] - w(i) NEXT:[jmp?(L2)] PREV:[v(i)] + + v(a : Int) + w(a) + r(1) + r(a) + call(.., rangeTo) + v(i) + w(i) L3: - jmp?(L2) NEXT:[read (Unit), jmp?(L6 [onExceptionToFinallyBlock])] PREV:[w(i)] + jmp?(L2) NEXT:[read (Unit), jmp?(L6 [onExceptionToFinallyBlock])] L4 [loop entry point]: L5 [body entry point]: jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[jmp?(L2), jmp(L4 [loop entry point]), jmp?(L4 [loop entry point])] - r(1) NEXT:[r(2)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] - jf(L7) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] + r(1) + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), r(2)] L8 [start finally]: - r(2) NEXT:[jmp(L4 [loop entry point])] PREV:[jf(L7)] + r(2) L9 [finish finally]: - jmp(L4 [loop entry point]) NEXT:[jmp?(L6 [onExceptionToFinallyBlock])] PREV:[r(2)] + jmp(L4 [loop entry point]) NEXT:[jmp?(L6 [onExceptionToFinallyBlock])] - jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[] L7: - read (Unit) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[jf(L7)] + read (Unit) PREV:[jf(L7)] L10: - jmp(L11 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + jmp(L11 [skipFinallyToErrorBlock]) NEXT:[r(2)] L6 [onExceptionToFinallyBlock]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - jmp(error) NEXT:[] PREV:[r(2)] + r(2) PREV:[jmp?(L6 [onExceptionToFinallyBlock])] + jmp(error) NEXT:[] L11 [skipFinallyToErrorBlock]: - r(2) NEXT:[jmp?(L4 [loop entry point])] PREV:[jmp(L11 [skipFinallyToErrorBlock])] - jmp?(L4 [loop entry point]) NEXT:[jmp?(L6 [onExceptionToFinallyBlock]), read (Unit)] PREV:[r(2)] + r(2) PREV:[jmp(L11 [skipFinallyToErrorBlock])] + jmp?(L4 [loop entry point]) NEXT:[jmp?(L6 [onExceptionToFinallyBlock]), read (Unit)] L2: - read (Unit) NEXT:[] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] + read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t9 == fun t9(a : Int) { @@ -465,47 +465,47 @@ fun t9(a : Int) { } --------------------- L0: - NEXT:[v(a : Int)] PREV:[] - v(a : Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[v(a : Int)] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[w(a)] - r(1) NEXT:[r(a)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(a) NEXT:[call(.., rangeTo)] PREV:[r(1)] - call(.., rangeTo) NEXT:[v(i)] PREV:[r(a)] - v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] - w(i) NEXT:[jmp?(L3)] PREV:[v(i)] + + v(a : Int) + w(a) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + r(a) + call(.., rangeTo) + v(i) + w(i) L4: - jmp?(L3) NEXT:[read (Unit), r(1)] PREV:[w(i)] + jmp?(L3) NEXT:[read (Unit), r(1)] L5 [loop entry point]: L6 [body entry point]: - r(1) NEXT:[r(2)] PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] - jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] PREV:[call(>, compareTo)] - jmp(L5 [loop entry point]) NEXT:[r(1)] PREV:[jf(L7)] + r(1) PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] + jmp(L5 [loop entry point]) NEXT:[r(1)] - jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[] L7: - read (Unit) NEXT:[jmp?(L5 [loop entry point])] PREV:[jf(L7)] + read (Unit) PREV:[jf(L7)] L8: - jmp?(L5 [loop entry point]) NEXT:[r(1), read (Unit)] PREV:[read (Unit)] + jmp?(L5 [loop entry point]) NEXT:[r(1), read (Unit)] L3: - read (Unit) NEXT:[r(5)] PREV:[jmp?(L3), jmp?(L5 [loop entry point])] - r(5) NEXT:[jmp(L9 [skipFinallyToErrorBlock])] PREV:[read (Unit)] - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[r(5)] + read (Unit) PREV:[jmp?(L3), jmp?(L5 [loop entry point])] + r(5) + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] L2 [onExceptionToFinallyBlock]: L10 [start finally]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L11 [finish finally]: - jmp(error) NEXT:[] PREV:[r(2)] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L9 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L9 [skipFinallyToErrorBlock])] L1: - NEXT:[] PREV:[r(2)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t10 == fun t10(a : Int) { @@ -522,46 +522,46 @@ fun t10(a : Int) { } --------------------- L0: - NEXT:[v(a : Int)] PREV:[] - v(a : Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[v(a : Int)] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[w(a)] - r(1) NEXT:[r(a)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(a) NEXT:[call(.., rangeTo)] PREV:[r(1)] - call(.., rangeTo) NEXT:[v(i)] PREV:[r(a)] - v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] - w(i) NEXT:[jmp?(L3)] PREV:[v(i)] + + v(a : Int) + w(a) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) + r(a) + call(.., rangeTo) + v(i) + w(i) L4: - jmp?(L3) NEXT:[read (Unit), r(1)] PREV:[w(i)] + jmp?(L3) NEXT:[read (Unit), r(1)] L5 [loop entry point]: L6 [body entry point]: - r(1) NEXT:[r(2)] PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] - call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] - jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] PREV:[call(>, compareTo)] - jmp(L5 [loop entry point]) NEXT:[r(1)] PREV:[jf(L7)] + r(1) PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] + r(2) + r(3) + call(>, compareTo) + jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] + jmp(L5 [loop entry point]) NEXT:[r(1)] - jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[] L7: - read (Unit) NEXT:[jmp?(L5 [loop entry point])] PREV:[jf(L7)] + read (Unit) PREV:[jf(L7)] L8: - jmp?(L5 [loop entry point]) NEXT:[r(1), read (Unit)] PREV:[read (Unit)] + jmp?(L5 [loop entry point]) NEXT:[r(1), read (Unit)] L3: - read (Unit) NEXT:[jmp(L9 [skipFinallyToErrorBlock])] PREV:[jmp?(L3), jmp?(L5 [loop entry point])] - jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + read (Unit) PREV:[jmp?(L3), jmp?(L5 [loop entry point])] + jmp(L9 [skipFinallyToErrorBlock]) NEXT:[r(2)] L2 [onExceptionToFinallyBlock]: L10 [start finally]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L11 [finish finally]: - jmp(error) NEXT:[] PREV:[r(2)] + jmp(error) NEXT:[] L9 [skipFinallyToErrorBlock]: - r(2) NEXT:[] PREV:[jmp(L9 [skipFinallyToErrorBlock])] + r(2) PREV:[jmp(L9 [skipFinallyToErrorBlock])] L1: - NEXT:[] PREV:[r(2)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t11 == fun t11() { @@ -574,28 +574,28 @@ fun t11() { } --------------------- L0: - NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] - r(1) NEXT:[r(2)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] + r(1) L3 [start finally]: - r(2) NEXT:[ret(*) L1] PREV:[r(1)] - ret(*) L1 NEXT:[] PREV:[r(2)] + r(2) + ret(*) L1 NEXT:[] L4 [finish finally]: - ret(*) L1 NEXT:[] PREV:[] - jmp(L5 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[] L2 [onExceptionToFinallyBlock]: - r(2) NEXT:[ret(*) L1] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - ret(*) L1 NEXT:[] PREV:[r(2)] + r(2) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + ret(*) L1 NEXT:[] - jmp(error) NEXT:[] PREV:[] L5 [skipFinallyToErrorBlock]: -- r(2) NEXT:[ret(*) L1] PREV:[] -- ret(*) L1 NEXT:[] PREV:[] +- r(2) PREV:[] +- ret(*) L1 PREV:[] L1: NEXT:[] PREV:[ret(*) L1, ret(*) L1] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t12 == fun t12() : Int { @@ -608,28 +608,28 @@ fun t12() : Int { } --------------------- L0: - NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[] - r(1) NEXT:[r(3)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] + r(1) L3 [start finally]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(1)] - call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] + r(3) + call(doSmth, doSmth) L4 [finish finally]: - ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] + ret(*) L1 NEXT:[] - jmp(L5 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[] L2 [onExceptionToFinallyBlock]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] - jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] + r(3) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) + jmp(error) NEXT:[] L5 [skipFinallyToErrorBlock]: -- r(3) NEXT:[call(doSmth, doSmth)] PREV:[] -- call(doSmth, doSmth) NEXT:[] PREV:[] +- r(3) PREV:[] +- call(doSmth, doSmth) PREV:[] L1: NEXT:[] PREV:[ret(*) L1] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t13 == fun t13() : Int { @@ -645,37 +645,37 @@ fun t13() : Int { } --------------------- L0: - NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] - r(1) NEXT:[r(3)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] + r(1) L4 [start finally]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(1)] - call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] + r(3) + call(doSmth, doSmth) L5 [finish finally]: - ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] + ret(*) L1 NEXT:[] - jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[call(doSmth, doSmth)] PREV:[w(e)] - call(doSmth, doSmth) NEXT:[jmp(L6 [afterCatches])] PREV:[r(2)] - jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] + v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] + w(e) + r(2) + call(doSmth, doSmth) + jmp(L6 [afterCatches]) L6 [afterCatches]: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[jmp(L6 [afterCatches])] + jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] L3 [onExceptionToFinallyBlock]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] - jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] + r(3) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L7 [skipFinallyToErrorBlock])] - call(doSmth, doSmth) NEXT:[] PREV:[r(3)] + r(3) PREV:[jmp(L7 [skipFinallyToErrorBlock])] + call(doSmth, doSmth) L1: NEXT:[] PREV:[ret(*) L1, call(doSmth, doSmth)] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t14 == fun t14() : Int { @@ -688,24 +688,24 @@ fun t14() : Int { } --------------------- L0: - NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), r(1)] PREV:[] - r(1) NEXT:[ret(*) L1] PREV:[jmp?(L2 [onException])] - ret(*) L1 NEXT:[] PREV:[r(1)] + + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), r(1)] + r(1) + ret(*) L1 NEXT:[] - jmp(L3 [afterCatches]) NEXT:[] PREV:[] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[call(doSmth, doSmth)] PREV:[w(e)] - call(doSmth, doSmth) NEXT:[jmp(L3 [afterCatches])] PREV:[r(2)] - jmp(L3 [afterCatches]) NEXT:[] PREV:[call(doSmth, doSmth)] + v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] + w(e) + r(2) + call(doSmth, doSmth) + jmp(L3 [afterCatches]) L1: L3 [afterCatches]: NEXT:[] PREV:[ret(*) L1, jmp(L3 [afterCatches])] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t15 == fun t15() : Int { @@ -721,39 +721,39 @@ fun t15() : Int { } --------------------- L0: - NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] - r(1) NEXT:[r(3)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] + r(1) L4 [start finally]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(1)] - call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] + r(3) + call(doSmth, doSmth) L5 [finish finally]: - ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] + ret(*) L1 NEXT:[] - jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[r(3)] PREV:[w(e)] - r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(2)] - call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] - ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] -- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] + v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] + w(e) + r(2) + r(3) + call(doSmth, doSmth) + ret(*) L1 NEXT:[] +- jmp(L6 [afterCatches]) PREV:[] L6 [afterCatches]: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[] L3 [onExceptionToFinallyBlock]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] - jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] + r(3) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: -- r(3) NEXT:[call(doSmth, doSmth)] PREV:[] -- call(doSmth, doSmth) NEXT:[] PREV:[] +- r(3) PREV:[] +- call(doSmth, doSmth) PREV:[] L1: NEXT:[] PREV:[ret(*) L1, ret(*) L1] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t16 == fun t16() : Int { @@ -769,51 +769,51 @@ fun t16() : Int { } --------------------- L0: - NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] - r(1) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - call(doSmth, doSmth) NEXT:[jmp(L4 [afterCatches])] PREV:[r(1)] - jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] + + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] + r(1) + call(doSmth, doSmth) + jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[r(3)] PREV:[w(e)] + v(e: UnsupportedOperationException) PREV:[jmp?(L2 [onException])] + w(e) + r(2) L5 [start finally]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(2)] - call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] + r(3) + call(doSmth, doSmth) L6 [finish finally]: - ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] -- jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] + ret(*) L1 NEXT:[] +- jmp(L4 [afterCatches]) PREV:[] L4 [afterCatches]: jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] - jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] + r(3) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) + jmp(error) NEXT:[] L7 [skipFinallyToErrorBlock]: - r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L7 [skipFinallyToErrorBlock])] - call(doSmth, doSmth) NEXT:[] PREV:[r(3)] + r(3) PREV:[jmp(L7 [skipFinallyToErrorBlock])] + call(doSmth, doSmth) L1: NEXT:[] PREV:[ret(*) L1, call(doSmth, doSmth)] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == doSmth == fun doSmth(i: Int) { } --------------------- L0: - NEXT:[v(i: Int)] PREV:[] - v(i: Int) NEXT:[w(i)] PREV:[] - w(i) NEXT:[read (Unit)] PREV:[v(i: Int)] - read (Unit) NEXT:[] PREV:[w(i)] + + v(i: Int) + w(i) + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/FinallyTestCopy.instructions b/compiler/testData/cfg/FinallyTestCopy.instructions index d399696cce8..115beb7d4f7 100644 --- a/compiler/testData/cfg/FinallyTestCopy.instructions +++ b/compiler/testData/cfg/FinallyTestCopy.instructions @@ -2,53 +2,53 @@ fun doSmth() {} --------------------- L0: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == doSmth1 == fun doSmth1() {} --------------------- L0: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == doSmth2 == fun doSmth2() {} --------------------- L0: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == cond == fun cond() {} --------------------- L0: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == testCopy1 == fun testCopy1() : Int { @@ -67,39 +67,39 @@ fun testCopy1() : Int { } --------------------- L0: - NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(1), call(doSmth, doSmth)] PREV:[jmp?(L2 [onException])] - call(doSmth, doSmth) NEXT:[jmp(L4 [afterCatches])] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] + + jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(1), call(doSmth, doSmth)] + call(doSmth, doSmth) + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] L2 [onException]: jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] - v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[call(doSmth1, doSmth1)] PREV:[v(e: NullPointerException)] - call(doSmth1, doSmth1) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth1, doSmth1)] + v(e: NullPointerException) + w(e) + call(doSmth1, doSmth1) + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] L5 [catch 0]: - v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[call(doSmth2, doSmth2)] PREV:[v(e: Exception)] - call(doSmth2, doSmth2) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth2, doSmth2)] + v(e: Exception) PREV:[jmp?(L5 [catch 0])] + w(e) + call(doSmth2, doSmth2) + jmp(L4 [afterCatches]) L4 [afterCatches]: jmp(L6 [skipFinallyToErrorBlock]) NEXT:[r(1)] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: L7 [start finally]: - r(1) NEXT:[ret(*) L1] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - ret(*) L1 NEXT:[] PREV:[r(1)] + r(1) PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + ret(*) L1 NEXT:[] L8 [finish finally]: - jmp(error) NEXT:[] PREV:[] L6 [skipFinallyToErrorBlock]: - r(1) NEXT:[ret(*) L1] PREV:[jmp(L6 [skipFinallyToErrorBlock])] - ret(*) L1 NEXT:[] PREV:[r(1)] + r(1) PREV:[jmp(L6 [skipFinallyToErrorBlock])] + ret(*) L1 L1: NEXT:[] PREV:[ret(*) L1, ret(*) L1] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == testCopy2 == fun testCopy2() { @@ -121,34 +121,34 @@ fun testCopy2() { } --------------------- L0: - NEXT:[call(cond, cond)] PREV:[] + L2 [loop entry point]: L5 [condition entry point]: - call(cond, cond) NEXT:[jf(L3 [loop exit point])] PREV:[, jmp(L2 [loop entry point]), jmp(L2 [loop entry point])] - jf(L3 [loop exit point]) NEXT:[read (Unit), jmp?(L6 [onException])] PREV:[call(cond, cond)] + call(cond, cond) PREV:[, jmp(L2 [loop entry point]), jmp(L2 [loop entry point])] + jf(L3 [loop exit point]) NEXT:[read (Unit), jmp?(L6 [onException])] L4 [body entry point]: - jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])] PREV:[jf(L3 [loop exit point])] - jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] PREV:[jmp?(L6 [onException])] - call(doSmth, doSmth) NEXT:[jmp(L8 [afterCatches])] PREV:[jmp?(L7 [onExceptionToFinallyBlock])] - jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] + jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])] + jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] + call(doSmth, doSmth) + jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] L6 [onException]: jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])] - v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L9 [catch 0])] - w(e) NEXT:[call(doSmth1, doSmth1)] PREV:[v(e: NullPointerException)] - call(doSmth1, doSmth1) NEXT:[jmp(L8 [afterCatches])] PREV:[w(e)] - jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[call(doSmth1, doSmth1)] + v(e: NullPointerException) + w(e) + call(doSmth1, doSmth1) + jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] L9 [catch 0]: - v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L9 [catch 0])] - w(e) NEXT:[call(doSmth2, doSmth2)] PREV:[v(e: Exception)] - call(doSmth2, doSmth2) NEXT:[jmp(L8 [afterCatches])] PREV:[w(e)] - jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[call(doSmth2, doSmth2)] + v(e: Exception) PREV:[jmp?(L9 [catch 0])] + w(e) + call(doSmth2, doSmth2) + jmp(L8 [afterCatches]) L8 [afterCatches]: jmp(L10 [skipFinallyToErrorBlock]) NEXT:[call(cond, cond)] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])] L7 [onExceptionToFinallyBlock]: L11 [start finally]: - call(cond, cond) NEXT:[jf(L12)] PREV:[jmp?(L7 [onExceptionToFinallyBlock])] - jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1] PREV:[call(cond, cond)] - ret L1 NEXT:[] PREV:[jf(L12)] + call(cond, cond) PREV:[jmp?(L7 [onExceptionToFinallyBlock])] + jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1] + ret L1 NEXT:[] - jmp(L13) NEXT:[jmp(error)] PREV:[] L12: jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(L12)] @@ -156,20 +156,20 @@ L13: L14 [finish finally]: - jmp(error) NEXT:[] PREV:[] L10 [skipFinallyToErrorBlock]: - call(cond, cond) NEXT:[jf(copy L12)] PREV:[jmp(L10 [skipFinallyToErrorBlock])] - jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1] PREV:[call(cond, cond)] - ret L1 NEXT:[] PREV:[jf(copy L12)] + call(cond, cond) PREV:[jmp(L10 [skipFinallyToErrorBlock])] + jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1] + ret L1 NEXT:[] - jmp(copy L13) NEXT:[jmp(L2 [loop entry point])] PREV:[] jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(copy L12)] - jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[] L3 [loop exit point]: - read (Unit) NEXT:[] PREV:[jf(L3 [loop exit point])] + read (Unit) PREV:[jf(L3 [loop exit point])] L1: NEXT:[] PREV:[ret L1, ret L1, read (Unit)] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == testCopy3 == fun testCopy3() { @@ -188,47 +188,47 @@ fun testCopy3() { } --------------------- L0: - NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] PREV:[jmp?(L2 [onException])] - call(doSmth, doSmth) NEXT:[jmp(L4 [afterCatches])] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] + + jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] + call(doSmth, doSmth) + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] L2 [onException]: jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] - v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[call(doSmth1, doSmth1)] PREV:[v(e: NullPointerException)] - call(doSmth1, doSmth1) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth1, doSmth1)] + v(e: NullPointerException) + w(e) + call(doSmth1, doSmth1) + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] L5 [catch 0]: - v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[call(doSmth2, doSmth2)] PREV:[v(e: Exception)] - call(doSmth2, doSmth2) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth2, doSmth2)] + v(e: Exception) PREV:[jmp?(L5 [catch 0])] + w(e) + call(doSmth2, doSmth2) + jmp(L4 [afterCatches]) L4 [afterCatches]: jmp(L6 [skipFinallyToErrorBlock]) NEXT:[call(cond, cond)] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: L7 [start finally]: L8 [loop entry point]: L11 [condition entry point]: - call(cond, cond) NEXT:[jf(L9 [loop exit point])] PREV:[jmp?(L3 [onExceptionToFinallyBlock]), jmp(L8 [loop entry point])] - jf(L9 [loop exit point]) NEXT:[read (Unit), jmp(L8 [loop entry point])] PREV:[call(cond, cond)] + call(cond, cond) PREV:[jmp?(L3 [onExceptionToFinallyBlock]), jmp(L8 [loop entry point])] + jf(L9 [loop exit point]) NEXT:[read (Unit), jmp(L8 [loop entry point])] L10 [body entry point]: - jmp(L8 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(L9 [loop exit point])] + jmp(L8 [loop entry point]) NEXT:[call(cond, cond)] L9 [loop exit point]: - read (Unit) NEXT:[jmp(error)] PREV:[jf(L9 [loop exit point])] + read (Unit) PREV:[jf(L9 [loop exit point])] L12 [finish finally]: - jmp(error) NEXT:[] PREV:[read (Unit)] + jmp(error) NEXT:[] L6 [skipFinallyToErrorBlock]: - call(cond, cond) NEXT:[jf(copy L9 [loop exit point])] PREV:[jmp(L6 [skipFinallyToErrorBlock]), jmp(copy L8 [loop entry point])] - jf(copy L9 [loop exit point]) NEXT:[read (Unit), jmp(copy L8 [loop entry point])] PREV:[call(cond, cond)] - jmp(copy L8 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(copy L9 [loop exit point])] - read (Unit) NEXT:[] PREV:[jf(copy L9 [loop exit point])] + call(cond, cond) PREV:[jmp(L6 [skipFinallyToErrorBlock]), jmp(copy L8 [loop entry point])] + jf(copy L9 [loop exit point]) NEXT:[read (Unit), jmp(copy L8 [loop entry point])] + jmp(copy L8 [loop entry point]) NEXT:[call(cond, cond)] + read (Unit) PREV:[jf(copy L9 [loop exit point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == doTestCopy4 == fun doTestCopy4(list: List?) : Int { @@ -242,37 +242,37 @@ fun doTestCopy4(list: List?) : Int { } --------------------- L0: - NEXT:[v(list: List?)] PREV:[] - v(list: List?) NEXT:[w(list)] PREV:[] - w(list) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[v(list: List?)] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(list), call(doSmth, doSmth)] PREV:[w(list)] - call(doSmth, doSmth) NEXT:[jmp(L3 [skipFinallyToErrorBlock])] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(list)] PREV:[call(doSmth, doSmth)] + + v(list: List?) + w(list) + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(list), call(doSmth, doSmth)] + call(doSmth, doSmth) + jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(list)] L2 [onExceptionToFinallyBlock]: L4 [start finally]: - r(list) NEXT:[r(null)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(null) NEXT:[call(list != null, equals)] PREV:[r(list)] - call(list != null, equals) NEXT:[jf(L5)] PREV:[r(null)] - jf(L5) NEXT:[read (Unit), read (Unit)] PREV:[call(list != null, equals)] - read (Unit) NEXT:[jmp(L6)] PREV:[jf(L5)] - jmp(L6) NEXT:[jmp(error)] PREV:[read (Unit)] + r(list) PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(null) + call(list != null, equals) + jf(L5) NEXT:[read (Unit), read (Unit)] + read (Unit) + jmp(L6) NEXT:[jmp(error)] L5: - read (Unit) NEXT:[jmp(error)] PREV:[jf(L5)] + read (Unit) PREV:[jf(L5)] L6: L7 [finish finally]: jmp(error) NEXT:[] PREV:[jmp(L6), read (Unit)] L3 [skipFinallyToErrorBlock]: - r(list) NEXT:[r(null)] PREV:[jmp(L3 [skipFinallyToErrorBlock])] - r(null) NEXT:[call(list != null, equals)] PREV:[r(list)] - call(list != null, equals) NEXT:[jf(copy L5)] PREV:[r(null)] - jf(copy L5) NEXT:[read (Unit), read (Unit)] PREV:[call(list != null, equals)] - read (Unit) NEXT:[jmp(copy L6)] PREV:[jf(copy L5)] - jmp(copy L6) NEXT:[] PREV:[read (Unit)] - read (Unit) NEXT:[] PREV:[jf(copy L5)] + r(list) PREV:[jmp(L3 [skipFinallyToErrorBlock])] + r(null) + call(list != null, equals) + jf(copy L5) NEXT:[read (Unit), read (Unit)] + read (Unit) + jmp(copy L6) NEXT:[] + read (Unit) PREV:[jf(copy L5)] L1: NEXT:[] PREV:[jmp(copy L6), read (Unit)] error: - NEXT:[] PREV:[jmp(error)] + PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/For.instructions b/compiler/testData/cfg/For.instructions index b2eaabf7f4b..b170c1550de 100644 --- a/compiler/testData/cfg/For.instructions +++ b/compiler/testData/cfg/For.instructions @@ -6,40 +6,40 @@ fun t1() { } --------------------- L0: - NEXT:[r(1)] PREV:[] - r(1) NEXT:[r(2)] PREV:[] - r(2) NEXT:[call(.., rangeTo)] PREV:[r(1)] - call(.., rangeTo) NEXT:[v(i)] PREV:[r(2)] - v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] - w(i) NEXT:[jmp?(L2)] PREV:[v(i)] + + r(1) + r(2) + call(.., rangeTo) + v(i) + w(i) L3: - jmp?(L2) NEXT:[read (Unit), r(i)] PREV:[w(i)] + jmp?(L2) NEXT:[read (Unit), r(i)] L4 [loop entry point]: L5 [body entry point]: - r(i) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] - call(doSmth, doSmth) NEXT:[jmp?(L4 [loop entry point])] PREV:[r(i)] - jmp?(L4 [loop entry point]) NEXT:[r(i), read (Unit)] PREV:[call(doSmth, doSmth)] + r(i) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] + call(doSmth, doSmth) + jmp?(L4 [loop entry point]) NEXT:[r(i), read (Unit)] L2: - read (Unit) NEXT:[] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] + read (Unit) PREV:[jmp?(L2), jmp?(L4 [loop entry point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == doSmth == fun doSmth(i: Int) {} --------------------- L0: - NEXT:[v(i: Int)] PREV:[] - v(i: Int) NEXT:[w(i)] PREV:[] - w(i) NEXT:[read (Unit)] PREV:[v(i: Int)] - read (Unit) NEXT:[] PREV:[w(i)] + + v(i: Int) + w(i) + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/If.instructions b/compiler/testData/cfg/If.instructions index cfe905639bc..4648f638190 100644 --- a/compiler/testData/cfg/If.instructions +++ b/compiler/testData/cfg/If.instructions @@ -17,38 +17,38 @@ fun t1(b: Boolean) { } --------------------- L0: - NEXT:[v(b: Boolean)] PREV:[] - v(b: Boolean) NEXT:[w(b)] PREV:[] - w(b) NEXT:[v(var u: String)] PREV:[v(b: Boolean)] - v(var u: String) NEXT:[r(b)] PREV:[w(b)] - r(b) NEXT:[jf(L2)] PREV:[v(var u: String)] - jf(L2) NEXT:[read (Unit), r("s")] PREV:[r(b)] - r("s") NEXT:[w(u)] PREV:[jf(L2)] - w(u) NEXT:[jmp(L3)] PREV:[r("s")] - jmp(L3) NEXT:[r(u)] PREV:[w(u)] + + v(b: Boolean) + w(b) + v(var u: String) + r(b) + jf(L2) NEXT:[read (Unit), r("s")] + r("s") + w(u) + jmp(L3) NEXT:[r(u)] L2: - read (Unit) NEXT:[r(u)] PREV:[jf(L2)] + read (Unit) PREV:[jf(L2)] L3: - r(u) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L3), read (Unit)] - call(doSmth, doSmth) NEXT:[v(var r: String)] PREV:[r(u)] - v(var r: String) NEXT:[r(b)] PREV:[call(doSmth, doSmth)] - r(b) NEXT:[jf(L4)] PREV:[v(var r: String)] - jf(L4) NEXT:[r("t"), r("s")] PREV:[r(b)] - r("s") NEXT:[w(r)] PREV:[jf(L4)] - w(r) NEXT:[jmp(L5)] PREV:[r("s")] - jmp(L5) NEXT:[r(r)] PREV:[w(r)] + r(u) PREV:[jmp(L3), read (Unit)] + call(doSmth, doSmth) + v(var r: String) + r(b) + jf(L4) NEXT:[r("t"), r("s")] + r("s") + w(r) + jmp(L5) NEXT:[r(r)] L4: - r("t") NEXT:[w(r)] PREV:[jf(L4)] - w(r) NEXT:[r(r)] PREV:[r("t")] + r("t") PREV:[jf(L4)] + w(r) L5: - r(r) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L5), w(r)] - call(doSmth, doSmth) NEXT:[] PREV:[r(r)] + r(r) PREV:[jmp(L5), w(r)] + call(doSmth, doSmth) L1: - NEXT:[] PREV:[call(doSmth, doSmth)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == t2 == fun t2(b: Boolean) { @@ -63,47 +63,47 @@ fun t2(b: Boolean) { } --------------------- L0: - NEXT:[v(b: Boolean)] PREV:[] - v(b: Boolean) NEXT:[w(b)] PREV:[] - w(b) NEXT:[v(val i = 3)] PREV:[v(b: Boolean)] - v(val i = 3) NEXT:[r(3)] PREV:[w(b)] - r(3) NEXT:[w(i)] PREV:[v(val i = 3)] - w(i) NEXT:[r(b)] PREV:[r(3)] - r(b) NEXT:[jf(L2)] PREV:[w(i)] - jf(L2) NEXT:[read (Unit), ret L1] PREV:[r(b)] - ret L1 NEXT:[] PREV:[jf(L2)] + + v(b: Boolean) + w(b) + v(val i = 3) + r(3) + w(i) + r(b) + jf(L2) NEXT:[read (Unit), ret L1] + ret L1 NEXT:[] - jmp(L3) NEXT:[r(i)] PREV:[] L2: - read (Unit) NEXT:[r(i)] PREV:[jf(L2)] + read (Unit) PREV:[jf(L2)] L3: - r(i) NEXT:[call(doSmth, doSmth)] PREV:[read (Unit)] - call(doSmth, doSmth) NEXT:[r(i)] PREV:[r(i)] - r(i) NEXT:[jf(L4)] PREV:[call(doSmth, doSmth)] - jf(L4) NEXT:[read (Unit), ret L1] PREV:[r(i)] - ret L1 NEXT:[] PREV:[jf(L4)] + r(i) + call(doSmth, doSmth) + r(i) + jf(L4) NEXT:[read (Unit), ret L1] + ret L1 NEXT:[] - jmp(L5) NEXT:[] PREV:[] L4: - read (Unit) NEXT:[] PREV:[jf(L4)] + read (Unit) PREV:[jf(L4)] L1: L5: NEXT:[] PREV:[ret L1, ret L1, read (Unit)] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == doSmth == fun doSmth(s: String) {} --------------------- L0: - NEXT:[v(s: String)] PREV:[] - v(s: String) NEXT:[w(s)] PREV:[] - w(s) NEXT:[read (Unit)] PREV:[v(s: String)] - read (Unit) NEXT:[] PREV:[w(s)] + + v(s: String) + w(s) + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/LazyBooleans.instructions b/compiler/testData/cfg/LazyBooleans.instructions index 00c86dc6fc5..73588bc7980 100644 --- a/compiler/testData/cfg/LazyBooleans.instructions +++ b/compiler/testData/cfg/LazyBooleans.instructions @@ -18,61 +18,61 @@ fun lazyBooleans(a : Boolean, b : Boolean) : Unit { } --------------------- L0: - NEXT:[v(a : Boolean)] PREV:[] - v(a : Boolean) NEXT:[w(a)] PREV:[] - w(a) NEXT:[v(b : Boolean)] PREV:[v(a : Boolean)] - v(b : Boolean) NEXT:[w(b)] PREV:[w(a)] - w(b) NEXT:[r(a)] PREV:[v(b : Boolean)] - r(a) NEXT:[jf(L2)] PREV:[w(b)] - jf(L2) NEXT:[r(2), r(1)] PREV:[r(a)] - r(1) NEXT:[jmp(L3)] PREV:[jf(L2)] - jmp(L3) NEXT:[r(3)] PREV:[r(1)] + + v(a : Boolean) + w(a) + v(b : Boolean) + w(b) + r(a) + jf(L2) NEXT:[r(2), r(1)] + r(1) + jmp(L3) NEXT:[r(3)] L2: - r(2) NEXT:[r(3)] PREV:[jf(L2)] + r(2) PREV:[jf(L2)] L3: - r(3) NEXT:[r(a)] PREV:[jmp(L3), r(2)] - r(a) NEXT:[jf(L4)] PREV:[r(3)] - jf(L4) NEXT:[jf(L5), r(b)] PREV:[r(a)] - r(b) NEXT:[jf(L5)] PREV:[jf(L4)] + r(3) PREV:[jmp(L3), r(2)] + r(a) + jf(L4) NEXT:[jf(L5), r(b)] + r(b) L4: jf(L5) NEXT:[r(6), r(5)] PREV:[jf(L4), r(b)] - r(5) NEXT:[jmp(L6)] PREV:[jf(L5)] - jmp(L6) NEXT:[r(7)] PREV:[r(5)] + r(5) + jmp(L6) NEXT:[r(7)] L5: - r(6) NEXT:[r(7)] PREV:[jf(L5)] + r(6) PREV:[jf(L5)] L6: - r(7) NEXT:[r(a)] PREV:[jmp(L6), r(6)] - r(a) NEXT:[jt(L7)] PREV:[r(7)] - jt(L7) NEXT:[r(b), jf(L8)] PREV:[r(a)] - r(b) NEXT:[jf(L8)] PREV:[jt(L7)] + r(7) PREV:[jmp(L6), r(6)] + r(a) + jt(L7) NEXT:[r(b), jf(L8)] + r(b) L7: jf(L8) NEXT:[r(9), r(8)] PREV:[jt(L7), r(b)] - r(8) NEXT:[jmp(L9)] PREV:[jf(L8)] - jmp(L9) NEXT:[r(10)] PREV:[r(8)] + r(8) + jmp(L9) NEXT:[r(10)] L8: - r(9) NEXT:[r(10)] PREV:[jf(L8)] + r(9) PREV:[jf(L8)] L9: - r(10) NEXT:[r(a)] PREV:[jmp(L9), r(9)] - r(a) NEXT:[jf(L10)] PREV:[r(10)] - jf(L10) NEXT:[read (Unit), r(11)] PREV:[r(a)] - r(11) NEXT:[jmp(L11)] PREV:[jf(L10)] - jmp(L11) NEXT:[r(12)] PREV:[r(11)] + r(10) PREV:[jmp(L9), r(9)] + r(a) + jf(L10) NEXT:[read (Unit), r(11)] + r(11) + jmp(L11) NEXT:[r(12)] L10: - read (Unit) NEXT:[r(12)] PREV:[jf(L10)] + read (Unit) PREV:[jf(L10)] L11: - r(12) NEXT:[r(a)] PREV:[jmp(L11), read (Unit)] - r(a) NEXT:[jf(L12)] PREV:[r(12)] - jf(L12) NEXT:[r(13), read (Unit)] PREV:[r(a)] - read (Unit) NEXT:[jmp(L13)] PREV:[jf(L12)] - jmp(L13) NEXT:[r(14)] PREV:[read (Unit)] + r(12) PREV:[jmp(L11), read (Unit)] + r(a) + jf(L12) NEXT:[r(13), read (Unit)] + read (Unit) + jmp(L13) NEXT:[r(14)] L12: - r(13) NEXT:[r(14)] PREV:[jf(L12)] + r(13) PREV:[jf(L12)] L13: - r(14) NEXT:[] PREV:[jmp(L13), r(13)] + r(14) PREV:[jmp(L13), r(13)] L1: - NEXT:[] PREV:[r(14)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/LocalDeclarations.instructions b/compiler/testData/cfg/LocalDeclarations.instructions index 736cde0b113..8542450d83b 100644 --- a/compiler/testData/cfg/LocalDeclarations.instructions +++ b/compiler/testData/cfg/LocalDeclarations.instructions @@ -18,31 +18,31 @@ class C() { } --------------------- L0: - NEXT:[v(val a: Int = 1)] PREV:[] - v(val a: Int = 1) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w(a)] PREV:[v(val a: Int = 1)] - w(a) NEXT:[] PREV:[r(1)] + + v(val a: Int = 1) + r(1) + w(a) L1: - NEXT:[] PREV:[w(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == doSmth == fun doSmth(i: Int) {} --------------------- L0: - NEXT:[v(i: Int)] PREV:[] - v(i: Int) NEXT:[w(i)] PREV:[] - w(i) NEXT:[read (Unit)] PREV:[v(i: Int)] - read (Unit) NEXT:[] PREV:[w(i)] + + v(i: Int) + w(i) + read (Unit) L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == test1 == fun test1() { @@ -55,19 +55,19 @@ fun test1() { } --------------------- L0: - NEXT:[v(val a = object { val x : Int { $x = 1 } })] PREV:[] - v(val a = object { val x : Int { $x = 1 } }) NEXT:[v(val x : Int)] PREV:[] - v(val x : Int) NEXT:[r(1)] PREV:[v(val a = object { val x : Int { $x = 1 } })] - r(1) NEXT:[w($x)] PREV:[v(val x : Int)] - w($x) NEXT:[r(object { val x : Int { $x = 1 } })] PREV:[r(1)] - r(object { val x : Int { $x = 1 } }) NEXT:[w(a)] PREV:[w($x)] - w(a) NEXT:[] PREV:[r(object { val x : Int { $x = 1 } })] + + v(val a = object { val x : Int { $x = 1 } }) + v(val x : Int) + r(1) + w($x) + r(object { val x : Int { $x = 1 } }) + w(a) L1: - NEXT:[] PREV:[w(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == O == object O { @@ -78,16 +78,16 @@ object O { } --------------------- L0: - NEXT:[v(val x : Int)] PREV:[] - v(val x : Int) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w($x)] PREV:[v(val x : Int)] - w($x) NEXT:[] PREV:[r(1)] + + v(val x : Int) + r(1) + w($x) L1: - NEXT:[] PREV:[w($x)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == test2 == fun test2() { @@ -98,22 +98,22 @@ fun test2() { } --------------------- L0: - NEXT:[v(val b = 1)] PREV:[] - v(val b = 1) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w(b)] PREV:[v(val b = 1)] - w(b) NEXT:[v(val a = object { val x = b })] PREV:[r(1)] - v(val a = object { val x = b }) NEXT:[v(val x = b)] PREV:[w(b)] - v(val x = b) NEXT:[r(b)] PREV:[v(val a = object { val x = b })] - r(b) NEXT:[w(x)] PREV:[v(val x = b)] - w(x) NEXT:[r(object { val x = b })] PREV:[r(b)] - r(object { val x = b }) NEXT:[w(a)] PREV:[w(x)] - w(a) NEXT:[] PREV:[r(object { val x = b })] + + v(val b = 1) + r(1) + w(b) + v(val a = object { val x = b }) + v(val x = b) + r(b) + w(x) + r(object { val x = b }) + w(a) L1: - NEXT:[] PREV:[w(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == test3 == fun test3() { @@ -126,30 +126,30 @@ fun test3() { } --------------------- L0: - NEXT:[v(val a = object { val y : Int fun inner_bar() { y = 10 } })] PREV:[] - v(val a = object { val y : Int fun inner_bar() { y = 10 } }) NEXT:[v(val y : Int)] PREV:[] - v(val y : Int) NEXT:[jmp?(L2)] PREV:[v(val a = object { val y : Int fun inner_bar() { y = 10 } })] - jmp?(L2) NEXT:[r(object { val y : Int fun inner_bar() { y = 10 } }), d(fun inner_bar() { y = 10 })] PREV:[v(val y : Int)] - d(fun inner_bar() { y = 10 }) NEXT:[] PREV:[jmp?(L2)] + + v(val a = object { val y : Int fun inner_bar() { y = 10 } }) + v(val y : Int) + jmp?(L2) NEXT:[r(object { val y : Int fun inner_bar() { y = 10 } }), d(fun inner_bar() { y = 10 })] + d(fun inner_bar() { y = 10 }) NEXT:[] L2: - r(object { val y : Int fun inner_bar() { y = 10 } }) NEXT:[w(a)] PREV:[jmp?(L2)] - w(a) NEXT:[] PREV:[r(object { val y : Int fun inner_bar() { y = 10 } })] + r(object { val y : Int fun inner_bar() { y = 10 } }) PREV:[jmp?(L2)] + w(a) L1: - NEXT:[] PREV:[w(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d(fun inner_bar() { y = 10 })] + PREV:[, , d(fun inner_bar() { y = 10 })] L3: - NEXT:[r(10)] PREV:[] - r(10) NEXT:[w(y)] PREV:[] - w(y) NEXT:[] PREV:[r(10)] + + r(10) + w(y) L4: - NEXT:[] PREV:[w(y)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == inner_bar == fun inner_bar() { @@ -157,15 +157,15 @@ fun inner_bar() { } --------------------- L3: - NEXT:[r(10)] PREV:[] - r(10) NEXT:[w(y)] PREV:[] - w(y) NEXT:[] PREV:[r(10)] + + r(10) + w(y) L4: - NEXT:[] PREV:[w(y)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == test4 == fun test4() { @@ -182,33 +182,33 @@ fun test4() { } --------------------- L0: - NEXT:[v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })] PREV:[] - v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) NEXT:[v(val x : Int)] PREV:[] - v(val x : Int) NEXT:[v(val y : Int)] PREV:[v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })] - v(val y : Int) NEXT:[r(1)] PREV:[v(val x : Int)] - r(1) NEXT:[w($x)] PREV:[v(val y : Int)] - w($x) NEXT:[jmp?(L2)] PREV:[r(1)] - jmp?(L2) NEXT:[r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }), d(fun ggg() { y = 10 })] PREV:[w($x)] - d(fun ggg() { y = 10 }) NEXT:[] PREV:[jmp?(L2)] + + v(val a = object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) + v(val x : Int) + v(val y : Int) + r(1) + w($x) + jmp?(L2) NEXT:[r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }), d(fun ggg() { y = 10 })] + d(fun ggg() { y = 10 }) NEXT:[] L2: - r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) NEXT:[w(a)] PREV:[jmp?(L2)] - w(a) NEXT:[] PREV:[r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } })] + r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) PREV:[jmp?(L2)] + w(a) L1: - NEXT:[] PREV:[w(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d(fun ggg() { y = 10 })] + PREV:[, , d(fun ggg() { y = 10 })] L3: - NEXT:[r(10)] PREV:[] - r(10) NEXT:[w(y)] PREV:[] - w(y) NEXT:[] PREV:[r(10)] + + r(10) + w(y) L4: - NEXT:[] PREV:[w(y)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == ggg == fun ggg() { @@ -216,15 +216,15 @@ fun ggg() { } --------------------- L3: - NEXT:[r(10)] PREV:[] - r(10) NEXT:[w(y)] PREV:[] - w(y) NEXT:[] PREV:[r(10)] + + r(10) + w(y) L4: - NEXT:[] PREV:[w(y)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == test5 == fun test5() { @@ -243,47 +243,47 @@ fun test5() { } --------------------- L0: - NEXT:[v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })] PREV:[] - v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) NEXT:[v(var x = 1)] PREV:[] - v(var x = 1) NEXT:[r(1)] PREV:[v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })] - r(1) NEXT:[w(x)] PREV:[v(var x = 1)] - w(x) NEXT:[r(2)] PREV:[r(1)] - r(2) NEXT:[w($x)] PREV:[w(x)] - w($x) NEXT:[jmp?(L2)] PREV:[r(2)] - jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })] PREV:[w($x)] - d(fun foo() { x = 3 }) NEXT:[] PREV:[jmp?(L2)] + + v(val a = object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) + v(var x = 1) + r(1) + w(x) + r(2) + w($x) + jmp?(L2) NEXT:[jmp?(L5), d(fun foo() { x = 3 })] + d(fun foo() { x = 3 }) NEXT:[] L2: jmp?(L5) NEXT:[r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }), d(fun bar() { x = 4 })] PREV:[jmp?(L2)] - d(fun bar() { x = 4 }) NEXT:[] PREV:[jmp?(L5)] + d(fun bar() { x = 4 }) NEXT:[] L5: - r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) NEXT:[w(a)] PREV:[jmp?(L5)] - w(a) NEXT:[] PREV:[r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } })] + r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) PREV:[jmp?(L5)] + w(a) L1: - NEXT:[] PREV:[w(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d(fun foo() { x = 3 }), d(fun bar() { x = 4 })] + PREV:[, , d(fun foo() { x = 3 }), d(fun bar() { x = 4 })] L3: - NEXT:[r(3)] PREV:[] - r(3) NEXT:[w(x)] PREV:[] - w(x) NEXT:[] PREV:[r(3)] + + r(3) + w(x) L4: - NEXT:[] PREV:[w(x)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] L6: - NEXT:[r(4)] PREV:[] - r(4) NEXT:[w(x)] PREV:[] - w(x) NEXT:[] PREV:[r(4)] + + r(4) + w(x) L7: - NEXT:[] PREV:[w(x)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == foo == fun foo() { @@ -291,15 +291,15 @@ fun foo() { } --------------------- L3: - NEXT:[r(3)] PREV:[] - r(3) NEXT:[w(x)] PREV:[] - w(x) NEXT:[] PREV:[r(3)] + + r(3) + w(x) L4: - NEXT:[] PREV:[w(x)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == bar == fun bar() { @@ -307,13 +307,13 @@ fun bar() { } --------------------- L6: - NEXT:[r(4)] PREV:[] - r(4) NEXT:[w(x)] PREV:[] - w(x) NEXT:[] PREV:[r(4)] + + r(4) + w(x) L7: - NEXT:[] PREV:[w(x)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/MultiDecl.instructions b/compiler/testData/cfg/MultiDecl.instructions index 8d935658a62..1fd49674642 100644 --- a/compiler/testData/cfg/MultiDecl.instructions +++ b/compiler/testData/cfg/MultiDecl.instructions @@ -5,13 +5,13 @@ class C { } --------------------- L0: - NEXT:[] PREV:[] + L1: - NEXT:[] PREV:[] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == test == fun test(c: C) { @@ -20,23 +20,23 @@ fun test(c: C) { } --------------------- L0: - NEXT:[v(c: C)] PREV:[] - v(c: C) NEXT:[w(c)] PREV:[] - w(c) NEXT:[r(c)] PREV:[v(c: C)] - r(c) NEXT:[v(a)] PREV:[w(c)] - v(a) NEXT:[call(a, component1)] PREV:[r(c)] - call(a, component1) NEXT:[w(a)] PREV:[v(a)] - w(a) NEXT:[v(b)] PREV:[call(a, component1)] - v(b) NEXT:[call(b, component2)] PREV:[w(a)] - call(b, component2) NEXT:[w(b)] PREV:[v(b)] - w(b) NEXT:[v(val d = 1)] PREV:[call(b, component2)] - v(val d = 1) NEXT:[r(1)] PREV:[w(b)] - r(1) NEXT:[w(d)] PREV:[v(val d = 1)] - w(d) NEXT:[] PREV:[r(1)] + + v(c: C) + w(c) + r(c) + v(a) + call(a, component1) + w(a) + v(b) + call(b, component2) + w(b) + v(val d = 1) + r(1) + w(d) L1: - NEXT:[] PREV:[w(d)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/ObjectExpression.instructions b/compiler/testData/cfg/ObjectExpression.instructions index ad16e3a80b3..e7469555c36 100644 --- a/compiler/testData/cfg/ObjectExpression.instructions +++ b/compiler/testData/cfg/ObjectExpression.instructions @@ -4,13 +4,13 @@ trait A { } --------------------- L0: - NEXT:[] PREV:[] + L1: - NEXT:[] PREV:[] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == B == class B : A { @@ -18,14 +18,14 @@ class B : A { } --------------------- L0: - NEXT:[unsupported(DELEGATOR_SUPER_CLASS : A)] PREV:[] - unsupported(DELEGATOR_SUPER_CLASS : A) NEXT:[] PREV:[] + + unsupported(DELEGATOR_SUPER_CLASS : A) L1: - NEXT:[] PREV:[unsupported(DELEGATOR_SUPER_CLASS : A)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == foo == fun foo(b: B) : Int { @@ -34,20 +34,20 @@ fun foo(b: B) : Int { } --------------------- L0: - NEXT:[v(b: B)] PREV:[] - v(b: B) NEXT:[w(b)] PREV:[] - w(b) NEXT:[v(val o = object : A by b {})] PREV:[v(b: B)] - v(val o = object : A by b {}) NEXT:[r(b)] PREV:[w(b)] - r(b) NEXT:[r(object : A by b {})] PREV:[v(val o = object : A by b {})] - r(object : A by b {}) NEXT:[w(o)] PREV:[r(b)] - w(o) NEXT:[r(o)] PREV:[r(object : A by b {})] - r(o) NEXT:[call(foo, foo)] PREV:[w(o)] - call(foo, foo) NEXT:[ret(*) L1] PREV:[r(o)] - ret(*) L1 NEXT:[] PREV:[call(foo, foo)] + + v(b: B) + w(b) + v(val o = object : A by b {}) + r(b) + r(object : A by b {}) + w(o) + r(o) + call(foo, foo) + ret(*) L1 L1: - NEXT:[] PREV:[ret(*) L1] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions b/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions index c501c6b2e6c..0828caa9711 100644 --- a/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions +++ b/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions @@ -6,24 +6,24 @@ fun main() { } --------------------- L0: - NEXT:[r(1)] PREV:[] + L2 [loop entry point]: L5 [condition entry point]: - r(1) NEXT:[r(0)] PREV:[, jmp(L2 [loop entry point])] - r(0) NEXT:[call(>, compareTo)] PREV:[r(1)] - call(>, compareTo) NEXT:[jf(L3 [loop exit point])] PREV:[r(0)] - jf(L3 [loop exit point]) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] + r(1) PREV:[, jmp(L2 [loop entry point])] + r(0) + call(>, compareTo) + jf(L3 [loop exit point]) NEXT:[read (Unit), r(2)] L4 [body entry point]: - r(2) NEXT:[jmp(L2 [loop entry point])] PREV:[jf(L3 [loop exit point])] - jmp(L2 [loop entry point]) NEXT:[r(1)] PREV:[r(2)] + r(2) + jmp(L2 [loop entry point]) NEXT:[r(1)] L3 [loop exit point]: - read (Unit) NEXT:[] PREV:[jf(L3 [loop exit point])] + read (Unit) PREV:[jf(L3 [loop exit point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == dowhile == fun dowhile() { @@ -32,21 +32,21 @@ fun dowhile() { } --------------------- L0: - NEXT:[ret L1] PREV:[] + L2 [loop entry point]: L4 [body entry point]: - ret L1 NEXT:[] PREV:[] + ret L1 NEXT:[] L5 [condition entry point]: -- r(1) NEXT:[r(0)] PREV:[] -- r(0) NEXT:[call(>, compareTo)] PREV:[] -- call(>, compareTo) NEXT:[jt(L2 [loop entry point])] PREV:[] +- r(1) PREV:[] +- r(0) PREV:[] +- call(>, compareTo) PREV:[] - jt(L2 [loop entry point]) NEXT:[read (Unit), ret L1] PREV:[] L3 [loop exit point]: -- read (Unit) NEXT:[] PREV:[] +- read (Unit) PREV:[] L1: NEXT:[] PREV:[ret L1] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/ReturnFromExpression.instructions b/compiler/testData/cfg/ReturnFromExpression.instructions index 7803e28dee0..e032c49d8a8 100644 --- a/compiler/testData/cfg/ReturnFromExpression.instructions +++ b/compiler/testData/cfg/ReturnFromExpression.instructions @@ -4,17 +4,17 @@ fun blockAndAndMismatch() : Boolean { } --------------------- L0: - NEXT:[r(false)] PREV:[] - r(false) NEXT:[jt(L2)] PREV:[] - jt(L2) NEXT:[r(false), r(false || (return false))] PREV:[r(false)] - r(false) NEXT:[ret(*) L1] PREV:[jt(L2)] - ret(*) L1 NEXT:[] PREV:[r(false)] + + r(false) + jt(L2) NEXT:[r(false), r(false || (return false))] + r(false) + ret(*) L1 NEXT:[] L2: - r(false || (return false)) NEXT:[] PREV:[jt(L2)] + r(false || (return false)) PREV:[jt(L2)] L1: NEXT:[] PREV:[ret(*) L1, r(false || (return false))] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/ShortFunction.instructions b/compiler/testData/cfg/ShortFunction.instructions index 67dc92e5df8..10b57ea55e6 100644 --- a/compiler/testData/cfg/ShortFunction.instructions +++ b/compiler/testData/cfg/ShortFunction.instructions @@ -2,12 +2,12 @@ fun short() = 1 --------------------- L0: - NEXT:[r(1)] PREV:[] - r(1) NEXT:[] PREV:[] + + r(1) L1: - NEXT:[] PREV:[r(1)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/arrayAccessExpression.instructions b/compiler/testData/cfg/arrayAccessExpression.instructions index 65f82c20d42..85133769ba4 100644 --- a/compiler/testData/cfg/arrayAccessExpression.instructions +++ b/compiler/testData/cfg/arrayAccessExpression.instructions @@ -4,13 +4,13 @@ abstract class Ab { } --------------------- L0: - NEXT:[] PREV:[] + L1: - NEXT:[] PREV:[] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == test == fun test(ab: Ab) { @@ -18,17 +18,17 @@ fun test(ab: Ab) { } --------------------- L0: - NEXT:[v(ab: Ab)] PREV:[] - v(ab: Ab) NEXT:[w(ab)] PREV:[] - w(ab) NEXT:[r(ab)] PREV:[v(ab: Ab)] - r(ab) NEXT:[call(getArray, getArray)] PREV:[w(ab)] - call(getArray, getArray) NEXT:[r(1)] PREV:[r(ab)] - r(1) NEXT:[call(ab.getArray()[1], get)] PREV:[call(getArray, getArray)] - call(ab.getArray()[1], get) NEXT:[] PREV:[r(1)] + + v(ab: Ab) + w(ab) + r(ab) + call(getArray, getArray) + r(1) + call(ab.getArray()[1], get) L1: - NEXT:[] PREV:[call(ab.getArray()[1], get)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/arraySet.instructions b/compiler/testData/cfg/arraySet.instructions index caa3d358c48..576272d849a 100644 --- a/compiler/testData/cfg/arraySet.instructions +++ b/compiler/testData/cfg/arraySet.instructions @@ -4,17 +4,17 @@ fun foo(a: Array) { } --------------------- L0: - NEXT:[v(a: Array)] PREV:[] - v(a: Array) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(a)] PREV:[v(a: Array)] - r(a) NEXT:[r(1)] PREV:[w(a)] - r(1) NEXT:[r(2)] PREV:[r(a)] - r(2) NEXT:[call(a[1], set)] PREV:[r(1)] - call(a[1], set) NEXT:[] PREV:[r(2)] + + v(a: Array) + w(a) + r(a) + r(1) + r(2) + call(a[1], set) L1: - NEXT:[] PREV:[call(a[1], set)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/arraySetPlusAssign.instructions b/compiler/testData/cfg/arraySetPlusAssign.instructions index 83ecd8180a5..aacc0a6277f 100644 --- a/compiler/testData/cfg/arraySetPlusAssign.instructions +++ b/compiler/testData/cfg/arraySetPlusAssign.instructions @@ -4,22 +4,22 @@ fun foo(a: Array) { } --------------------- L0: - NEXT:[v(a: Array)] PREV:[] - v(a: Array) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(a)] PREV:[v(a: Array)] - r(a) NEXT:[r(0)] PREV:[w(a)] - r(0) NEXT:[call(a[0], get)] PREV:[r(a)] - call(a[0], get) NEXT:[r(1)] PREV:[r(0)] - r(1) NEXT:[call(+=, plus)] PREV:[call(a[0], get)] - call(+=, plus) NEXT:[r(a)] PREV:[r(1)] - r(a) NEXT:[r(0)] PREV:[call(+=, plus)] - r(0) NEXT:[r(1)] PREV:[r(a)] - r(1) NEXT:[call(a[0], set)] PREV:[r(0)] - call(a[0], set) NEXT:[] PREV:[r(1)] + + v(a: Array) + w(a) + r(a) + r(0) + call(a[0], get) + r(1) + call(+=, plus) + r(a) + r(0) + r(1) + call(a[0], set) L1: - NEXT:[] PREV:[call(a[0], set)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/assignmentToThis.instructions b/compiler/testData/cfg/assignmentToThis.instructions index bb018a1aeda..a98dddff448 100644 --- a/compiler/testData/cfg/assignmentToThis.instructions +++ b/compiler/testData/cfg/assignmentToThis.instructions @@ -4,15 +4,15 @@ fun Int.bar(c: C) { } --------------------- L0: - NEXT:[v(c: C)] PREV:[] - v(c: C) NEXT:[w(c)] PREV:[] - w(c) NEXT:[r(c)] PREV:[v(c: C)] - r(c) NEXT:[unsupported(BINARY_EXPRESSION : this = c)] PREV:[w(c)] - unsupported(BINARY_EXPRESSION : this = c) NEXT:[] PREV:[r(c)] + + v(c: C) + w(c) + r(c) + unsupported(BINARY_EXPRESSION : this = c) L1: - NEXT:[] PREV:[unsupported(BINARY_EXPRESSION : this = c)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/backingFieldAccess.instructions b/compiler/testData/cfg/backingFieldAccess.instructions index f9b305f06b9..af1f5720d64 100644 --- a/compiler/testData/cfg/backingFieldAccess.instructions +++ b/compiler/testData/cfg/backingFieldAccess.instructions @@ -9,38 +9,38 @@ class C { } --------------------- L0: - NEXT:[v(val a: Int get() = 1)] PREV:[] - v(val a: Int get() = 1) NEXT:[jmp?(L2)] PREV:[] - jmp?(L2) NEXT:[r($a), d(get() = 1)] PREV:[v(val a: Int get() = 1)] - d(get() = 1) NEXT:[] PREV:[jmp?(L2)] + + v(val a: Int get() = 1) + jmp?(L2) NEXT:[r($a), d(get() = 1)] + d(get() = 1) NEXT:[] L2: - r($a) NEXT:[] PREV:[jmp?(L2)] + r($a) PREV:[jmp?(L2)] L1: - NEXT:[] PREV:[r($a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d(get() = 1)] + PREV:[, , d(get() = 1)] L3: - NEXT:[r(1)] PREV:[] - r(1) NEXT:[] PREV:[] + + r(1) L4: - NEXT:[] PREV:[r(1)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == get_a == get() = 1 --------------------- L3: - NEXT:[r(1)] PREV:[] - r(1) NEXT:[] PREV:[] + + r(1) L4: - NEXT:[] PREV:[r(1)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/deadCode/DeadCode.instructions b/compiler/testData/cfg/deadCode/DeadCode.instructions index 34fe6b7949a..d1010a922d1 100644 --- a/compiler/testData/cfg/deadCode/DeadCode.instructions +++ b/compiler/testData/cfg/deadCode/DeadCode.instructions @@ -5,14 +5,14 @@ fun test() { } --------------------- L0: - NEXT:[call(Exception, )] PREV:[] - call(Exception, ) NEXT:[throw (throw Exception())] PREV:[] - throw (throw Exception()) NEXT:[] PREV:[call(Exception, )] -- call(test, test) NEXT:[] PREV:[] + + call(Exception, ) + throw (throw Exception()) NEXT:[] +- call(test, test) PREV:[] L1: NEXT:[] PREV:[] error: - NEXT:[] PREV:[throw (throw Exception())] + PREV:[throw (throw Exception())] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/deadCode/returnInElvis.instructions b/compiler/testData/cfg/deadCode/returnInElvis.instructions index 6b578975175..d213112ed8d 100644 --- a/compiler/testData/cfg/deadCode/returnInElvis.instructions +++ b/compiler/testData/cfg/deadCode/returnInElvis.instructions @@ -4,15 +4,15 @@ fun foo() { } --------------------- L0: - NEXT:[ret L1] PREV:[] - ret L1 NEXT:[] PREV:[] + + ret L1 NEXT:[] - jt(L2) NEXT:[r(null), ] PREV:[] -- r(null) NEXT:[] PREV:[] +- r(null) PREV:[] L1: L2: NEXT:[] PREV:[ret L1] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/equals.instructions b/compiler/testData/cfg/equals.instructions index 76b512f416b..bf813f6c95b 100644 --- a/compiler/testData/cfg/equals.instructions +++ b/compiler/testData/cfg/equals.instructions @@ -5,24 +5,24 @@ fun foo(a: Int, b: Int) { } --------------------- L0: - NEXT:[v(a: Int)] PREV:[] - v(a: Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[v(b: Int)] PREV:[v(a: Int)] - v(b: Int) NEXT:[w(b)] PREV:[w(a)] - w(b) NEXT:[r(a)] PREV:[v(b: Int)] - r(a) NEXT:[r(b)] PREV:[w(b)] - r(b) NEXT:[call(a == b, equals)] PREV:[r(a)] - call(a == b, equals) NEXT:[jf(L2)] PREV:[r(b)] - jf(L2) NEXT:[read (Unit), read (Unit)] PREV:[call(a == b, equals)] - read (Unit) NEXT:[jmp(L3)] PREV:[jf(L2)] - jmp(L3) NEXT:[] PREV:[read (Unit)] + + v(a: Int) + w(a) + v(b: Int) + w(b) + r(a) + r(b) + call(a == b, equals) + jf(L2) NEXT:[read (Unit), read (Unit)] + read (Unit) + jmp(L3) NEXT:[] L2: - read (Unit) NEXT:[] PREV:[jf(L2)] + read (Unit) PREV:[jf(L2)] L1: L3: NEXT:[] PREV:[jmp(L3), read (Unit)] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/expressionAsFunction.instructions b/compiler/testData/cfg/expressionAsFunction.instructions index 9f69956366b..d79d77a5dd5 100644 --- a/compiler/testData/cfg/expressionAsFunction.instructions +++ b/compiler/testData/cfg/expressionAsFunction.instructions @@ -4,15 +4,15 @@ fun invoke(f: () -> Unit) { } --------------------- L0: - NEXT:[v(f: () -> Unit)] PREV:[] - v(f: () -> Unit) NEXT:[w(f)] PREV:[] - w(f) NEXT:[r(f)] PREV:[v(f: () -> Unit)] - r(f) NEXT:[call((f), )] PREV:[w(f)] - call((f), ) NEXT:[] PREV:[r(f)] + + v(f: () -> Unit) + w(f) + r(f) + call((f), ) L1: - NEXT:[] PREV:[call((f), )] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/incrementAtTheEnd.instructions b/compiler/testData/cfg/incrementAtTheEnd.instructions index ceb46ee0865..9d32dbe7902 100644 --- a/compiler/testData/cfg/incrementAtTheEnd.instructions +++ b/compiler/testData/cfg/incrementAtTheEnd.instructions @@ -5,17 +5,17 @@ fun foo() { } --------------------- L0: - NEXT:[v(var i = 1)] PREV:[] - v(var i = 1) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w(i)] PREV:[v(var i = 1)] - w(i) NEXT:[r(i)] PREV:[r(1)] - r(i) NEXT:[call(++, inc)] PREV:[w(i)] - call(++, inc) NEXT:[w(i)] PREV:[r(i)] - w(i) NEXT:[] PREV:[call(++, inc)] + + v(var i = 1) + r(1) + w(i) + r(i) + call(++, inc) + w(i) L1: - NEXT:[] PREV:[w(i)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/invoke.instructions b/compiler/testData/cfg/invoke.instructions index e6db53ab4a6..80a1a5d49a9 100644 --- a/compiler/testData/cfg/invoke.instructions +++ b/compiler/testData/cfg/invoke.instructions @@ -4,15 +4,15 @@ fun foo(f: () -> Unit) { } --------------------- L0: - NEXT:[v(f: () -> Unit)] PREV:[] - v(f: () -> Unit) NEXT:[w(f)] PREV:[] - w(f) NEXT:[r(f)] PREV:[v(f: () -> Unit)] - r(f) NEXT:[call(f, invoke)] PREV:[w(f)] - call(f, invoke) NEXT:[] PREV:[r(f)] + + v(f: () -> Unit) + w(f) + r(f) + call(f, invoke) L1: - NEXT:[] PREV:[call(f, invoke)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/multiDeclarationWithError.instructions b/compiler/testData/cfg/multiDeclarationWithError.instructions index 9a7da7e96a0..a4733029e6f 100644 --- a/compiler/testData/cfg/multiDeclarationWithError.instructions +++ b/compiler/testData/cfg/multiDeclarationWithError.instructions @@ -5,19 +5,19 @@ fun foo(x: Int) { } --------------------- L0: - NEXT:[v(x: Int)] PREV:[] - v(x: Int) NEXT:[w(x)] PREV:[] - w(x) NEXT:[r(x)] PREV:[v(x: Int)] - r(x) NEXT:[v(a)] PREV:[w(x)] - v(a) NEXT:[w(a)] PREV:[r(x)] - w(a) NEXT:[v(b)] PREV:[v(a)] - v(b) NEXT:[w(b)] PREV:[w(a)] - w(b) NEXT:[r(a)] PREV:[v(b)] - r(a) NEXT:[] PREV:[w(b)] + + v(x: Int) + w(x) + r(x) + v(a) + w(a) + v(b) + w(b) + r(a) L1: - NEXT:[] PREV:[r(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/notEqual.instructions b/compiler/testData/cfg/notEqual.instructions index baab4fedf3c..3d1d565f512 100644 --- a/compiler/testData/cfg/notEqual.instructions +++ b/compiler/testData/cfg/notEqual.instructions @@ -4,24 +4,24 @@ fun neq(a: Int, b: Int) { } --------------------- L0: - NEXT:[v(a: Int)] PREV:[] - v(a: Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[v(b: Int)] PREV:[v(a: Int)] - v(b: Int) NEXT:[w(b)] PREV:[w(a)] - w(b) NEXT:[r(a)] PREV:[v(b: Int)] - r(a) NEXT:[r(b)] PREV:[w(b)] - r(b) NEXT:[call(a != b, equals)] PREV:[r(a)] - call(a != b, equals) NEXT:[jf(L2)] PREV:[r(b)] - jf(L2) NEXT:[read (Unit), read (Unit)] PREV:[call(a != b, equals)] - read (Unit) NEXT:[jmp(L3)] PREV:[jf(L2)] - jmp(L3) NEXT:[] PREV:[read (Unit)] + + v(a: Int) + w(a) + v(b: Int) + w(b) + r(a) + r(b) + call(a != b, equals) + jf(L2) NEXT:[read (Unit), read (Unit)] + read (Unit) + jmp(L3) NEXT:[] L2: - read (Unit) NEXT:[] PREV:[jf(L2)] + read (Unit) PREV:[jf(L2)] L1: L3: NEXT:[] PREV:[jmp(L3), read (Unit)] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/propertySafeCall.instructions b/compiler/testData/cfg/propertySafeCall.instructions index 7c8ad64128a..a26bd6cf7c0 100644 --- a/compiler/testData/cfg/propertySafeCall.instructions +++ b/compiler/testData/cfg/propertySafeCall.instructions @@ -4,15 +4,15 @@ fun test(s: String?) { } --------------------- L0: - NEXT:[v(s: String?)] PREV:[] - v(s: String?) NEXT:[w(s)] PREV:[] - w(s) NEXT:[r(s)] PREV:[v(s: String?)] - r(s) NEXT:[r(length)] PREV:[w(s)] - r(length) NEXT:[] PREV:[r(s)] + + v(s: String?) + w(s) + r(s) + r(length) L1: - NEXT:[] PREV:[r(length)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/returnsInWhen.instructions b/compiler/testData/cfg/returnsInWhen.instructions index 1322b234778..5962a9d507b 100644 --- a/compiler/testData/cfg/returnsInWhen.instructions +++ b/compiler/testData/cfg/returnsInWhen.instructions @@ -7,27 +7,27 @@ fun illegalWhenBlock(a: Any): Any { } --------------------- L0: - NEXT:[v(a: Any)] PREV:[] - v(a: Any) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(a)] PREV:[v(a: Any)] - r(a) NEXT:[jmp?(L4)] PREV:[w(a)] - jmp?(L4) NEXT:[jmp?(L6), r(a)] PREV:[r(a)] + + v(a: Any) + w(a) + r(a) + jmp?(L4) NEXT:[jmp?(L6), r(a)] L3: - r(a) NEXT:[ret(*) L1] PREV:[jmp?(L4)] - ret(*) L1 NEXT:[] PREV:[r(a)] + r(a) + ret(*) L1 NEXT:[] - jmp(L2) NEXT:[] PREV:[] L4: jmp?(L6) NEXT:[, r(a)] PREV:[jmp?(L4)] L5: - r(a) NEXT:[ret(*) L1] PREV:[jmp?(L6)] - ret(*) L1 NEXT:[] PREV:[r(a)] -- jmp(L2) NEXT:[] PREV:[] + r(a) + ret(*) L1 NEXT:[] +- jmp(L2) PREV:[] L1: L2: L6: NEXT:[] PREV:[ret(*) L1, jmp?(L6), ret(*) L1] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/thisExpression.instructions b/compiler/testData/cfg/thisExpression.instructions index feb1e8e2540..2563c2e8375 100644 --- a/compiler/testData/cfg/thisExpression.instructions +++ b/compiler/testData/cfg/thisExpression.instructions @@ -4,13 +4,13 @@ fun Function0.foo() { } --------------------- L0: - NEXT:[r(this)] PREV:[] - r(this) NEXT:[call(this, )] PREV:[] - call(this, ) NEXT:[] PREV:[r(this)] + + r(this) + call(this, ) L1: - NEXT:[] PREV:[call(this, )] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/typeParameter.instructions b/compiler/testData/cfg/typeParameter.instructions index f656ec4dbb5..28ae5b25733 100644 --- a/compiler/testData/cfg/typeParameter.instructions +++ b/compiler/testData/cfg/typeParameter.instructions @@ -4,12 +4,12 @@ fun foo() { } --------------------- L0: - NEXT:[error(T, No resolved call)] PREV:[] - error(T, No resolved call) NEXT:[] PREV:[] + + error(T, No resolved call) L1: - NEXT:[] PREV:[error(T, No resolved call)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/unresolved.instructions b/compiler/testData/cfg/unresolved.instructions index 1ded5bbfb2b..1aec2e37bf4 100644 --- a/compiler/testData/cfg/unresolved.instructions +++ b/compiler/testData/cfg/unresolved.instructions @@ -4,16 +4,16 @@ fun test(a: Any) { } --------------------- L0: - NEXT:[v(a: Any)] PREV:[] - v(a: Any) NEXT:[w(a)] PREV:[] - w(a) NEXT:[error(foo, No resolved call)] PREV:[v(a: Any)] - error(foo, No resolved call) NEXT:[error(foo, No resolved call)] PREV:[w(a)] - error(foo, No resolved call) NEXT:[r(a)] PREV:[error(foo, No resolved call)] - r(a) NEXT:[] PREV:[error(foo, No resolved call)] + + v(a: Any) + w(a) + error(foo, No resolved call) + error(foo, No resolved call) + r(a) L1: - NEXT:[] PREV:[r(a)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/testData/cfg/unusedFunctionLiteral.instructions b/compiler/testData/cfg/unusedFunctionLiteral.instructions index 82239e3eb30..de64b6babfa 100644 --- a/compiler/testData/cfg/unusedFunctionLiteral.instructions +++ b/compiler/testData/cfg/unusedFunctionLiteral.instructions @@ -4,37 +4,37 @@ fun foo() { } --------------------- L0: - NEXT:[jmp?(L2)] PREV:[] - jmp?(L2) NEXT:[r({}), d({})] PREV:[] - d({}) NEXT:[] PREV:[jmp?(L2)] + + jmp?(L2) NEXT:[r({}), d({})] + d({}) NEXT:[] L2: - r({}) NEXT:[] PREV:[jmp?(L2)] + r({}) PREV:[jmp?(L2)] L1: - NEXT:[] PREV:[r({})] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, , d({})] + PREV:[, , d({})] L3: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L4: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== == anonymous_0 == {} --------------------- L3: - NEXT:[read (Unit)] PREV:[] - read (Unit) NEXT:[] PREV:[] + + read (Unit) L4: - NEXT:[] PREV:[read (Unit)] + NEXT:[] error: - NEXT:[] PREV:[] + PREV:[] sink: - NEXT:[] PREV:[, ] + PREV:[, ] ===================== diff --git a/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java b/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java index 8c80548cb61..54bdb9a7c4e 100644 --- a/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java +++ b/compiler/tests/org/jetbrains/jet/cfg/AbstractControlFlowTest.java @@ -19,6 +19,7 @@ package org.jetbrains.jet.cfg; import com.google.common.collect.Sets; import com.intellij.openapi.util.io.FileUtil; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.ConfigurationKind; import org.jetbrains.jet.JetTestUtils; import org.jetbrains.jet.analyzer.AnalyzeExhaust; @@ -121,11 +122,6 @@ public abstract class AbstractControlFlowTest extends KotlinTestWithEnvironment } File expectedInstructionsFile = JetTestUtils.replaceExtension(file, "instructions"); - if (!expectedInstructionsFile.exists()) { - FileUtil.writeToFile(expectedInstructionsFile, instructionDump.toString()); - fail("No expected instructions for " + FileUtil.getNameWithoutExtension(file) + " generated result is written into " + expectedInstructionsFile); - } - JetTestUtils.assertEqualsToFile(expectedInstructionsFile, instructionDump.toString()); // StringBuilder graphDump = new StringBuilder(); @@ -226,7 +222,7 @@ public abstract class AbstractControlFlowTest extends KotlinTestWithEnvironment maxNextLength = instructionListText.length(); } } - for (int i = 0, instructionsSize = instructions.size(); i < instructionsSize; i++) { + for (int i = 0; i < instructions.size(); i++) { Instruction instruction = instructions.get(i); if (instruction instanceof LocalFunctionDeclarationInstruction) { LocalFunctionDeclarationInstruction localFunctionDeclarationInstruction = (LocalFunctionDeclarationInstruction) instruction; @@ -238,15 +234,34 @@ public abstract class AbstractControlFlowTest extends KotlinTestWithEnvironment } } - out.append(formatInstruction(instruction, maxLength, remainedAfterPostProcessInstructions)). - append(" NEXT:").append(String.format("%1$-" + maxNextLength + "s", formatInstructionList(instruction.getNextInstructions()))). - append(" PREV:").append(formatInstructionList(instruction.getPreviousInstructions())).append("\n"); + out.append(formatInstruction(instruction, maxLength, remainedAfterPostProcessInstructions)); + + // Only print NEXT and PREV if the values are non-trivial + Instruction next = i == instructions.size() - 1 ? null : instructions.get(i + 1); + Collection nextInstructions = instruction.getNextInstructions(); + if (!sameContents(next, nextInstructions)) { + out.append(" NEXT:").append(String.format("%1$-" + maxNextLength + "s", formatInstructionList(nextInstructions))); + } + + Instruction prev = i == 0 ? null : instructions.get(i - 1); + Collection previousInstructions = instruction.getPreviousInstructions(); + if (!sameContents(prev, previousInstructions)) { + out.append(" PREV:").append(formatInstructionList(previousInstructions)); + } + out.append("\n"); } for (PseudocodeImpl local : locals) { dumpInstructions(local, out); } } + private static boolean sameContents(@Nullable Instruction natural, Collection actual) { + if (natural == null) { + return actual.isEmpty(); + } + return Collections.singleton(natural).equals(new HashSet(actual)); + } + public void dumpEdges(List instructions, final PrintStream out, final int[] count, final Map nodeToName) { for (Instruction fromInst : instructions) { fromInst.accept(new InstructionVisitor() {