FIR: Fix rendered fir and DFA graph test data after safe-calls refactoring

^KT-38444 In Progress
This commit is contained in:
Denis Zharkov
2020-06-01 16:05:17 +03:00
parent 409e90e7de
commit 723b275d99
30 changed files with 116 additions and 114 deletions
@@ -114,7 +114,7 @@ digraph assignSafeCall_kt {
38 [label="Enter function test_2" style="filled" fillcolor=red];
40 [label="Access variable R|<local>/a|"];
41 [label="Enter safe call"];
43 [label="Function call: R|<local>/a|?.R|/A.foo|()"];
43 [label="Function call: $subj$.R|/A.foo|()"];
42 [label="Exit safe call"];
44 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_11 {
@@ -333,7 +333,7 @@ digraph assignSafeCall_kt {
119 [label="Enter function test_2" style="filled" fillcolor=red];
121 [label="Access variable R|<local>/a|"];
122 [label="Enter safe call"];
124 [label="Function call: R|<local>/a|?.R|/B.foo|()"];
124 [label="Function call: $subj$.R|/B.foo|()"];
123 [label="Exit safe call"];
125 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_30 {
@@ -16,7 +16,7 @@ FILE: assignSafeCall.kt
}
public final fun test_1(a: R|A?|): R|kotlin/Unit| {
lval x: R|kotlin/Int?| = R|<local>/a|?.R|/A.x|
lval x: R|kotlin/Int?| = R|<local>/a|?.{ $subj$.R|/A.x| }
when () {
!=(R|<local>/x|, Null(null)) -> {
R|<local>/a|.R|/A.bar|()
@@ -25,7 +25,7 @@ FILE: assignSafeCall.kt
}
public final fun test_2(a: R|A?|): R|kotlin/Unit| {
lval x: R|kotlin/Int?| = R|<local>/a|?.R|/A.foo|()
lval x: R|kotlin/Int?| = R|<local>/a|?.{ $subj$.R|/A.foo|() }
when () {
!=(R|<local>/x|, Null(null)) -> {
R|<local>/a|.R|/A.bar|()
@@ -56,7 +56,7 @@ FILE: assignSafeCall.kt
}
public final fun test_1(a: R|B?|): R|kotlin/Unit| {
lval x: R|kotlin/Int?| = R|<local>/a|?.R|/B.x|
lval x: R|kotlin/Int?| = R|<local>/a|?.{ $subj$.R|/B.x| }
when () {
!=(R|<local>/x|, Null(null)) -> {
R|<local>/a|.R|/B.bar|()
@@ -65,7 +65,7 @@ FILE: assignSafeCall.kt
}
public final fun test_2(a: R|B?|): R|kotlin/Unit| {
lval x: R|kotlin/Int?| = R|<local>/a|?.R|/B.foo|()
lval x: R|kotlin/Int?| = R|<local>/a|?.{ $subj$.R|/B.foo|() }
when () {
!=(R|<local>/x|, Null(null)) -> {
R|<local>/a|.R|/B.bar|()
@@ -28,7 +28,7 @@ digraph safeCallAndEqualityToBool_kt {
9 [label="Enter when branch condition "];
10 [label="Access variable R|<local>/s|"];
11 [label="Enter safe call"];
13 [label="Function call: R|<local>/s|?.R|/check|()"];
13 [label="Function call: $subj$.R|/check|()"];
12 [label="Exit safe call"];
14 [label="Const: Boolean(true)"];
15 [label="Operator =="];
@@ -98,7 +98,7 @@ digraph safeCallAndEqualityToBool_kt {
35 [label="Enter when branch condition "];
36 [label="Access variable R|<local>/s|"];
37 [label="Enter safe call"];
39 [label="Function call: R|<local>/s|?.R|/check|()"];
39 [label="Function call: $subj$.R|/check|()"];
38 [label="Exit safe call"];
40 [label="Const: Boolean(false)"];
41 [label="Operator =="];
@@ -168,7 +168,7 @@ digraph safeCallAndEqualityToBool_kt {
61 [label="Enter when branch condition "];
62 [label="Access variable R|<local>/s|"];
63 [label="Enter safe call"];
65 [label="Function call: R|<local>/s|?.R|/check|()"];
65 [label="Function call: $subj$.R|/check|()"];
64 [label="Exit safe call"];
66 [label="Const: Boolean(true)"];
67 [label="Operator !="];
@@ -238,7 +238,7 @@ digraph safeCallAndEqualityToBool_kt {
87 [label="Enter when branch condition "];
88 [label="Access variable R|<local>/s|"];
89 [label="Enter safe call"];
91 [label="Function call: R|<local>/s|?.R|/check|()"];
91 [label="Function call: $subj$.R|/check|()"];
90 [label="Exit safe call"];
92 [label="Const: Boolean(false)"];
93 [label="Operator !="];
@@ -4,7 +4,7 @@ FILE: safeCallAndEqualityToBool.kt
}
public final fun test_1(s: R|kotlin/String?|): R|kotlin/Unit| {
when () {
==(R|<local>/s|?.R|/check|(), Boolean(true)) -> {
==(R|<local>/s|?.{ $subj$.R|/check|() }, Boolean(true)) -> {
R|<local>/s|.R|kotlin/String.length|
}
else -> {
@@ -15,7 +15,7 @@ FILE: safeCallAndEqualityToBool.kt
}
public final fun test_2(s: R|kotlin/String?|): R|kotlin/Unit| {
when () {
==(R|<local>/s|?.R|/check|(), Boolean(false)) -> {
==(R|<local>/s|?.{ $subj$.R|/check|() }, Boolean(false)) -> {
R|<local>/s|.R|kotlin/String.length|
}
else -> {
@@ -26,7 +26,7 @@ FILE: safeCallAndEqualityToBool.kt
}
public final fun test_3(s: R|kotlin/String?|): R|kotlin/Unit| {
when () {
!=(R|<local>/s|?.R|/check|(), Boolean(true)) -> {
!=(R|<local>/s|?.{ $subj$.R|/check|() }, Boolean(true)) -> {
R|<local>/s|.<Inapplicable(WRONG_RECEIVER): [kotlin/String.length]>#
}
else -> {
@@ -37,7 +37,7 @@ FILE: safeCallAndEqualityToBool.kt
}
public final fun test_4(s: R|kotlin/String?|): R|kotlin/Unit| {
when () {
!=(R|<local>/s|?.R|/check|(), Boolean(false)) -> {
!=(R|<local>/s|?.{ $subj$.R|/check|() }, Boolean(false)) -> {
R|<local>/s|.<Inapplicable(WRONG_RECEIVER): [kotlin/String.length]>#
}
else -> {
@@ -33,7 +33,7 @@ digraph safeCalls_kt {
13 [label="Access variable R|kotlin/String.length|"];
14 [label="Const: Int(1)"];
15 [label="Operator =="];
16 [label="Function call: R|<local>/x|?.R|/foo|(...)"];
16 [label="Function call: $subj$.R|/foo|(...)"];
11 [label="Exit safe call"];
17 [label="Access variable R|<local>/x|"];
18 [label="Access variable <Inapplicable(WRONG_RECEIVER): [kotlin/String.length]>#"];
@@ -86,7 +86,7 @@ digraph safeCalls_kt {
30 [label="Type operator: (R|<local>/x| as? R|A|)"];
31 [label="Enter safe call"];
33 [label="Access variable R|<local>/x|"];
34 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)"];
34 [label="Function call: $subj$.R|/A.bar|(...)"];
32 [label="Exit safe call"];
28 [label="Exit function test_2" style="filled" fillcolor=red];
}
@@ -105,12 +105,12 @@ digraph safeCalls_kt {
38 [label="Type operator: (R|<local>/x| as? R|A|)"];
39 [label="Enter safe call"];
41 [label="Access variable R|<local>/x|"];
42 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)"];
42 [label="Function call: $subj$.R|/A.bar|(...)"];
40 [label="Exit safe call"];
43 [label="Enter safe call"];
45 [label="Access variable R|<local>/x|"];
46 [label="Function call: R|<local>/x|.R|/A.bool|()"];
47 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)?.R|/foo|(...)"];
47 [label="Function call: $subj$.R|/foo|(...)"];
44 [label="Exit safe call"];
48 [label="Enter safe call"];
50 [label="Postponed enter to lambda"];
@@ -122,7 +122,7 @@ digraph safeCalls_kt {
56 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
51 [label="Postponed exit from lambda"];
52 [label="Function call: (R|<local>/x| as? R|A|)?.R|/A.bar|(...)?.R|/foo|(...)?.R|/let|(...)"];
52 [label="Function call: $subj$.R|/let|(...)"];
49 [label="Exit safe call"];
53 [label="Access variable R|<local>/x|"];
54 [label="Function call: R|<local>/x|.<Unresolved name: bool>#()"];
@@ -157,10 +157,10 @@ digraph safeCalls_kt {
59 [label="Enter function test_4" style="filled" fillcolor=red];
61 [label="Access variable R|<local>/x|"];
62 [label="Enter safe call"];
64 [label="Function call: R|<local>/x|?.R|/A.id|()"];
64 [label="Function call: $subj$.R|/A.id|()"];
63 [label="Exit safe call"];
65 [label="Enter safe call"];
67 [label="Function call: R|<local>/x|?.R|/A.id|()?.R|/A.bool|()"];
67 [label="Function call: $subj$.R|/A.bool|()"];
66 [label="Exit safe call"];
68 [label="Access variable R|<local>/x|"];
69 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.id]>#()"];
@@ -192,45 +192,47 @@ digraph safeCalls_kt {
77 [label="Postponed enter to lambda"];
subgraph cluster_13 {
color=blue
88 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
90 [label="Jump: ^test_5 Unit"];
91 [label="Stub" style="filled" fillcolor=gray];
89 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray];
89 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
91 [label="Jump: ^test_5 Unit"];
92 [label="Stub" style="filled" fillcolor=gray];
90 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
80 [label="Call arguments union" style="filled" fillcolor=gray];
78 [label="Postponed exit from lambda"];
79 [label="Function call: R|<local>/x|?.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(...)" style="filled" fillcolor=gray];
79 [label="Function call: $subj$.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(...)" style="filled" fillcolor=gray];
81 [label="Stub" style="filled" fillcolor=gray];
76 [label="Exit safe call"];
81 [label="Enter safe call"];
83 [label="Access variable R|<local>/x|"];
84 [label="Function call: R|<local>/x|.R|/A.bool|()"];
85 [label="Function call: R|<local>/x|?.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(...)?.R|/boo|(...)"];
82 [label="Exit safe call"];
86 [label="Access variable R|<local>/x|"];
87 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.id]>#()"];
82 [label="Enter safe call"];
84 [label="Access variable R|<local>/x|"];
85 [label="Function call: R|<local>/x|.R|/A.bool|()"];
86 [label="Function call: $subj$.R|/boo|(...)"];
83 [label="Exit safe call"];
87 [label="Access variable R|<local>/x|"];
88 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.id]>#()"];
73 [label="Exit function test_5" style="filled" fillcolor=red];
}
72 -> {74};
74 -> {75 76};
75 -> {77};
76 -> {81 82};
77 -> {88};
76 -> {82 83};
77 -> {89};
77 -> {78} [color=red];
78 -> {79} [color=green];
79 -> {76} [style=dotted];
79 -> {73 81} [style=dotted];
80 -> {79} [style=dotted];
81 -> {83};
82 -> {86};
83 -> {84};
81 -> {76} [style=dotted];
82 -> {84};
83 -> {87};
84 -> {85};
85 -> {82};
86 -> {87};
87 -> {73};
88 -> {90};
89 -> {80} [style=dotted];
89 -> {78} [color=green];
90 -> {73};
90 -> {91} [style=dotted];
91 -> {89} [style=dotted];
85 -> {86};
86 -> {83};
87 -> {88};
88 -> {73} [style=dotted];
89 -> {91};
90 -> {80} [style=dotted];
90 -> {78} [color=green];
91 -> {73};
91 -> {92} [style=dotted];
92 -> {90} [style=dotted];
}
@@ -5,7 +5,7 @@ FILE: safeCalls.kt
public final fun R|kotlin/String|.let(block: R|() -> kotlin/Unit|): R|kotlin/Unit| {
}
public final fun test(x: R|kotlin/String?|): R|kotlin/Unit| {
R|<local>/x|?.R|/foo|(==(R|<local>/x|.R|kotlin/String.length|, Int(1)))
R|<local>/x|?.{ $subj$.R|/foo|(==(R|<local>/x|.R|kotlin/String.length|, Int(1))) }
R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [kotlin/String.length]>#
}
public abstract interface A : R|kotlin/Any| {
@@ -17,24 +17,24 @@ FILE: safeCalls.kt
}
public final fun test_2(x: R|kotlin/Any|): R|kotlin/Unit| {
(R|<local>/x| as? R|A|)?.R|/A.bar|(R|<local>/x|)
(R|<local>/x| as? R|A|)?.{ $subj$.R|/A.bar|(R|<local>/x|) }
}
public final fun test_3(x: R|kotlin/Any|): R|kotlin/Unit| {
(R|<local>/x| as? R|A|)?.R|/A.bar|(R|<local>/x|)?.R|/foo|(R|<local>/x|.R|/A.bool|())?.R|/let|(<L> = let@fun <anonymous>(): R|kotlin/Unit| {
(R|<local>/x| as? R|A|)?.{ $subj$.R|/A.bar|(R|<local>/x|) }?.{ $subj$.R|/foo|(R|<local>/x|.R|/A.bool|()) }?.{ $subj$.R|/let|(<L> = let@fun <anonymous>(): R|kotlin/Unit| {
^ R|<local>/x|.R|/A.bool|()
}
)
) }
R|<local>/x|.<Unresolved name: bool>#()
}
public final fun test_4(x: R|A?|): R|kotlin/Unit| {
R|<local>/x|?.R|/A.id|()?.R|/A.bool|()
R|<local>/x|?.{ $subj$.R|/A.id|() }?.{ $subj$.R|/A.bool|() }
R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.id]>#()
}
public final fun R|kotlin/Any?|.boo(b: R|kotlin/Boolean|): R|kotlin/Unit|
public final fun test_5(x: R|A?|): R|kotlin/Unit| {
R|<local>/x|?.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(<L> = let@fun <anonymous>(it: R|A|): R|kotlin/Nothing| <kind=EXACTLY_ONCE> {
R|<local>/x|?.{ $subj$.R|kotlin/let|<R|A|, R|kotlin/Nothing|>(<L> = let@fun <anonymous>(it: R|A|): R|kotlin/Nothing| <kind=EXACTLY_ONCE> {
^test_5 Unit
}
)?.R|/boo|(R|<local>/x|.R|/A.bool|())
) }?.{ $subj$.R|/boo|(R|<local>/x|.R|/A.bool|()) }
R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.id]>#()
}