FIR CFA: remove class initializer part nodes

Instead, attach subgraphs directly to the class enter node.
This commit is contained in:
pyos
2022-12-11 13:43:55 +01:00
committed by Dmitriy Novozhilov
parent b9f366af05
commit c6e9afb788
25 changed files with 3271 additions and 3385 deletions
@@ -339,86 +339,85 @@ digraph boundSmartcasts_kt {
subgraph cluster_27 {
color=red
125 [label="Enter class D" style="filled" fillcolor=red];
126 [label="Part of class initialization"];
subgraph cluster_28 {
color=blue
127 [label="Enter property" style="filled" fillcolor=red];
128 [label="Access variable R|<local>/any|"];
129 [label="Exit property" style="filled" fillcolor=red];
126 [label="Enter property" style="filled" fillcolor=red];
127 [label="Access variable R|<local>/any|"];
128 [label="Exit property" style="filled" fillcolor=red];
}
130 [label="Exit class D" style="filled" fillcolor=red];
129 [label="Exit class D" style="filled" fillcolor=red];
}
subgraph cluster_29 {
color=blue
131 [label="Enter function <init>" style="filled" fillcolor=red];
132 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
133 [label="Exit function <init>" style="filled" fillcolor=red];
130 [label="Enter function <init>" style="filled" fillcolor=red];
131 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
132 [label="Exit function <init>" style="filled" fillcolor=red];
}
125 -> {126} [color=green];
126 -> {127} [color=green];
126 -> {130} [style=dotted];
126 -> {127} [style=dashed];
125 -> {129} [style=dotted];
125 -> {126} [style=dashed];
126 -> {127};
127 -> {128};
128 -> {129};
128 -> {129} [color=green];
129 -> {130} [color=green];
130 -> {131} [color=green];
130 -> {131} [style=dashed];
129 -> {130} [style=dashed];
130 -> {131};
131 -> {132};
132 -> {133};
subgraph cluster_30 {
color=red
134 [label="Enter function baz" style="filled" fillcolor=red];
133 [label="Enter function baz" style="filled" fillcolor=red];
subgraph cluster_31 {
color=blue
135 [label="Enter block"];
136 [label="Exit block"];
134 [label="Enter block"];
135 [label="Exit block"];
}
137 [label="Exit function baz" style="filled" fillcolor=red];
136 [label="Exit function baz" style="filled" fillcolor=red];
}
133 -> {134};
134 -> {135};
135 -> {136};
136 -> {137};
subgraph cluster_32 {
color=red
138 [label="Enter function test_5" style="filled" fillcolor=red];
137 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_33 {
color=blue
139 [label="Enter block"];
140 [label="Access variable R|<local>/d|"];
141 [label="Access variable R|/D.any|"];
142 [label="Exit lhs of ?:"];
143 [label="Enter rhs of ?:"];
144 [label="Jump: ^test_5 Unit"];
145 [label="Stub" style="filled" fillcolor=gray];
146 [label="Lhs of ?: is not null"];
147 [label="Exit ?:"];
148 [label="Variable declaration: lval a: R|kotlin/Any|"];
149 [label="Access variable R|<local>/a|"];
150 [label="Function call: R|<local>/a|.R|/baz|()" style="filled" fillcolor=yellow];
151 [label="Access variable R|<local>/d|"];
152 [label="Access variable R|/D.any|"];
153 [label="Smart cast: R|<local>/d|.R|/D.any|"];
154 [label="Function call: R|<local>/d|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow];
155 [label="Access variable R|<local>/a|"];
156 [label="Type operator: (R|<local>/a| as R|A|)"];
157 [label="Access variable R|<local>/a|"];
158 [label="Smart cast: R|<local>/a|"];
159 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
160 [label="Exit block"];
138 [label="Enter block"];
139 [label="Access variable R|<local>/d|"];
140 [label="Access variable R|/D.any|"];
141 [label="Exit lhs of ?:"];
142 [label="Enter rhs of ?:"];
143 [label="Jump: ^test_5 Unit"];
144 [label="Stub" style="filled" fillcolor=gray];
145 [label="Lhs of ?: is not null"];
146 [label="Exit ?:"];
147 [label="Variable declaration: lval a: R|kotlin/Any|"];
148 [label="Access variable R|<local>/a|"];
149 [label="Function call: R|<local>/a|.R|/baz|()" style="filled" fillcolor=yellow];
150 [label="Access variable R|<local>/d|"];
151 [label="Access variable R|/D.any|"];
152 [label="Smart cast: R|<local>/d|.R|/D.any|"];
153 [label="Function call: R|<local>/d|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow];
154 [label="Access variable R|<local>/a|"];
155 [label="Type operator: (R|<local>/a| as R|A|)"];
156 [label="Access variable R|<local>/a|"];
157 [label="Smart cast: R|<local>/a|"];
158 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
159 [label="Exit block"];
}
161 [label="Exit function test_5" style="filled" fillcolor=red];
160 [label="Exit function test_5" style="filled" fillcolor=red];
}
137 -> {138};
138 -> {139};
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143 146};
143 -> {144};
144 -> {161};
144 -> {145} [style=dotted];
145 -> {147} [style=dotted];
141 -> {142 145};
142 -> {143};
143 -> {160};
143 -> {144} [style=dotted];
144 -> {146} [style=dotted];
145 -> {146};
146 -> {147};
147 -> {148};
148 -> {149};
@@ -433,34 +432,34 @@ digraph boundSmartcasts_kt {
157 -> {158};
158 -> {159};
159 -> {160};
160 -> {161};
subgraph cluster_34 {
color=red
162 [label="Enter function test_6" style="filled" fillcolor=red];
161 [label="Enter function test_6" style="filled" fillcolor=red];
subgraph cluster_35 {
color=blue
163 [label="Enter block"];
164 [label="Access variable R|<local>/d1|"];
165 [label="Access variable R|/D.any|"];
166 [label="Variable declaration: lval a: R|kotlin/Any?|"];
167 [label="Access variable R|<local>/a|"];
168 [label="Type operator: (R|<local>/a| as R|A|)"];
169 [label="Access variable R|<local>/a|"];
170 [label="Smart cast: R|<local>/a|"];
171 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
172 [label="Access variable R|<local>/d1|"];
173 [label="Access variable R|/D.any|"];
174 [label="Smart cast: R|<local>/d1|.R|/D.any|"];
175 [label="Function call: R|<local>/d1|.R|/D.any|.R|/A.foo|()" style="filled" fillcolor=yellow];
176 [label="Access variable R|<local>/d1|"];
177 [label="Access variable R|/D.any|"];
178 [label="Smart cast: R|<local>/d1|.R|/D.any|"];
179 [label="Function call: R|<local>/d1|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow];
180 [label="Exit block"];
162 [label="Enter block"];
163 [label="Access variable R|<local>/d1|"];
164 [label="Access variable R|/D.any|"];
165 [label="Variable declaration: lval a: R|kotlin/Any?|"];
166 [label="Access variable R|<local>/a|"];
167 [label="Type operator: (R|<local>/a| as R|A|)"];
168 [label="Access variable R|<local>/a|"];
169 [label="Smart cast: R|<local>/a|"];
170 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
171 [label="Access variable R|<local>/d1|"];
172 [label="Access variable R|/D.any|"];
173 [label="Smart cast: R|<local>/d1|.R|/D.any|"];
174 [label="Function call: R|<local>/d1|.R|/D.any|.R|/A.foo|()" style="filled" fillcolor=yellow];
175 [label="Access variable R|<local>/d1|"];
176 [label="Access variable R|/D.any|"];
177 [label="Smart cast: R|<local>/d1|.R|/D.any|"];
178 [label="Function call: R|<local>/d1|.R|/D.any|.R|/baz|()" style="filled" fillcolor=yellow];
179 [label="Exit block"];
}
181 [label="Exit function test_6" style="filled" fillcolor=red];
180 [label="Exit function test_6" style="filled" fillcolor=red];
}
161 -> {162};
162 -> {163};
163 -> {164};
164 -> {165};
@@ -479,46 +478,46 @@ digraph boundSmartcasts_kt {
177 -> {178};
178 -> {179};
179 -> {180};
180 -> {181};
subgraph cluster_36 {
color=red
182 [label="Enter function test_7" style="filled" fillcolor=red];
181 [label="Enter function test_7" style="filled" fillcolor=red];
subgraph cluster_37 {
color=blue
183 [label="Enter block"];
184 [label="Access variable R|<local>/d1|"];
185 [label="Enter safe call"];
186 [label="Access variable R|/D.any|"];
187 [label="Exit safe call"];
188 [label="Variable declaration: lval a: R|kotlin/Any?|"];
189 [label="Access variable R|<local>/d2|"];
190 [label="Enter safe call"];
191 [label="Access variable R|/D.any|"];
192 [label="Exit safe call"];
193 [label="Variable declaration: lval b: R|kotlin/Any?|"];
194 [label="Access variable R|<local>/a|"];
195 [label="Type operator: (R|<local>/a| as R|A|)"];
196 [label="Access variable R|<local>/a|"];
197 [label="Smart cast: R|<local>/a|"];
198 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
199 [label="Access variable R|<local>/b|"];
200 [label="Type operator: (R|<local>/b| as R|B|)"];
201 [label="Access variable R|<local>/b|"];
202 [label="Smart cast: R|<local>/b|"];
203 [label="Function call: R|<local>/b|.R|/B.bar|()" style="filled" fillcolor=yellow];
204 [label="Exit block"];
182 [label="Enter block"];
183 [label="Access variable R|<local>/d1|"];
184 [label="Enter safe call"];
185 [label="Access variable R|/D.any|"];
186 [label="Exit safe call"];
187 [label="Variable declaration: lval a: R|kotlin/Any?|"];
188 [label="Access variable R|<local>/d2|"];
189 [label="Enter safe call"];
190 [label="Access variable R|/D.any|"];
191 [label="Exit safe call"];
192 [label="Variable declaration: lval b: R|kotlin/Any?|"];
193 [label="Access variable R|<local>/a|"];
194 [label="Type operator: (R|<local>/a| as R|A|)"];
195 [label="Access variable R|<local>/a|"];
196 [label="Smart cast: R|<local>/a|"];
197 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
198 [label="Access variable R|<local>/b|"];
199 [label="Type operator: (R|<local>/b| as R|B|)"];
200 [label="Access variable R|<local>/b|"];
201 [label="Smart cast: R|<local>/b|"];
202 [label="Function call: R|<local>/b|.R|/B.bar|()" style="filled" fillcolor=yellow];
203 [label="Exit block"];
}
205 [label="Exit function test_7" style="filled" fillcolor=red];
204 [label="Exit function test_7" style="filled" fillcolor=red];
}
181 -> {182};
182 -> {183};
183 -> {184};
184 -> {185 187};
183 -> {184 186};
184 -> {185};
185 -> {186};
186 -> {187};
187 -> {188};
188 -> {189};
189 -> {190 192};
188 -> {189 191};
189 -> {190};
190 -> {191};
191 -> {192};
192 -> {193};
@@ -533,6 +532,5 @@ digraph boundSmartcasts_kt {
201 -> {202};
202 -> {203};
203 -> {204};
204 -> {205};
}
@@ -23,101 +23,99 @@ digraph functionCallBound_kt {
subgraph cluster_2 {
color=red
5 [label="Enter class Sub" style="filled" fillcolor=red];
6 [label="Part of class initialization"];
subgraph cluster_3 {
color=blue
7 [label="Enter property" style="filled" fillcolor=red];
8 [label="Access variable R|<local>/data|"];
9 [label="Exit property" style="filled" fillcolor=red];
6 [label="Enter property" style="filled" fillcolor=red];
7 [label="Access variable R|<local>/data|"];
8 [label="Exit property" style="filled" fillcolor=red];
}
10 [label="Exit class Sub" style="filled" fillcolor=red];
9 [label="Exit class Sub" style="filled" fillcolor=red];
}
subgraph cluster_4 {
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];
10 [label="Enter function <init>" style="filled" fillcolor=red];
11 [label="Delegated constructor call: super<R|Base|>()" style="filled" fillcolor=yellow];
12 [label="Exit function <init>" style="filled" fillcolor=red];
}
5 -> {6} [color=green];
6 -> {7} [color=green];
6 -> {10} [style=dotted];
6 -> {7} [style=dashed];
5 -> {9} [style=dotted];
5 -> {6} [style=dashed];
6 -> {7};
7 -> {8};
8 -> {9};
8 -> {9} [color=green];
9 -> {10} [color=green];
10 -> {11} [color=green];
10 -> {11} [style=dashed];
9 -> {10} [style=dashed];
10 -> {11};
11 -> {12};
12 -> {13};
subgraph cluster_5 {
color=red
14 [label="Enter function isOk" style="filled" fillcolor=red];
13 [label="Enter function isOk" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
15 [label="Enter block"];
16 [label="Const: Boolean(true)"];
17 [label="Jump: ^isOk Boolean(true)"];
18 [label="Stub" style="filled" fillcolor=gray];
19 [label="Exit block" style="filled" fillcolor=gray];
14 [label="Enter block"];
15 [label="Const: Boolean(true)"];
16 [label="Jump: ^isOk Boolean(true)"];
17 [label="Stub" style="filled" fillcolor=gray];
18 [label="Exit block" style="filled" fillcolor=gray];
}
20 [label="Exit function isOk" style="filled" fillcolor=red];
19 [label="Exit function isOk" style="filled" fillcolor=red];
}
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {20};
16 -> {19};
16 -> {17} [style=dotted];
17 -> {18} [style=dotted];
18 -> {19} [style=dotted];
19 -> {20} [style=dotted];
subgraph cluster_7 {
color=red
21 [label="Enter function check" style="filled" fillcolor=red];
20 [label="Enter function check" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
22 [label="Enter block"];
21 [label="Enter block"];
subgraph cluster_9 {
color=blue
23 [label="Enter when"];
22 [label="Enter when"];
subgraph cluster_10 {
color=blue
24 [label="Enter when branch condition "];
25 [label="Access variable R|<local>/base|"];
26 [label="Type operator: (R|<local>/base| as? R|Sub|)"];
27 [label="Enter safe call"];
28 [label="Function call: $subj$.R|/isOk|()" style="filled" fillcolor=yellow];
29 [label="Exit safe call"];
30 [label="Const: Boolean(true)"];
31 [label="Equality operator =="];
32 [label="Exit when branch condition"];
23 [label="Enter when branch condition "];
24 [label="Access variable R|<local>/base|"];
25 [label="Type operator: (R|<local>/base| as? R|Sub|)"];
26 [label="Enter safe call"];
27 [label="Function call: $subj$.R|/isOk|()" style="filled" fillcolor=yellow];
28 [label="Exit safe call"];
29 [label="Const: Boolean(true)"];
30 [label="Equality operator =="];
31 [label="Exit when branch condition"];
}
subgraph cluster_11 {
color=blue
33 [label="Enter when branch condition else"];
34 [label="Exit when branch condition"];
32 [label="Enter when branch condition else"];
33 [label="Exit when branch condition"];
}
35 [label="Enter when branch result"];
34 [label="Enter when branch result"];
subgraph cluster_12 {
color=blue
36 [label="Enter block"];
37 [label="Access variable R|<local>/base|"];
38 [label="Exit block"];
35 [label="Enter block"];
36 [label="Access variable R|<local>/base|"];
37 [label="Exit block"];
}
39 [label="Exit when branch result"];
40 [label="Enter when branch result"];
38 [label="Exit when branch result"];
39 [label="Enter when branch result"];
subgraph cluster_13 {
color=blue
41 [label="Enter block"];
42 [label="Access variable R|<local>/base|"];
43 [label="Smart cast: R|<local>/base|"];
44 [label="Access variable R|/Sub.data|"];
45 [label="Exit block"];
40 [label="Enter block"];
41 [label="Access variable R|<local>/base|"];
42 [label="Smart cast: R|<local>/base|"];
43 [label="Access variable R|/Sub.data|"];
44 [label="Exit block"];
}
46 [label="Exit when branch result"];
47 [label="Exit when"];
45 [label="Exit when branch result"];
46 [label="Exit when"];
}
48 [label="Jump: ^check when () {
47 [label="Jump: ^check when () {
==((R|<local>/base| as? R|Sub|)?.{ $subj$.R|/isOk|() }, Boolean(true)) -> {
R|<local>/base|.R|/Sub.data|
}
@@ -126,30 +124,31 @@ digraph functionCallBound_kt {
}
}
"];
49 [label="Stub" style="filled" fillcolor=gray];
50 [label="Exit block" style="filled" fillcolor=gray];
48 [label="Stub" style="filled" fillcolor=gray];
49 [label="Exit block" style="filled" fillcolor=gray];
}
51 [label="Exit function check" style="filled" fillcolor=red];
50 [label="Exit function check" style="filled" fillcolor=red];
}
20 -> {21};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27 29};
25 -> {26 28};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33 40};
31 -> {32 39};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {47};
38 -> {46};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
@@ -157,10 +156,9 @@ digraph functionCallBound_kt {
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {48};
48 -> {51};
47 -> {50};
47 -> {48} [style=dotted];
48 -> {49} [style=dotted];
49 -> {50} [style=dotted];
50 -> {51} [style=dotted];
}