[FIR] Union CFG edges from postponed lambdas only if outer call was analyzed independently

Before this change nodes unification was called if outer call was
  completed in the FULL mode, but it may happen even if this call is
  actually a part of some other outer call
This commit is contained in:
Dmitriy Novozhilov
2023-06-28 15:19:32 +03:00
committed by Space Team
parent cf949e8760
commit fc57f48c8f
12 changed files with 674 additions and 690 deletions
File diff suppressed because it is too large Load Diff
@@ -84,7 +84,7 @@ FILE: flowFromInplaceLambda.kt
^ (R|<local>/x| as R|kotlin/Int|)
}
)), (R|<local>/y| as R|kotlin/Int|), R|/exactlyOnce|<R|kotlin/Int|>(<L> = exactlyOnce@fun <anonymous>(): R|kotlin/Int| <inline=NoInline, kind=EXACTLY_ONCE> {
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
R|<local>/y|.R|kotlin/Int.inc|()
^ Int(1)
}
@@ -98,7 +98,7 @@ FILE: flowFromInplaceLambda.kt
^ (R|<local>/x| as R|kotlin/Int|)
}
)), (R|<local>/y| as R|kotlin/Int|), R|/atLeastOnce|<R|kotlin/Int|>(<L> = atLeastOnce@fun <anonymous>(): R|kotlin/Int| <inline=NoInline, kind=AT_LEAST_ONCE> {
R|<local>/x|.R|kotlin/Int.inc|()
R|<local>/x|.<Unresolved name: inc>#()
R|<local>/y|.R|kotlin/Int.inc|()
^ Int(1)
}
@@ -39,7 +39,7 @@ fun completedCallExactlyOnce(x: Any?, y: Any?) {
// The value of the type argument is known, so the call is complete and the data can flow.
id(exactlyOnce { y.<!UNRESOLVED_REFERENCE!>inc<!>(); x as Int }),
y as Int,
exactlyOnce { x.inc(); y.inc(); 1 }
exactlyOnce { x.<!UNRESOLVED_REFERENCE!>inc<!>(); y.inc(); 1 }
).inc() // OK
x.inc() // OK
y.inc() // OK
@@ -49,7 +49,7 @@ fun completedCallAtLeastOnce(x: Any?, y: Any?) {
select(
id(atLeastOnce { y.<!UNRESOLVED_REFERENCE!>inc<!>(); x as Int }),
y as Int,
atLeastOnce { x.inc(); y.inc(); 1 }
atLeastOnce { x.<!UNRESOLVED_REFERENCE!>inc<!>(); y.inc(); 1 }
).inc() // OK
x.inc() // OK
y.inc() // OK
@@ -112,8 +112,9 @@ finally {
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
23 -> {17} [color=green style=dashed];
23 -> {24} [color=green];
23 -> {31} [color=red];
24 -> {25};
24 -> {27} [label="onUncaughtException"];
25 -> {26};
@@ -201,7 +202,8 @@ finally {
44 -> {45};
45 -> {46};
46 -> {47};
48 -> {49};
48 -> {49} [color=green];
48 -> {56} [color=red];
49 -> {50};
49 -> {52} [label="onUncaughtException"];
50 -> {51};