[FIR] Add CFG nodes, add multiple subGraphs for CFGOwner

This commit is contained in:
Oleg Ivanov
2020-07-30 17:06:30 +03:00
parent 128075e780
commit cc9c5b9e3c
52 changed files with 2359 additions and 1940 deletions
@@ -319,186 +319,193 @@ digraph boundSmartcasts_kt {
115 [label="Enter class D" style="filled" fillcolor=red];
subgraph cluster_28 {
color=blue
117 [label="Enter property" style="filled" fillcolor=red];
118 [label="Access variable R|<local>/any|"];
119 [label="Exit property" style="filled" fillcolor=red];
116 [label="Part of class initialization"];
117 [label="Exit class D" style="filled" fillcolor=red];
}
116 [label="Exit class D" style="filled" fillcolor=red];
}
115 -> {117} [color=green];
117 -> {118};
118 -> {119};
119 -> {116} [color=green];
115 -> {116} [color=green];
116 -> {117} [style=dotted];
116 -> {123} [color=green];
116 -> {123} [style=dashed];
subgraph cluster_29 {
color=red
120 [label="Enter function <init>" style="filled" fillcolor=red];
121 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
122 [label="Exit function <init>" style="filled" fillcolor=red];
}
120 -> {121};
121 -> {122};
subgraph cluster_29 {
color=red
118 [label="Enter function <init>" style="filled" fillcolor=red];
119 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
120 [label="Exit function <init>" style="filled" fillcolor=red];
}
118 -> {119};
119 -> {120};
subgraph cluster_30 {
color=red
123 [label="Enter function getter" style="filled" fillcolor=red];
124 [label="Exit function getter" style="filled" fillcolor=red];
}
123 -> {124};
subgraph cluster_30 {
color=red
121 [label="Enter function getter" style="filled" fillcolor=red];
122 [label="Exit function getter" style="filled" fillcolor=red];
}
121 -> {122};
subgraph cluster_31 {
color=red
123 [label="Enter property" style="filled" fillcolor=red];
124 [label="Access variable R|<local>/any|"];
125 [label="Exit property" style="filled" fillcolor=red];
}
123 -> {124};
124 -> {125};
125 -> {117} [color=green];
subgraph cluster_31 {
color=red
125 [label="Enter function baz" style="filled" fillcolor=red];
subgraph cluster_32 {
color=blue
126 [label="Enter block"];
127 [label="Exit block"];
color=red
126 [label="Enter function baz" style="filled" fillcolor=red];
subgraph cluster_33 {
color=blue
127 [label="Enter block"];
128 [label="Exit block"];
}
129 [label="Exit function baz" style="filled" fillcolor=red];
}
128 [label="Exit function baz" style="filled" fillcolor=red];
}
125 -> {126};
126 -> {127};
127 -> {128};
126 -> {127};
127 -> {128};
128 -> {129};
subgraph cluster_33 {
color=red
129 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_34 {
color=blue
130 [label="Enter block"];
131 [label="Access variable R|<local>/d|"];
132 [label="Access variable R|/D.any|"];
133 [label="Exit lhs of ?:"];
134 [label="Enter rhs of ?:"];
135 [label="Jump: ^test_5 Unit"];
136 [label="Stub" style="filled" fillcolor=gray];
137 [label="Lhs of ?: is not null"];
138 [label="Exit ?:"];
139 [label="Variable declaration: lval a: R|kotlin/Any|"];
140 [label="Access variable R|<local>/a|"];
141 [label="Function call: R|<local>/a|.R|/baz|()"];
142 [label="Access variable R|<local>/d|"];
143 [label="Access variable R|/D.any|"];
144 [label="Function call: R|<local>/d|.R|/D.any|.R|/baz|()"];
145 [label="Access variable R|<local>/a|"];
146 [label="Type operator: (R|<local>/a| as R|A|)"];
147 [label="Access variable R|<local>/a|"];
148 [label="Function call: R|<local>/a|.R|/A.foo|()"];
149 [label="Exit block"];
color=red
130 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_35 {
color=blue
131 [label="Enter block"];
132 [label="Access variable R|<local>/d|"];
133 [label="Access variable R|/D.any|"];
134 [label="Exit lhs of ?:"];
135 [label="Enter rhs of ?:"];
136 [label="Jump: ^test_5 Unit"];
137 [label="Stub" style="filled" fillcolor=gray];
138 [label="Lhs of ?: is not null"];
139 [label="Exit ?:"];
140 [label="Variable declaration: lval a: R|kotlin/Any|"];
141 [label="Access variable R|<local>/a|"];
142 [label="Function call: R|<local>/a|.R|/baz|()"];
143 [label="Access variable R|<local>/d|"];
144 [label="Access variable R|/D.any|"];
145 [label="Function call: R|<local>/d|.R|/D.any|.R|/baz|()"];
146 [label="Access variable R|<local>/a|"];
147 [label="Type operator: (R|<local>/a| as R|A|)"];
148 [label="Access variable R|<local>/a|"];
149 [label="Function call: R|<local>/a|.R|/A.foo|()"];
150 [label="Exit block"];
}
151 [label="Exit function test_5" style="filled" fillcolor=red];
}
150 [label="Exit function test_5" style="filled" fillcolor=red];
}
129 -> {130};
130 -> {131};
131 -> {132};
132 -> {133};
133 -> {137 134};
134 -> {135};
135 -> {150};
135 -> {136} [style=dotted];
136 -> {138} [style=dotted];
137 -> {138};
138 -> {139};
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {144};
144 -> {145};
145 -> {146};
146 -> {147};
147 -> {148};
148 -> {149};
149 -> {150};
130 -> {131};
131 -> {132};
132 -> {133};
133 -> {134};
134 -> {138 135};
135 -> {136};
136 -> {151};
136 -> {137} [style=dotted];
137 -> {139} [style=dotted];
138 -> {139};
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {144};
144 -> {145};
145 -> {146};
146 -> {147};
147 -> {148};
148 -> {149};
149 -> {150};
150 -> {151};
subgraph cluster_35 {
color=red
151 [label="Enter function test_6" style="filled" fillcolor=red];
subgraph cluster_36 {
color=blue
152 [label="Enter block"];
153 [label="Access variable R|<local>/d1|"];
154 [label="Access variable R|/D.any|"];
155 [label="Variable declaration: lval a: R|kotlin/Any?|"];
156 [label="Access variable R|<local>/a|"];
157 [label="Type operator: (R|<local>/a| as R|A|)"];
158 [label="Access variable R|<local>/a|"];
159 [label="Function call: R|<local>/a|.R|/A.foo|()"];
160 [label="Access variable R|<local>/d1|"];
161 [label="Access variable R|/D.any|"];
162 [label="Function call: R|<local>/d1|.R|/D.any|.R|/A.foo|()"];
163 [label="Access variable R|<local>/d1|"];
164 [label="Access variable R|/D.any|"];
165 [label="Function call: R|<local>/d1|.R|/D.any|.R|/baz|()"];
166 [label="Exit block"];
color=red
152 [label="Enter function test_6" style="filled" fillcolor=red];
subgraph cluster_37 {
color=blue
153 [label="Enter block"];
154 [label="Access variable R|<local>/d1|"];
155 [label="Access variable R|/D.any|"];
156 [label="Variable declaration: lval a: R|kotlin/Any?|"];
157 [label="Access variable R|<local>/a|"];
158 [label="Type operator: (R|<local>/a| as R|A|)"];
159 [label="Access variable R|<local>/a|"];
160 [label="Function call: R|<local>/a|.R|/A.foo|()"];
161 [label="Access variable R|<local>/d1|"];
162 [label="Access variable R|/D.any|"];
163 [label="Function call: R|<local>/d1|.R|/D.any|.R|/A.foo|()"];
164 [label="Access variable R|<local>/d1|"];
165 [label="Access variable R|/D.any|"];
166 [label="Function call: R|<local>/d1|.R|/D.any|.R|/baz|()"];
167 [label="Exit block"];
}
168 [label="Exit function test_6" style="filled" fillcolor=red];
}
167 [label="Exit function test_6" style="filled" fillcolor=red];
}
151 -> {152};
152 -> {153};
153 -> {154};
154 -> {155};
155 -> {156};
156 -> {157};
157 -> {158};
158 -> {159};
159 -> {160};
160 -> {161};
161 -> {162};
162 -> {163};
163 -> {164};
164 -> {165};
165 -> {166};
166 -> {167};
152 -> {153};
153 -> {154};
154 -> {155};
155 -> {156};
156 -> {157};
157 -> {158};
158 -> {159};
159 -> {160};
160 -> {161};
161 -> {162};
162 -> {163};
163 -> {164};
164 -> {165};
165 -> {166};
166 -> {167};
167 -> {168};
subgraph cluster_37 {
color=red
168 [label="Enter function test_7" style="filled" fillcolor=red];
subgraph cluster_38 {
color=blue
169 [label="Enter block"];
170 [label="Access variable R|<local>/d1|"];
171 [label="Enter safe call"];
172 [label="Access variable R|/D.any|"];
173 [label="Exit safe call"];
174 [label="Variable declaration: lval a: R|kotlin/Any?|"];
175 [label="Access variable R|<local>/d2|"];
176 [label="Enter safe call"];
177 [label="Access variable R|/D.any|"];
178 [label="Exit safe call"];
179 [label="Variable declaration: lval b: R|kotlin/Any?|"];
180 [label="Access variable R|<local>/a|"];
181 [label="Type operator: (R|<local>/a| as R|A|)"];
182 [label="Access variable R|<local>/a|"];
183 [label="Function call: R|<local>/a|.R|/A.foo|()"];
184 [label="Access variable R|<local>/b|"];
185 [label="Type operator: (R|<local>/b| as R|B|)"];
186 [label="Access variable R|<local>/b|"];
187 [label="Function call: R|<local>/b|.R|/B.bar|()"];
188 [label="Exit block"];
color=red
169 [label="Enter function test_7" style="filled" fillcolor=red];
subgraph cluster_39 {
color=blue
170 [label="Enter block"];
171 [label="Access variable R|<local>/d1|"];
172 [label="Enter safe call"];
173 [label="Access variable R|/D.any|"];
174 [label="Exit safe call"];
175 [label="Variable declaration: lval a: R|kotlin/Any?|"];
176 [label="Access variable R|<local>/d2|"];
177 [label="Enter safe call"];
178 [label="Access variable R|/D.any|"];
179 [label="Exit safe call"];
180 [label="Variable declaration: lval b: R|kotlin/Any?|"];
181 [label="Access variable R|<local>/a|"];
182 [label="Type operator: (R|<local>/a| as R|A|)"];
183 [label="Access variable R|<local>/a|"];
184 [label="Function call: R|<local>/a|.R|/A.foo|()"];
185 [label="Access variable R|<local>/b|"];
186 [label="Type operator: (R|<local>/b| as R|B|)"];
187 [label="Access variable R|<local>/b|"];
188 [label="Function call: R|<local>/b|.R|/B.bar|()"];
189 [label="Exit block"];
}
190 [label="Exit function test_7" style="filled" fillcolor=red];
}
189 [label="Exit function test_7" style="filled" fillcolor=red];
}
168 -> {169};
169 -> {170};
170 -> {171 173};
171 -> {172};
172 -> {173};
173 -> {174};
174 -> {175};
175 -> {176 178};
176 -> {177};
177 -> {178};
178 -> {179};
179 -> {180};
180 -> {181};
181 -> {182};
182 -> {183};
183 -> {184};
184 -> {185};
185 -> {186};
186 -> {187};
187 -> {188};
188 -> {189};
169 -> {170};
170 -> {171};
171 -> {172 174};
172 -> {173};
173 -> {174};
174 -> {175};
175 -> {176};
176 -> {177 179};
177 -> {178};
178 -> {179};
179 -> {180};
180 -> {181};
181 -> {182};
182 -> {183};
183 -> {184};
184 -> {185};
185 -> {186};
186 -> {187};
187 -> {188};
188 -> {189};
189 -> {190};
}
}
@@ -24,100 +24,107 @@ digraph functionCallBound_kt {
5 [label="Enter class Sub" style="filled" fillcolor=red];
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="Part of class initialization"];
7 [label="Exit class Sub" style="filled" fillcolor=red];
}
6 [label="Exit class Sub" style="filled" fillcolor=red];
}
5 -> {7} [color=green];
7 -> {8};
8 -> {9};
9 -> {6} [color=green];
5 -> {6} [color=green];
6 -> {7} [style=dotted];
6 -> {13} [color=green];
6 -> {13} [style=dashed];
subgraph cluster_4 {
color=red
10 [label="Enter function <init>" style="filled" fillcolor=red];
11 [label="Delegated constructor call: super<R|Base|>()"];
12 [label="Exit function <init>" style="filled" fillcolor=red];
}
10 -> {11};
11 -> {12};
subgraph cluster_4 {
color=red
8 [label="Enter function <init>" style="filled" fillcolor=red];
9 [label="Delegated constructor call: super<R|Base|>()"];
10 [label="Exit function <init>" style="filled" fillcolor=red];
}
8 -> {9};
9 -> {10};
subgraph cluster_5 {
color=red
13 [label="Enter function getter" style="filled" fillcolor=red];
14 [label="Exit function getter" style="filled" fillcolor=red];
}
13 -> {14};
subgraph cluster_5 {
color=red
11 [label="Enter function getter" style="filled" fillcolor=red];
12 [label="Exit function getter" style="filled" fillcolor=red];
}
11 -> {12};
subgraph cluster_6 {
color=red
13 [label="Enter property" style="filled" fillcolor=red];
14 [label="Access variable R|<local>/data|"];
15 [label="Exit property" style="filled" fillcolor=red];
}
13 -> {14};
14 -> {15};
15 -> {7} [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];
color=red
16 [label="Enter function isOk" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
17 [label="Enter block"];
18 [label="Const: Boolean(true)"];
19 [label="Jump: ^isOk Boolean(true)"];
20 [label="Stub" style="filled" fillcolor=gray];
21 [label="Exit block" style="filled" fillcolor=gray];
}
22 [label="Exit function isOk" style="filled" fillcolor=red];
}
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];
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {22};
19 -> {20} [style=dotted];
20 -> {21} [style=dotted];
21 -> {22} [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"];
color=red
23 [label="Enter function check" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
24 [label="Enter when"];
24 [label="Enter block"];
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|()"];
30 [label="Exit safe call"];
31 [label="Const: Boolean(true)"];
32 [label="Equality operator =="];
33 [label="Exit when branch condition"];
25 [label="Enter when"];
subgraph cluster_12 {
color=blue
26 [label="Enter when branch condition "];
27 [label="Access variable R|<local>/base|"];
28 [label="Type operator: (R|<local>/base| as? R|Sub|)"];
29 [label="Enter safe call"];
30 [label="Function call: $subj$.R|/isOk|()"];
31 [label="Exit safe call"];
32 [label="Const: Boolean(true)"];
33 [label="Equality operator =="];
34 [label="Exit when branch condition"];
}
subgraph cluster_13 {
color=blue
35 [label="Enter when branch condition else"];
36 [label="Exit when branch condition"];
}
37 [label="Enter when branch result"];
subgraph cluster_14 {
color=blue
38 [label="Enter block"];
39 [label="Access variable R|<local>/base|"];
40 [label="Exit block"];
}
41 [label="Exit when branch result"];
42 [label="Enter when branch result"];
subgraph cluster_15 {
color=blue
43 [label="Enter block"];
44 [label="Access variable R|<local>/base|"];
45 [label="Access variable R|/Sub.data|"];
46 [label="Exit block"];
}
47 [label="Exit when branch result"];
48 [label="Exit when"];
}
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="Access variable R|/Sub.data|"];
45 [label="Exit block"];
}
46 [label="Exit when branch result"];
47 [label="Exit when"];
}
48 [label="Jump: ^check when () {
49 [label="Jump: ^check when () {
==((R|<local>/base| as? R|Sub|)?.{ $subj$.R|/isOk|() }, Boolean(true)) -> {
R|<local>/base|.R|/Sub.data|
}
@@ -126,40 +133,40 @@ digraph functionCallBound_kt {
}
}
"];
49 [label="Stub" style="filled" fillcolor=gray];
50 [label="Exit block" style="filled" fillcolor=gray];
50 [label="Stub" style="filled" fillcolor=gray];
51 [label="Exit block" style="filled" fillcolor=gray];
}
52 [label="Exit function check" style="filled" fillcolor=red];
}
51 [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 -> {41 34};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {47};
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {48};
48 -> {51};
48 -> {49} [style=dotted];
49 -> {50} [style=dotted];
50 -> {51} [style=dotted];
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29 31};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {42 35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {48};
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];
}
}