Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.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

172 lines
5.6 KiB
Plaintext
Vendored

digraph functionCallBound_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter file functionCallBound.kt" style="filled" fillcolor=red];
1 [label="Exit file functionCallBound.kt" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
subgraph cluster_1 {
color=red
2 [label="Enter class Base" style="filled" fillcolor=red];
subgraph cluster_2 {
color=blue
3 [label="Enter function <init>" style="filled" fillcolor=red];
4 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
5 [label="Exit function <init>" style="filled" fillcolor=red];
}
6 [label="Exit class Base" style="filled" fillcolor=red];
}
2 -> {3} [color=green];
2 -> {6} [style=dotted];
2 -> {3} [style=dashed];
3 -> {4};
4 -> {5};
5 -> {6} [color=green];
subgraph cluster_3 {
color=red
7 [label="Enter class Sub" style="filled" fillcolor=red];
subgraph cluster_4 {
color=blue
8 [label="Enter property" style="filled" fillcolor=red];
9 [label="Access variable R|<local>/data|"];
10 [label="Exit property" style="filled" fillcolor=red];
}
subgraph cluster_5 {
color=blue
11 [label="Enter function <init>" style="filled" fillcolor=red];
12 [label="Delegated constructor call: super<R|Base|>()" style="filled" fillcolor=yellow];
13 [label="Exit function <init>" style="filled" fillcolor=red];
}
14 [label="Exit class Sub" style="filled" fillcolor=red];
}
7 -> {8} [color=green];
7 -> {14} [style=dotted];
7 -> {8 11} [style=dashed];
8 -> {9};
9 -> {10};
10 -> {11} [color=green];
11 -> {12};
12 -> {13};
13 -> {14} [color=green];
subgraph cluster_6 {
color=red
15 [label="Enter function isOk" style="filled" fillcolor=red];
subgraph cluster_7 {
color=blue
16 [label="Enter block"];
17 [label="Const: Boolean(true)"];
18 [label="Jump: ^isOk Boolean(true)"];
19 [label="Stub" style="filled" fillcolor=gray];
20 [label="Exit block" style="filled" fillcolor=gray];
}
21 [label="Exit function isOk" style="filled" fillcolor=red];
}
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {21};
18 -> {19} [style=dotted];
19 -> {20} [style=dotted];
20 -> {21} [style=dotted];
subgraph cluster_8 {
color=red
22 [label="Enter function check" style="filled" fillcolor=red];
subgraph cluster_9 {
color=blue
23 [label="Enter block"];
subgraph cluster_10 {
color=blue
24 [label="Enter when"];
subgraph cluster_11 {
color=blue
25 [label="Enter when branch condition "];
26 [label="Access variable R|<local>/base|"];
27 [label="Type operator: (R|<local>/base| as? R|Sub|)"];
28 [label="Enter safe call"];
29 [label="Function call: $subj$.R|/isOk|()" style="filled" fillcolor=yellow];
30 [label="Exit safe call"];
31 [label="Const: Boolean(true)"];
32 [label="Equality operator =="];
33 [label="Exit when branch condition"];
}
subgraph cluster_12 {
color=blue
34 [label="Enter when branch condition else"];
35 [label="Exit when branch condition"];
}
36 [label="Enter when branch result"];
subgraph cluster_13 {
color=blue
37 [label="Enter block"];
38 [label="Access variable R|<local>/base|"];
39 [label="Exit block"];
}
40 [label="Exit when branch result"];
41 [label="Enter when branch result"];
subgraph cluster_14 {
color=blue
42 [label="Enter block"];
43 [label="Access variable R|<local>/base|"];
44 [label="Smart cast: R|<local>/base|"];
45 [label="Access variable R|/Sub.data|"];
46 [label="Exit block"];
}
47 [label="Exit when branch result"];
48 [label="Exit when"];
}
49 [label="Jump: ^check when () {
==((R|<local>/base| as? R|Sub|)?.{ $subj$.R|/isOk|() }, Boolean(true)) -> {
R|<local>/base|.R|/Sub.data|
}
else -> {
R|<local>/base|
}
}
"];
50 [label="Stub" style="filled" fillcolor=gray];
51 [label="Exit block" style="filled" fillcolor=gray];
}
52 [label="Exit function check" style="filled" fillcolor=red];
}
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28 30};
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34 41};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {48};
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {52};
49 -> {50} [style=dotted];
50 -> {51} [style=dotted];
51 -> {52} [style=dotted];
}