Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.dot
T
Brian Norman b55fda0c55 [FIR] Create CFG for files to track top-level property initialization
In order to properly analyze top-level property initialization, a
control-flow graph must be created for FirFiles. This change adds the
foundation for the file CFG and updates body resolve to create the CFG.
Checking the CFG for proper initialization is separated into a following
change to ease code review.

KT-56683
2023-08-31 12:50:52 +00:00

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