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

787 lines
28 KiB
Plaintext
Vendored

digraph when_kt {
graph [nodesep=3]
node [shape=box penwidth=2]
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter file when.kt" style="filled" fillcolor=red];
1 [label="Exit file when.kt" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
subgraph cluster_1 {
color=red
2 [label="Enter class A" style="filled" fillcolor=red];
3 [label="Exit class A" style="filled" fillcolor=red];
}
2 -> {3} [color=green];
subgraph cluster_2 {
color=red
4 [label="Enter function foo" style="filled" fillcolor=red];
5 [label="Exit function foo" style="filled" fillcolor=red];
}
4 -> {5};
subgraph cluster_3 {
color=red
6 [label="Enter class B" style="filled" fillcolor=red];
7 [label="Exit class B" style="filled" fillcolor=red];
}
6 -> {7} [color=green];
subgraph cluster_4 {
color=red
8 [label="Enter function bar" style="filled" fillcolor=red];
9 [label="Exit function bar" style="filled" fillcolor=red];
}
8 -> {9};
subgraph cluster_5 {
color=red
10 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
11 [label="Enter block"];
subgraph cluster_7 {
color=blue
12 [label="Enter when"];
subgraph cluster_8 {
color=blue
13 [label="Enter when branch condition "];
14 [label="Access variable R|<local>/x|"];
15 [label="Type operator: (R|<local>/x| is R|A|)"];
16 [label="Exit when branch condition"];
}
subgraph cluster_9 {
color=blue
17 [label="Enter when branch condition "];
18 [label="Access variable R|<local>/x|"];
19 [label="Type operator: (R|<local>/x| is R|B|)"];
20 [label="Exit when branch condition"];
}
21 [label="Synthetic else branch"];
22 [label="Enter when branch result"];
subgraph cluster_10 {
color=blue
23 [label="Enter block"];
24 [label="Access variable R|<local>/x|"];
25 [label="Smart cast: R|<local>/x|"];
26 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
27 [label="Exit block"];
}
28 [label="Exit when branch result"];
29 [label="Enter when branch result"];
subgraph cluster_11 {
color=blue
30 [label="Enter block"];
31 [label="Access variable R|<local>/x|"];
32 [label="Smart cast: R|<local>/x|"];
33 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
34 [label="Exit block"];
}
35 [label="Exit when branch result"];
36 [label="Exit when"];
}
subgraph cluster_12 {
color=blue
37 [label="Enter when"];
subgraph cluster_13 {
color=blue
38 [label="Enter when branch condition "];
39 [label="Access variable R|<local>/x|"];
40 [label="Type operator: (R|<local>/x| !is R|A|)"];
41 [label="Exit when branch condition"];
}
subgraph cluster_14 {
color=blue
42 [label="Enter when branch condition "];
43 [label="Access variable R|<local>/x|"];
44 [label="Smart cast: R|<local>/x|"];
45 [label="Type operator: (R|<local>/x| !is R|B|)"];
46 [label="Exit when branch condition"];
}
subgraph cluster_15 {
color=blue
47 [label="Enter when branch condition "];
48 [label="Access variable R|<local>/x|"];
49 [label="Smart cast: R|<local>/x|"];
50 [label="Type operator: (R|<local>/x| is R|kotlin/Int|)"];
51 [label="Exit when branch condition"];
}
subgraph cluster_16 {
color=blue
52 [label="Enter when branch condition else"];
53 [label="Exit when branch condition"];
}
54 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
55 [label="Enter block"];
56 [label="Access variable R|<local>/x|"];
57 [label="Smart cast: R|<local>/x|"];
58 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
59 [label="Access variable R|<local>/x|"];
60 [label="Smart cast: R|<local>/x|"];
61 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
62 [label="Exit block"];
}
63 [label="Exit when branch result"];
64 [label="Enter when branch result"];
subgraph cluster_18 {
color=blue
65 [label="Enter block"];
66 [label="Access variable R|<local>/x|"];
67 [label="Smart cast: R|<local>/x|"];
68 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
69 [label="Access variable R|<local>/x|"];
70 [label="Smart cast: R|<local>/x|"];
71 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
72 [label="Access variable R|<local>/x|"];
73 [label="Smart cast: R|<local>/x|"];
74 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
75 [label="Exit block"];
}
76 [label="Exit when branch result"];
77 [label="Enter when branch result"];
subgraph cluster_19 {
color=blue
78 [label="Enter block"];
79 [label="Access variable R|<local>/x|"];
80 [label="Smart cast: R|<local>/x|"];
81 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
82 [label="Exit block"];
}
83 [label="Exit when branch result"];
84 [label="Enter when branch result"];
subgraph cluster_20 {
color=blue
85 [label="Enter block"];
86 [label="Exit block"];
}
87 [label="Exit when branch result"];
88 [label="Exit when"];
}
89 [label="Exit block"];
}
90 [label="Exit function test_1" style="filled" fillcolor=red];
}
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {17 29};
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {21 22};
21 -> {36};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {36};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42 84};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47 77};
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52 64};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {88};
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {68};
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {73};
73 -> {74};
74 -> {75};
75 -> {76};
76 -> {88};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
83 -> {88};
84 -> {85};
85 -> {86};
86 -> {87};
87 -> {88};
88 -> {89};
89 -> {90};
subgraph cluster_21 {
color=red
91 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_22 {
color=blue
92 [label="Enter block"];
subgraph cluster_23 {
color=blue
93 [label="Enter when"];
94 [label="Access variable R|<local>/x|"];
subgraph cluster_24 {
color=blue
95 [label="Enter when branch condition "];
96 [label="Exit $subj"];
97 [label="Type operator: ($subj$ is R|A|)"];
98 [label="Exit when branch condition"];
}
subgraph cluster_25 {
color=blue
99 [label="Enter when branch condition "];
100 [label="Exit $subj"];
101 [label="Type operator: ($subj$ is R|B|)"];
102 [label="Exit when branch condition"];
}
103 [label="Synthetic else branch"];
104 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
105 [label="Enter block"];
106 [label="Access variable R|<local>/x|"];
107 [label="Smart cast: R|<local>/x|"];
108 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
109 [label="Exit block"];
}
110 [label="Exit when branch result"];
111 [label="Enter when branch result"];
subgraph cluster_27 {
color=blue
112 [label="Enter block"];
113 [label="Access variable R|<local>/x|"];
114 [label="Smart cast: R|<local>/x|"];
115 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
116 [label="Exit block"];
}
117 [label="Exit when branch result"];
118 [label="Exit when"];
}
subgraph cluster_28 {
color=blue
119 [label="Enter when"];
120 [label="Access variable R|<local>/x|"];
subgraph cluster_29 {
color=blue
121 [label="Enter when branch condition "];
122 [label="Exit $subj"];
123 [label="Type operator: ($subj$ !is R|A|)"];
124 [label="Exit when branch condition"];
}
subgraph cluster_30 {
color=blue
125 [label="Enter when branch condition "];
126 [label="Exit $subj"];
127 [label="Type operator: ($subj$ !is R|B|)"];
128 [label="Exit when branch condition"];
}
subgraph cluster_31 {
color=blue
129 [label="Enter when branch condition "];
130 [label="Exit $subj"];
131 [label="Type operator: ($subj$ is R|kotlin/Int|)"];
132 [label="Exit when branch condition"];
}
subgraph cluster_32 {
color=blue
133 [label="Enter when branch condition else"];
134 [label="Exit when branch condition"];
}
135 [label="Enter when branch result"];
subgraph cluster_33 {
color=blue
136 [label="Enter block"];
137 [label="Access variable R|<local>/x|"];
138 [label="Smart cast: R|<local>/x|"];
139 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
140 [label="Access variable R|<local>/x|"];
141 [label="Smart cast: R|<local>/x|"];
142 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
143 [label="Exit block"];
}
144 [label="Exit when branch result"];
145 [label="Enter when branch result"];
subgraph cluster_34 {
color=blue
146 [label="Enter block"];
147 [label="Access variable R|<local>/x|"];
148 [label="Smart cast: R|<local>/x|"];
149 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
150 [label="Access variable R|<local>/x|"];
151 [label="Smart cast: R|<local>/x|"];
152 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
153 [label="Access variable R|<local>/x|"];
154 [label="Smart cast: R|<local>/x|"];
155 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
156 [label="Exit block"];
}
157 [label="Exit when branch result"];
158 [label="Enter when branch result"];
subgraph cluster_35 {
color=blue
159 [label="Enter block"];
160 [label="Access variable R|<local>/x|"];
161 [label="Smart cast: R|<local>/x|"];
162 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
163 [label="Exit block"];
}
164 [label="Exit when branch result"];
165 [label="Enter when branch result"];
subgraph cluster_36 {
color=blue
166 [label="Enter block"];
167 [label="Exit block"];
}
168 [label="Exit when branch result"];
169 [label="Exit when"];
}
170 [label="Exit block"];
}
171 [label="Exit function test_2" style="filled" fillcolor=red];
}
91 -> {92};
92 -> {93};
93 -> {94};
94 -> {95};
95 -> {96};
96 -> {97};
97 -> {98};
98 -> {99 111};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103 104};
103 -> {118};
104 -> {105};
105 -> {106};
106 -> {107};
107 -> {108};
108 -> {109};
109 -> {110};
110 -> {118};
111 -> {112};
112 -> {113};
113 -> {114};
114 -> {115};
115 -> {116};
116 -> {117};
117 -> {118};
118 -> {119};
119 -> {120};
120 -> {121};
121 -> {122};
122 -> {123};
123 -> {124};
124 -> {125 165};
125 -> {126};
126 -> {127};
127 -> {128};
128 -> {129 158};
129 -> {130};
130 -> {131};
131 -> {132};
132 -> {133 145};
133 -> {134};
134 -> {135};
135 -> {136};
136 -> {137};
137 -> {138};
138 -> {139};
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {144};
144 -> {169};
145 -> {146};
146 -> {147};
147 -> {148};
148 -> {149};
149 -> {150};
150 -> {151};
151 -> {152};
152 -> {153};
153 -> {154};
154 -> {155};
155 -> {156};
156 -> {157};
157 -> {169};
158 -> {159};
159 -> {160};
160 -> {161};
161 -> {162};
162 -> {163};
163 -> {164};
164 -> {169};
165 -> {166};
166 -> {167};
167 -> {168};
168 -> {169};
169 -> {170};
170 -> {171};
subgraph cluster_37 {
color=red
172 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_38 {
color=blue
173 [label="Enter block"];
subgraph cluster_39 {
color=blue
174 [label="Enter when"];
175 [label="Access variable R|<local>/x|"];
176 [label="Variable declaration: lval y: R|kotlin/Any?|"];
subgraph cluster_40 {
color=blue
177 [label="Enter when branch condition "];
178 [label="Exit $subj"];
179 [label="Type operator: ($subj$ is R|A|)"];
180 [label="Exit when branch condition"];
}
subgraph cluster_41 {
color=blue
181 [label="Enter when branch condition "];
182 [label="Exit $subj"];
183 [label="Type operator: ($subj$ is R|B|)"];
184 [label="Exit when branch condition"];
}
185 [label="Synthetic else branch"];
186 [label="Enter when branch result"];
subgraph cluster_42 {
color=blue
187 [label="Enter block"];
188 [label="Access variable R|<local>/x|"];
189 [label="Smart cast: R|<local>/x|"];
190 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
191 [label="Access variable R|<local>/y|"];
192 [label="Smart cast: R|<local>/y|"];
193 [label="Function call: R|<local>/y|.R|/B.bar|()" style="filled" fillcolor=yellow];
194 [label="Exit block"];
}
195 [label="Exit when branch result"];
196 [label="Enter when branch result"];
subgraph cluster_43 {
color=blue
197 [label="Enter block"];
198 [label="Access variable R|<local>/x|"];
199 [label="Smart cast: R|<local>/x|"];
200 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
201 [label="Access variable R|<local>/y|"];
202 [label="Smart cast: R|<local>/y|"];
203 [label="Function call: R|<local>/y|.R|/A.foo|()" style="filled" fillcolor=yellow];
204 [label="Exit block"];
}
205 [label="Exit when branch result"];
206 [label="Exit when"];
}
subgraph cluster_44 {
color=blue
207 [label="Enter when"];
208 [label="Access variable R|<local>/x|"];
209 [label="Variable declaration: lval y: R|kotlin/Any?|"];
subgraph cluster_45 {
color=blue
210 [label="Enter when branch condition "];
211 [label="Exit $subj"];
212 [label="Type operator: ($subj$ !is R|A|)"];
213 [label="Exit when branch condition"];
}
subgraph cluster_46 {
color=blue
214 [label="Enter when branch condition "];
215 [label="Exit $subj"];
216 [label="Type operator: ($subj$ !is R|B|)"];
217 [label="Exit when branch condition"];
}
subgraph cluster_47 {
color=blue
218 [label="Enter when branch condition "];
219 [label="Exit $subj"];
220 [label="Type operator: ($subj$ is R|kotlin/Int|)"];
221 [label="Exit when branch condition"];
}
subgraph cluster_48 {
color=blue
222 [label="Enter when branch condition else"];
223 [label="Exit when branch condition"];
}
224 [label="Enter when branch result"];
subgraph cluster_49 {
color=blue
225 [label="Enter block"];
226 [label="Access variable R|<local>/x|"];
227 [label="Smart cast: R|<local>/x|"];
228 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
229 [label="Access variable R|<local>/x|"];
230 [label="Smart cast: R|<local>/x|"];
231 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
232 [label="Access variable R|<local>/y|"];
233 [label="Smart cast: R|<local>/y|"];
234 [label="Function call: R|<local>/y|.R|/A.foo|()" style="filled" fillcolor=yellow];
235 [label="Access variable R|<local>/y|"];
236 [label="Smart cast: R|<local>/y|"];
237 [label="Function call: R|<local>/y|.R|/B.bar|()" style="filled" fillcolor=yellow];
238 [label="Exit block"];
}
239 [label="Exit when branch result"];
240 [label="Enter when branch result"];
subgraph cluster_50 {
color=blue
241 [label="Enter block"];
242 [label="Access variable R|<local>/x|"];
243 [label="Smart cast: R|<local>/x|"];
244 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
245 [label="Access variable R|<local>/x|"];
246 [label="Smart cast: R|<local>/x|"];
247 [label="Function call: R|<local>/x|.R|/B.bar|()" style="filled" fillcolor=yellow];
248 [label="Access variable R|<local>/x|"];
249 [label="Smart cast: R|<local>/x|"];
250 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
251 [label="Access variable R|<local>/y|"];
252 [label="Smart cast: R|<local>/y|"];
253 [label="Function call: R|<local>/y|.R|/A.foo|()" style="filled" fillcolor=yellow];
254 [label="Access variable R|<local>/y|"];
255 [label="Smart cast: R|<local>/y|"];
256 [label="Function call: R|<local>/y|.R|/B.bar|()" style="filled" fillcolor=yellow];
257 [label="Access variable R|<local>/y|"];
258 [label="Smart cast: R|<local>/y|"];
259 [label="Function call: R|<local>/y|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
260 [label="Exit block"];
}
261 [label="Exit when branch result"];
262 [label="Enter when branch result"];
subgraph cluster_51 {
color=blue
263 [label="Enter block"];
264 [label="Access variable R|<local>/x|"];
265 [label="Smart cast: R|<local>/x|"];
266 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
267 [label="Access variable R|<local>/y|"];
268 [label="Smart cast: R|<local>/y|"];
269 [label="Function call: R|<local>/y|.R|/A.foo|()" style="filled" fillcolor=yellow];
270 [label="Exit block"];
}
271 [label="Exit when branch result"];
272 [label="Enter when branch result"];
subgraph cluster_52 {
color=blue
273 [label="Enter block"];
274 [label="Exit block"];
}
275 [label="Exit when branch result"];
276 [label="Exit when"];
}
277 [label="Exit block"];
}
278 [label="Exit function test_3" style="filled" fillcolor=red];
}
172 -> {173};
173 -> {174};
174 -> {175};
175 -> {176};
176 -> {177};
177 -> {178};
178 -> {179};
179 -> {180};
180 -> {181 196};
181 -> {182};
182 -> {183};
183 -> {184};
184 -> {185 186};
185 -> {206};
186 -> {187};
187 -> {188};
188 -> {189};
189 -> {190};
190 -> {191};
191 -> {192};
192 -> {193};
193 -> {194};
194 -> {195};
195 -> {206};
196 -> {197};
197 -> {198};
198 -> {199};
199 -> {200};
200 -> {201};
201 -> {202};
202 -> {203};
203 -> {204};
204 -> {205};
205 -> {206};
206 -> {207};
207 -> {208};
208 -> {209};
209 -> {210};
210 -> {211};
211 -> {212};
212 -> {213};
213 -> {214 272};
214 -> {215};
215 -> {216};
216 -> {217};
217 -> {218 262};
218 -> {219};
219 -> {220};
220 -> {221};
221 -> {222 240};
222 -> {223};
223 -> {224};
224 -> {225};
225 -> {226};
226 -> {227};
227 -> {228};
228 -> {229};
229 -> {230};
230 -> {231};
231 -> {232};
232 -> {233};
233 -> {234};
234 -> {235};
235 -> {236};
236 -> {237};
237 -> {238};
238 -> {239};
239 -> {276};
240 -> {241};
241 -> {242};
242 -> {243};
243 -> {244};
244 -> {245};
245 -> {246};
246 -> {247};
247 -> {248};
248 -> {249};
249 -> {250};
250 -> {251};
251 -> {252};
252 -> {253};
253 -> {254};
254 -> {255};
255 -> {256};
256 -> {257};
257 -> {258};
258 -> {259};
259 -> {260};
260 -> {261};
261 -> {276};
262 -> {263};
263 -> {264};
264 -> {265};
265 -> {266};
266 -> {267};
267 -> {268};
268 -> {269};
269 -> {270};
270 -> {271};
271 -> {276};
272 -> {273};
273 -> {274};
274 -> {275};
275 -> {276};
276 -> {277};
277 -> {278};
subgraph cluster_53 {
color=red
279 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_54 {
color=blue
280 [label="Enter block"];
subgraph cluster_55 {
color=blue
281 [label="Enter when"];
282 [label="Access variable R|<local>/x|"];
283 [label="Type operator: (R|<local>/x| as R|kotlin/Int|)"];
subgraph cluster_56 {
color=blue
284 [label="Enter when branch condition "];
285 [label="Exit $subj"];
286 [label="Const: Int(1)"];
287 [label="Equality operator =="];
288 [label="Exit when branch condition"];
}
289 [label="Synthetic else branch"];
290 [label="Enter when branch result"];
subgraph cluster_57 {
color=blue
291 [label="Enter block"];
292 [label="Access variable R|<local>/x|"];
293 [label="Smart cast: R|<local>/x|"];
294 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
295 [label="Exit block"];
}
296 [label="Exit when branch result"];
297 [label="Exit when"];
}
298 [label="Access variable R|<local>/x|"];
299 [label="Smart cast: R|<local>/x|"];
300 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()" style="filled" fillcolor=yellow];
301 [label="Exit block"];
}
302 [label="Exit function test_4" style="filled" fillcolor=red];
}
279 -> {280};
280 -> {281};
281 -> {282};
282 -> {283};
283 -> {284};
284 -> {285};
285 -> {286};
286 -> {287};
287 -> {288};
288 -> {289 290};
289 -> {297};
290 -> {291};
291 -> {292};
292 -> {293};
293 -> {294};
294 -> {295};
295 -> {296};
296 -> {297};
297 -> {298};
298 -> {299};
299 -> {300};
300 -> {301};
301 -> {302};
}