Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.dot
T
pyos c4c05f5248 FIR CFG: remove ordering from control flow through in-place lambdas
Old graph:

  arg -> lambda enter -> ... -> lambda exit -> lambda enter -> ... ->
   -> lambda exit -> call

New graph:

  arg -+-> lambda enter -> ... -> lambda exit -+-> call
       \-> lambda enter -> ... -> lambda exit -/
2022-12-08 10:19:31 +00:00

292 lines
10 KiB
Plaintext
Vendored

digraph lambdas_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter function run" style="filled" fillcolor=red];
subgraph cluster_1 {
color=blue
1 [label="Enter block"];
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 run" style="filled" fillcolor=red];
}
0 -> {1};
1 -> {2};
2 -> {3};
3 -> {4};
subgraph cluster_2 {
color=red
5 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_3 {
color=blue
6 [label="Enter block"];
subgraph cluster_4 {
color=blue
7 [label="Enter when"];
subgraph cluster_5 {
color=blue
8 [label="Enter when branch condition "];
9 [label="Access variable R|<local>/x|"];
10 [label="Type operator: (R|<local>/x| is R|kotlin/Int|)"];
11 [label="Exit when branch condition"];
}
12 [label="Synthetic else branch"];
13 [label="Enter when branch result"];
subgraph cluster_6 {
color=blue
14 [label="Enter block"];
15 [label="Postponed enter to lambda"];
subgraph cluster_7 {
color=blue
23 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
24 [label="Enter block"];
25 [label="Access variable R|<local>/x|"];
26 [label="Smart cast: R|<local>/x|"];
27 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
28 [label="Exit block"];
}
29 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
16 [label="Postponed exit from lambda"];
17 [label="Function call: R|/run|(...)" style="filled" fillcolor=yellow];
18 [label="Exit block"];
}
19 [label="Exit when branch result"];
20 [label="Exit when"];
}
21 [label="Exit block"];
}
22 [label="Exit function test_1" style="filled" fillcolor=red];
}
5 -> {6};
6 -> {7};
7 -> {8};
8 -> {9};
9 -> {10};
10 -> {11};
11 -> {13 12};
12 -> {20};
13 -> {14};
14 -> {15};
15 -> {16 23 17};
15 -> {23} [style=dashed];
16 -> {17};
16 -> {15} [color=green style=dashed];
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {21};
21 -> {22};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {16};
subgraph cluster_9 {
color=red
30 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
31 [label="Enter block"];
subgraph cluster_11 {
color=blue
32 [label="Enter when"];
subgraph cluster_12 {
color=blue
33 [label="Enter when branch condition "];
34 [label="Access variable R|<local>/x|"];
35 [label="Type operator: (R|<local>/x| is R|kotlin/Int|)"];
36 [label="Exit when branch condition"];
}
37 [label="Synthetic else branch"];
38 [label="Enter when branch result"];
subgraph cluster_13 {
color=blue
39 [label="Enter block"];
40 [label="Local function declaration test_2"];
41 [label="Exit anonymous function expression"];
42 [label="Variable declaration: lval lambda: R|() -> kotlin/Int|"];
43 [label="Exit block"];
}
44 [label="Exit when branch result"];
45 [label="Exit when"];
}
46 [label="Exit block"];
}
47 [label="Exit function test_2" style="filled" fillcolor=red];
}
subgraph cluster_14 {
color=blue
48 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_15 {
color=blue
49 [label="Enter block"];
50 [label="Access variable R|<local>/x|"];
51 [label="Smart cast: R|<local>/x|"];
52 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
53 [label="Exit block"];
}
54 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {38 37};
37 -> {45};
38 -> {39};
39 -> {40};
40 -> {48 41};
40 -> {48} [style=dashed];
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
subgraph cluster_16 {
color=red
55 [label="Enter function getInt" style="filled" fillcolor=red];
subgraph cluster_17 {
color=blue
56 [label="Enter block"];
57 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
58 [label="Const: Int(1)"];
59 [label="Jump: ^getInt Int(1)"];
60 [label="Stub" style="filled" fillcolor=gray];
61 [label="Exit block" style="filled" fillcolor=gray];
}
62 [label="Exit function getInt" style="filled" fillcolor=red];
}
55 -> {56};
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {62};
59 -> {60} [style=dotted];
60 -> {61} [style=dotted];
61 -> {62} [style=dotted];
subgraph cluster_18 {
color=red
63 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_19 {
color=blue
64 [label="Enter block"];
65 [label="Postponed enter to lambda"];
subgraph cluster_20 {
color=blue
72 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_21 {
color=blue
73 [label="Enter block"];
74 [label="Const: Int(1)"];
75 [label="Jump: ^test_3 Int(1)"];
76 [label="Stub" style="filled" fillcolor=gray];
77 [label="Exit block" style="filled" fillcolor=gray];
}
78 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
66 [label="Postponed exit from lambda"];
67 [label="Function call: R|/getInt|(...)" style="filled" fillcolor=yellow];
68 [label="Jump: ^test_3 R|/getInt|(<L> = getInt@fun <anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
^test_3 Int(1)
}
)"];
69 [label="Stub" style="filled" fillcolor=gray];
70 [label="Exit block" style="filled" fillcolor=gray];
}
71 [label="Exit function test_3" style="filled" fillcolor=red];
}
63 -> {64};
64 -> {65};
65 -> {66 72 67};
65 -> {72} [style=dashed];
66 -> {67};
66 -> {65} [color=green style=dashed];
67 -> {68};
68 -> {71};
68 -> {69} [style=dotted];
69 -> {70} [style=dotted];
70 -> {71} [style=dotted];
72 -> {73};
73 -> {74};
74 -> {75};
75 -> {71};
75 -> {76} [style=dotted];
76 -> {77} [style=dotted];
77 -> {78} [style=dotted];
78 -> {66} [style=dotted];
subgraph cluster_22 {
color=red
79 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
80 [label="Enter block"];
81 [label="Postponed enter to lambda"];
subgraph cluster_24 {
color=blue
88 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_25 {
color=blue
89 [label="Enter block"];
90 [label="Const: Int(1)"];
91 [label="Jump: ^test_4 Int(1)"];
92 [label="Stub" style="filled" fillcolor=gray];
93 [label="Exit block" style="filled" fillcolor=gray];
}
94 [label="Exit function anonymousFunction" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
82 [label="Postponed exit from lambda"];
83 [label="Function call: R|/getInt|(...)" style="filled" fillcolor=yellow];
84 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun <anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
^test_4 Int(1)
}
)"];
85 [label="Stub" style="filled" fillcolor=gray];
86 [label="Exit block" style="filled" fillcolor=gray];
}
87 [label="Exit function test_4" style="filled" fillcolor=red];
}
79 -> {80};
80 -> {81};
81 -> {82 88 83};
81 -> {88} [style=dashed];
82 -> {83};
82 -> {81} [color=green style=dashed];
83 -> {84};
84 -> {87};
84 -> {85} [style=dotted];
85 -> {86} [style=dotted];
86 -> {87} [style=dotted];
88 -> {89};
89 -> {90};
90 -> {91};
91 -> {87};
91 -> {92} [style=dotted];
92 -> {93} [style=dotted];
93 -> {94} [style=dotted];
94 -> {82} [style=dotted];
}