FIR CFG: add union nodes

Quick quiz:

 Q: In a CFG, what does `a -> b -> c -> d` mean?
 A: `a`, then `b`, then `c`, then `d`.

 Q: In a CFG, what does `a -> b -> d; a -> c -> d` mean?
 A: `a`, then `b` or `c`, then `d`.

 Q: So how do you encode "a, then (b, then c) or (c, then b), then d`?
 A: You can't.

Problem is, you need to, because that's what `a; run2({ b }, { c }); d`
does when `run2` has a contract that it calls both its lambda arguments
in-place: `shuffle(listOf(block1, block2)).forEach { it() }` is a
perfectly valid implementation for it, as little sense as that makes.

So that's what union nodes solve. When a node implements
`UnionNodeMarker`, its inputs are interpreted as "all visited in some
order" instead of the normal "one of the inputs is visited".

Currently this is used for data flow. It *should* also be used for
control flow, but it isn't. But it should be. But that's not so easy.

BTW, `try` exit is NOT a union node; although lambdas in one branch can
be completed according to types' of lambdas in another, data does not
flow between the branches anyway (since we don't know how much of the
`try` executed before jumping into `catch`, and `catch`es are mutually
exclusive) so a `try` expression is more like `when` than a function
call with called-in-place-exactly-once arguments. The fact that
`exitTryExpression` used `processUnionOfArguments` in a weird way
should've hinted at that, but now we know for certain.
This commit is contained in:
pyos
2022-11-17 12:53:35 +01:00
committed by teamcity
parent 99bebfa183
commit a9be27e330
108 changed files with 4050 additions and 4239 deletions
@@ -21,8 +21,8 @@ digraph inAnonymousObject_kt {
4 [label="Exit anonymous object expression"];
5 [label="Variable declaration: lval obj: R|<anonymous>|"];
6 [label="Access variable R|<local>/obj|"];
7 [label="Function call: R|<local>/obj|.R|/<anonymous>.run|()"];
8 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
7 [label="Function call: R|<local>/obj|.R|/<anonymous>.run|()" style="filled" fillcolor=yellow];
8 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
9 [label="Exit block"];
}
10 [label="Exit function foo" style="filled" fillcolor=red];
@@ -54,7 +54,7 @@ digraph inAnonymousObject_kt {
subgraph cluster_3 {
color=red
15 [label="Enter function <init>" style="filled" fillcolor=red];
16 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
16 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
17 [label="Exit function <init>" style="filled" fillcolor=red];
}
15 -> {16};
@@ -95,7 +95,7 @@ digraph inAnonymousObject_kt {
subgraph cluster_8 {
color=blue
28 [label="Enter block"];
29 [label="Function call: R|<local>/c|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
29 [label="Function call: R|<local>/c|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
30 [label="Exit block"];
}
31 [label="Exit function run" style="filled" fillcolor=red];
@@ -10,9 +10,9 @@ digraph inLocalClass_kt {
color=blue
1 [label="Enter block"];
2 [label="Exit local class foo"];
3 [label="Function call: R|/LocalClass.LocalClass|()"];
4 [label="Function call: R|/LocalClass.LocalClass|().R|<local>/run|()"];
5 [label="Function call: R|<local>/e|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
3 [label="Function call: R|/LocalClass.LocalClass|()" style="filled" fillcolor=yellow];
4 [label="Function call: R|/LocalClass.LocalClass|().R|<local>/run|()" style="filled" fillcolor=yellow];
5 [label="Function call: R|<local>/e|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
6 [label="Exit block"];
}
7 [label="Exit function foo" style="filled" fillcolor=red];
@@ -55,11 +55,11 @@ digraph inLocalClass_kt {
subgraph cluster_4 {
color=red
15 [label="Enter function <init>" style="filled" fillcolor=red];
16 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
16 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
subgraph cluster_5 {
color=blue
17 [label="Enter block"];
18 [label="Function call: R|<local>/b|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
18 [label="Function call: R|<local>/b|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
19 [label="Exit block"];
}
20 [label="Exit function <init>" style="filled" fillcolor=red];
@@ -95,7 +95,7 @@ digraph inLocalClass_kt {
subgraph cluster_9 {
color=blue
28 [label="Enter block"];
29 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
29 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
30 [label="Exit block"];
}
31 [label="Exit function run" style="filled" fillcolor=red];
@@ -10,8 +10,8 @@ digraph inLocalFunction_kt {
color=blue
1 [label="Enter block"];
2 [label="Local function declaration foo"];
3 [label="Function call: R|<local>/localFun|()"];
4 [label="Function call: R|<local>/b|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
3 [label="Function call: R|<local>/localFun|()" style="filled" fillcolor=yellow];
4 [label="Function call: R|<local>/b|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
5 [label="Exit block"];
}
6 [label="Exit function foo" style="filled" fillcolor=red];
@@ -23,8 +23,8 @@ digraph inLocalFunction_kt {
color=blue
8 [label="Enter block"];
9 [label="Access variable R|<local>/a|"];
10 [label="Function call: R|<local>/a|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
11 [label="Function call: R|<local>/a|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
10 [label="Function call: R|<local>/a|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
11 [label="Function call: R|<local>/a|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
12 [label="Exit block"];
}
13 [label="Exit function localFun" style="filled" fillcolor=red];
@@ -43,7 +43,7 @@ digraph toLocalVariables_kt {
13 [label="Enter block"];
14 [label="Access variable R|<local>/y|"];
15 [label="Variable declaration: lval yCopy: R|() -> kotlin/Unit|"];
16 [label="Function call: R|<local>/yCopy|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
16 [label="Function call: R|<local>/yCopy|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
17 [label="Exit block"];
}
18 [label="Exit when branch result"];
@@ -52,7 +52,7 @@ digraph toLocalVariables_kt {
color=blue
20 [label="Enter block"];
21 [label="Access variable R|<local>/x|"];
22 [label="Function call: R|/bar|(...)"];
22 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow];
23 [label="Exit block"];
}
24 [label="Exit when branch result"];
@@ -61,7 +61,7 @@ digraph toLocalVariables_kt {
26 [label="Variable declaration: lval zCopy: R|() -> kotlin/Unit|"];
27 [label="Access variable R|<local>/z|"];
28 [label="Assignment: R|<local>/zCopy|"];
29 [label="Function call: R|<local>/zCopy|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
29 [label="Function call: R|<local>/zCopy|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
30 [label="Exit block"];
}
31 [label="Exit function foo" style="filled" fillcolor=red];
@@ -9,7 +9,7 @@ digraph atLeastOnce_kt {
subgraph cluster_1 {
color=blue
1 [label="Enter block"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
3 [label="Exit block"];
}
4 [label="Exit function inlineRun" style="filled" fillcolor=red];
@@ -25,7 +25,7 @@ digraph atLeastOnce_kt {
subgraph cluster_3 {
color=blue
6 [label="Enter block"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
8 [label="Exit block"];
}
9 [label="Exit function myRun" style="filled" fillcolor=red];
@@ -45,94 +45,90 @@ digraph atLeastOnce_kt {
13 [label="Postponed enter to lambda"];
subgraph cluster_6 {
color=blue
21 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
20 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_7 {
color=blue
22 [label="Enter block"];
23 [label="Const: Int(1)"];
24 [label="Assignment: R|<local>/x|"];
25 [label="Exit block"];
21 [label="Enter block"];
22 [label="Const: Int(1)"];
23 [label="Assignment: R|<local>/x|"];
24 [label="Exit block"];
}
26 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
25 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
14 [label="Call arguments union" style="filled" fillcolor=yellow];
15 [label="Postponed exit from lambda"];
16 [label="Function call: R|/inlineRun|(...)"];
17 [label="Access variable R|<local>/x|"];
18 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
19 [label="Exit block"];
14 [label="Postponed exit from lambda"];
15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow];
16 [label="Access variable R|<local>/x|"];
17 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
18 [label="Exit block"];
}
20 [label="Exit function test_1" style="filled" fillcolor=red];
19 [label="Exit function test_1" style="filled" fillcolor=red];
}
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {21};
13 -> {15} [color=red];
13 -> {21} [style=dashed];
14 -> {16} [color=red];
15 -> {16} [color=green];
13 -> {20};
13 -> {14} [color=red];
13 -> {20} [style=dashed];
14 -> {15};
14 -> {13} [color=green style=dashed];
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {14} [color=red];
26 -> {15} [color=green];
26 -> {21} [color=green style=dashed];
25 -> {15} [color=red];
25 -> {14} [color=green];
subgraph cluster_8 {
color=red
27 [label="Enter function test_2" style="filled" fillcolor=red];
26 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_9 {
color=blue
28 [label="Enter block"];
29 [label="Variable declaration: lval x: R|kotlin/Int|"];
30 [label="Postponed enter to lambda"];
27 [label="Enter block"];
28 [label="Variable declaration: lval x: R|kotlin/Int|"];
29 [label="Postponed enter to lambda"];
subgraph cluster_10 {
color=blue
38 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
36 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_11 {
color=blue
39 [label="Enter block"];
40 [label="Const: Int(1)"];
41 [label="Assignment: R|<local>/x|"];
42 [label="Exit block"];
37 [label="Enter block"];
38 [label="Const: Int(1)"];
39 [label="Assignment: R|<local>/x|"];
40 [label="Exit block"];
}
43 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
41 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
31 [label="Call arguments union" style="filled" fillcolor=yellow];
32 [label="Postponed exit from lambda"];
33 [label="Function call: R|/myRun|(...)"];
34 [label="Access variable R|<local>/x|"];
35 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
36 [label="Exit block"];
30 [label="Postponed exit from lambda"];
31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow];
32 [label="Access variable R|<local>/x|"];
33 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
34 [label="Exit block"];
}
37 [label="Exit function test_2" style="filled" fillcolor=red];
35 [label="Exit function test_2" style="filled" fillcolor=red];
}
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {38};
30 -> {32} [color=red];
30 -> {38} [style=dashed];
31 -> {33} [color=red];
32 -> {33} [color=green];
29 -> {36};
29 -> {30} [color=red];
29 -> {36} [style=dashed];
30 -> {31};
30 -> {29} [color=green style=dashed];
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {31} [color=red];
43 -> {32} [color=green];
43 -> {38} [color=green style=dashed];
41 -> {31} [color=red];
41 -> {30} [color=green];
}
@@ -9,7 +9,7 @@ digraph atMostOnce_kt {
subgraph cluster_1 {
color=blue
1 [label="Enter block"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
3 [label="Exit block"];
}
4 [label="Exit function inlineRun" style="filled" fillcolor=red];
@@ -25,7 +25,7 @@ digraph atMostOnce_kt {
subgraph cluster_3 {
color=blue
6 [label="Enter block"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
8 [label="Exit block"];
}
9 [label="Exit function myRun" style="filled" fillcolor=red];
@@ -56,9 +56,9 @@ digraph atMostOnce_kt {
25 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
14 [label="Postponed exit from lambda"];
15 [label="Function call: R|/inlineRun|(...)"];
15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow];
16 [label="Access variable R|<local>/x|"];
17 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
17 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
18 [label="Exit block"];
}
19 [label="Exit function test_1" style="filled" fillcolor=red];
@@ -73,7 +73,7 @@ digraph atMostOnce_kt {
16 -> {17};
17 -> {18};
18 -> {19};
20 -> {25 21};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
@@ -101,9 +101,9 @@ digraph atMostOnce_kt {
41 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
30 [label="Postponed exit from lambda"];
31 [label="Function call: R|/myRun|(...)"];
31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow];
32 [label="Access variable R|<local>/x|"];
33 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
33 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
34 [label="Exit block"];
}
35 [label="Exit function test_2" style="filled" fillcolor=red];
@@ -118,7 +118,7 @@ digraph atMostOnce_kt {
32 -> {33};
33 -> {34};
34 -> {35};
36 -> {41 37};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
@@ -10,7 +10,7 @@ digraph contractsUsage_kt {
color=blue
1 [label="Enter block"];
2 [label="Access variable R|<local>/x|"];
3 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
3 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
4 [label="Exit block"];
}
5 [label="Exit function bar" style="filled" fillcolor=red];
@@ -42,7 +42,7 @@ digraph contractsUsage_kt {
color=blue
14 [label="Enter block"];
15 [label="Access variable this@R|/baz|"];
16 [label="Function call: this@R|/baz|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
16 [label="Function call: this@R|/baz|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
17 [label="Exit block"];
}
18 [label="Exit when branch result"];
@@ -89,9 +89,9 @@ digraph contractsUsage_kt {
color=blue
30 [label="Enter block"];
31 [label="Access variable R|<local>/x|"];
32 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
32 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
33 [label="Access variable R|<local>/y|"];
34 [label="Function call: R|<local>/y|.R|/baz|()"];
34 [label="Function call: R|<local>/y|.R|/baz|()" style="filled" fillcolor=yellow];
35 [label="Jump: ^foo Unit"];
36 [label="Stub" style="filled" fillcolor=gray];
37 [label="Exit block" style="filled" fillcolor=gray];
@@ -100,7 +100,7 @@ digraph contractsUsage_kt {
39 [label="Exit when"];
}
40 [label="Access variable R|<local>/x|"];
41 [label="Function call: R|/bar|(...)"];
41 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow];
42 [label="Exit block"];
}
43 [label="Exit function foo" style="filled" fillcolor=red];
@@ -9,7 +9,7 @@ digraph exactlyOnce_kt {
subgraph cluster_1 {
color=blue
1 [label="Enter block"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
3 [label="Exit block"];
}
4 [label="Exit function inlineRun" style="filled" fillcolor=red];
@@ -25,7 +25,7 @@ digraph exactlyOnce_kt {
subgraph cluster_3 {
color=blue
6 [label="Enter block"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
8 [label="Exit block"];
}
9 [label="Exit function myRun" style="filled" fillcolor=red];
@@ -45,92 +45,88 @@ digraph exactlyOnce_kt {
13 [label="Postponed enter to lambda"];
subgraph cluster_6 {
color=blue
21 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
20 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_7 {
color=blue
22 [label="Enter block"];
23 [label="Const: Int(1)"];
24 [label="Assignment: R|<local>/x|"];
25 [label="Exit block"];
21 [label="Enter block"];
22 [label="Const: Int(1)"];
23 [label="Assignment: R|<local>/x|"];
24 [label="Exit block"];
}
26 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
25 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
14 [label="Call arguments union" style="filled" fillcolor=yellow];
15 [label="Postponed exit from lambda"];
16 [label="Function call: R|/inlineRun|(...)"];
17 [label="Access variable R|<local>/x|"];
18 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
19 [label="Exit block"];
14 [label="Postponed exit from lambda"];
15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow];
16 [label="Access variable R|<local>/x|"];
17 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
18 [label="Exit block"];
}
20 [label="Exit function test_1" style="filled" fillcolor=red];
19 [label="Exit function test_1" style="filled" fillcolor=red];
}
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {21};
13 -> {15} [color=red];
13 -> {21} [style=dashed];
14 -> {16} [color=red];
15 -> {16} [color=green];
13 -> {20};
13 -> {14} [color=red];
13 -> {20} [style=dashed];
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {14} [color=red];
26 -> {15} [color=green];
25 -> {15} [color=red];
25 -> {14} [color=green];
subgraph cluster_8 {
color=red
27 [label="Enter function test_2" style="filled" fillcolor=red];
26 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_9 {
color=blue
28 [label="Enter block"];
29 [label="Variable declaration: lval x: R|kotlin/Int|"];
30 [label="Postponed enter to lambda"];
27 [label="Enter block"];
28 [label="Variable declaration: lval x: R|kotlin/Int|"];
29 [label="Postponed enter to lambda"];
subgraph cluster_10 {
color=blue
38 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
36 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_11 {
color=blue
39 [label="Enter block"];
40 [label="Const: Int(1)"];
41 [label="Assignment: R|<local>/x|"];
42 [label="Exit block"];
37 [label="Enter block"];
38 [label="Const: Int(1)"];
39 [label="Assignment: R|<local>/x|"];
40 [label="Exit block"];
}
43 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
41 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
31 [label="Call arguments union" style="filled" fillcolor=yellow];
32 [label="Postponed exit from lambda"];
33 [label="Function call: R|/myRun|(...)"];
34 [label="Access variable R|<local>/x|"];
35 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
36 [label="Exit block"];
30 [label="Postponed exit from lambda"];
31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow];
32 [label="Access variable R|<local>/x|"];
33 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
34 [label="Exit block"];
}
37 [label="Exit function test_2" style="filled" fillcolor=red];
35 [label="Exit function test_2" style="filled" fillcolor=red];
}
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {38};
30 -> {32} [color=red];
30 -> {38} [style=dashed];
31 -> {33} [color=red];
32 -> {33} [color=green];
29 -> {36};
29 -> {30} [color=red];
29 -> {36} [style=dashed];
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {31} [color=red];
43 -> {32} [color=green];
41 -> {31} [color=red];
41 -> {30} [color=green];
}
@@ -24,7 +24,7 @@ digraph flow_kt {
color=blue
8 [label="Enter block"];
9 [label="Access variable R|<local>/x|"];
10 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
10 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
11 [label="Jump: ^bar Unit"];
12 [label="Stub" style="filled" fillcolor=gray];
13 [label="Exit block" style="filled" fillcolor=gray];
@@ -33,7 +33,7 @@ digraph flow_kt {
15 [label="Exit when"];
}
16 [label="Access variable R|<local>/x|"];
17 [label="Function call: R|/bar|(...)"];
17 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow];
18 [label="Exit block"];
}
19 [label="Exit function bar" style="filled" fillcolor=red];
@@ -102,9 +102,9 @@ digraph flow_kt {
color=blue
37 [label="Enter block"];
38 [label="Access variable R|<local>/y|"];
39 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
39 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
40 [label="Access variable R|<local>/z|"];
41 [label="Function call: R|<local>/z|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
41 [label="Function call: R|<local>/z|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
42 [label="Jump: ^foo Unit"];
43 [label="Stub" style="filled" fillcolor=gray];
44 [label="Exit block" style="filled" fillcolor=gray];
@@ -115,7 +115,7 @@ digraph flow_kt {
color=blue
47 [label="Enter block"];
48 [label="Access variable R|<local>/y|"];
49 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
49 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
50 [label="Exit block"];
}
51 [label="Exit when branch result"];
@@ -133,8 +133,8 @@ digraph flow_kt {
57 [label="Enter block"];
58 [label="Const: Int(0)"];
59 [label="Const: Int(0)"];
60 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)"];
61 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()"];
60 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)" style="filled" fillcolor=yellow];
61 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()" style="filled" fillcolor=yellow];
62 [label="Variable declaration: lval <iterator>: R|kotlin/collections/IntIterator|"];
subgraph cluster_18 {
color=blue
@@ -143,7 +143,7 @@ digraph flow_kt {
color=blue
64 [label="Enter loop condition"];
65 [label="Access variable R|<local>/<iterator>|"];
66 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/IntIterator.hasNext: R|kotlin/Boolean|>|()"];
66 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/IntIterator.hasNext: R|kotlin/Boolean|>|()" style="filled" fillcolor=yellow];
67 [label="Exit loop condition"];
}
subgraph cluster_20 {
@@ -153,10 +153,10 @@ digraph flow_kt {
color=blue
69 [label="Enter block"];
70 [label="Access variable R|<local>/<iterator>|"];
71 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()"];
71 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()" style="filled" fillcolor=yellow];
72 [label="Variable declaration: lval i: R|kotlin/Int|"];
73 [label="Access variable R|<local>/x|"];
74 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
74 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
75 [label="Exit block"];
}
76 [label="Exit loop block"];
@@ -166,7 +166,7 @@ digraph flow_kt {
78 [label="Exit block"];
}
79 [label="Access variable R|<local>/y|"];
80 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
80 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
81 [label="Exit block"];
}
82 [label="Exit when branch result"];
@@ -182,7 +182,7 @@ digraph flow_kt {
color=blue
86 [label="Enter block"];
87 [label="Access variable R|<local>/z|"];
88 [label="Function call: R|/bar|(...)"];
88 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow];
89 [label="Exit block"];
}
90 [label="Exit loop block"];
@@ -23,7 +23,7 @@ digraph inPlaceLambda_kt {
subgraph cluster_4 {
color=blue
8 [label="Enter block"];
9 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
9 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
10 [label="Exit block"];
}
11 [label="Exit when branch result"];
@@ -54,7 +54,7 @@ digraph inPlaceLambda_kt {
subgraph cluster_6 {
color=blue
16 [label="Enter block"];
17 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
17 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
18 [label="Postponed enter to lambda"];
subgraph cluster_7 {
color=blue
@@ -62,13 +62,13 @@ digraph inPlaceLambda_kt {
subgraph cluster_8 {
color=blue
24 [label="Enter block"];
25 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
25 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
26 [label="Exit block"];
}
27 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
19 [label="Postponed exit from lambda"];
20 [label="Function call: R|/bar|(...)"];
20 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow];
21 [label="Exit block"];
}
22 [label="Exit function foo" style="filled" fillcolor=red];
@@ -81,7 +81,7 @@ digraph inPlaceLambda_kt {
19 -> {20};
20 -> {21};
21 -> {22};
23 -> {27 24};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
@@ -10,7 +10,7 @@ digraph simple_kt {
color=blue
1 [label="Enter block"];
2 [label="Access variable R|<local>/x|"];
3 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
3 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
4 [label="Exit block"];
}
5 [label="Exit function bar" style="filled" fillcolor=red];
@@ -28,7 +28,7 @@ digraph simple_kt {
color=blue
7 [label="Enter block"];
8 [label="Access variable R|<local>/x|"];
9 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
9 [label="Function call: R|<local>/x|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
subgraph cluster_4 {
color=blue
10 [label="Enter when"];
@@ -43,14 +43,14 @@ digraph simple_kt {
subgraph cluster_6 {
color=blue
16 [label="Enter block"];
17 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
17 [label="Function call: R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
18 [label="Exit block"];
}
19 [label="Exit when branch result"];
20 [label="Exit when"];
}
21 [label="Access variable R|<local>/z|"];
22 [label="Function call: R|/bar|(...)"];
22 [label="Function call: R|/bar|(...)" style="filled" fillcolor=yellow];
23 [label="Exit block"];
}
24 [label="Exit function foo" style="filled" fillcolor=red];
@@ -9,7 +9,7 @@ digraph unknown_kt {
subgraph cluster_1 {
color=blue
1 [label="Enter block"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
2 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
3 [label="Exit block"];
}
4 [label="Exit function inlineRun" style="filled" fillcolor=red];
@@ -25,7 +25,7 @@ digraph unknown_kt {
subgraph cluster_3 {
color=blue
6 [label="Enter block"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
7 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
8 [label="Exit block"];
}
9 [label="Exit function myRun" style="filled" fillcolor=red];
@@ -56,9 +56,9 @@ digraph unknown_kt {
25 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
14 [label="Postponed exit from lambda"];
15 [label="Function call: R|/inlineRun|(...)"];
15 [label="Function call: R|/inlineRun|(...)" style="filled" fillcolor=yellow];
16 [label="Access variable R|<local>/x|"];
17 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
17 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
18 [label="Exit block"];
}
19 [label="Exit function test_1" style="filled" fillcolor=red];
@@ -69,17 +69,17 @@ digraph unknown_kt {
13 -> {14 20};
13 -> {20} [style=dashed];
14 -> {15};
14 -> {13} [color=green style=dashed];
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19};
20 -> {25 21};
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {14};
25 -> {20} [color=green style=dashed];
subgraph cluster_8 {
color=red
@@ -102,9 +102,9 @@ digraph unknown_kt {
41 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
30 [label="Postponed exit from lambda"];
31 [label="Function call: R|/myRun|(...)"];
31 [label="Function call: R|/myRun|(...)" style="filled" fillcolor=yellow];
32 [label="Access variable R|<local>/x|"];
33 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
33 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
34 [label="Exit block"];
}
35 [label="Exit function test_2" style="filled" fillcolor=red];
@@ -115,16 +115,16 @@ digraph unknown_kt {
29 -> {30 36};
29 -> {36} [style=dashed];
30 -> {31};
30 -> {29} [color=green style=dashed];
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
36 -> {41 37};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {30};
41 -> {36} [color=green style=dashed];
}