[FIR] Fix incorrect cluster creating in CFG dumps

This commit is contained in:
Dmitriy Novozhilov
2020-10-12 11:09:52 +03:00
parent 3495ec198d
commit f794ced888
19 changed files with 4222 additions and 4274 deletions
@@ -6,429 +6,427 @@ digraph assignSafeCall_kt {
subgraph cluster_0 {
color=red
0 [label="Enter class A" style="filled" fillcolor=red];
subgraph cluster_1 {
color=blue
1 [label="Part of class initialization"];
2 [label="Exit class A" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
1 -> {2} [style=dotted];
1 -> {15} [color=green];
1 -> {15} [style=dashed];
1 [label="Part of class initialization"];
2 [label="Exit class A" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
1 -> {2} [style=dotted];
1 -> {15} [color=green];
1 -> {15} [style=dashed];
subgraph cluster_2 {
color=red
3 [label="Enter function <init>" style="filled" fillcolor=red];
4 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
5 [label="Exit function <init>" style="filled" fillcolor=red];
}
3 -> {4};
4 -> {5};
subgraph cluster_1 {
color=red
3 [label="Enter function <init>" style="filled" fillcolor=red];
4 [label="Delegated constructor call: super<R|kotlin/Any|>()"];
5 [label="Exit function <init>" style="filled" fillcolor=red];
}
3 -> {4};
4 -> {5};
subgraph cluster_2 {
color=red
6 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_3 {
color=red
6 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_4 {
color=blue
7 [label="Enter block"];
8 [label="Const: Int(1)"];
9 [label="Jump: ^foo Int(1)"];
10 [label="Stub" style="filled" fillcolor=gray];
11 [label="Exit block" style="filled" fillcolor=gray];
}
12 [label="Exit function foo" style="filled" fillcolor=red];
color=blue
7 [label="Enter block"];
8 [label="Const: Int(1)"];
9 [label="Jump: ^foo Int(1)"];
10 [label="Stub" style="filled" fillcolor=gray];
11 [label="Exit block" style="filled" fillcolor=gray];
}
6 -> {7};
7 -> {8};
8 -> {9};
9 -> {12};
9 -> {10} [style=dotted];
10 -> {11} [style=dotted];
11 -> {12} [style=dotted];
12 [label="Exit function foo" style="filled" fillcolor=red];
}
6 -> {7};
7 -> {8};
8 -> {9};
9 -> {12};
9 -> {10} [style=dotted];
10 -> {11} [style=dotted];
11 -> {12} [style=dotted];
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_4 {
color=red
13 [label="Enter function getter" style="filled" fillcolor=red];
14 [label="Exit function getter" style="filled" fillcolor=red];
}
13 -> {14};
subgraph cluster_6 {
color=red
15 [label="Enter property" style="filled" fillcolor=red];
16 [label="Const: Int(1)"];
17 [label="Exit property" style="filled" fillcolor=red];
}
15 -> {16};
16 -> {17};
17 -> {2} [color=green];
subgraph cluster_5 {
color=red
15 [label="Enter property" style="filled" fillcolor=red];
16 [label="Const: Int(1)"];
17 [label="Exit property" style="filled" fillcolor=red];
}
15 -> {16};
16 -> {17};
17 -> {2} [color=green];
subgraph cluster_6 {
color=red
18 [label="Enter function bar" style="filled" fillcolor=red];
subgraph cluster_7 {
color=red
18 [label="Enter function bar" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
19 [label="Enter block"];
20 [label="Exit block"];
}
21 [label="Exit function bar" style="filled" fillcolor=red];
color=blue
19 [label="Enter block"];
20 [label="Exit block"];
}
18 -> {19};
19 -> {20};
20 -> {21};
21 [label="Exit function bar" style="filled" fillcolor=red];
}
18 -> {19};
19 -> {20};
20 -> {21};
subgraph cluster_8 {
color=red
22 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_9 {
color=red
22 [label="Enter function test_1" style="filled" fillcolor=red];
color=blue
23 [label="Enter block"];
24 [label="Access variable R|<local>/a|"];
25 [label="Enter safe call"];
26 [label="Access variable R|/A.x|"];
27 [label="Exit safe call"];
28 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_10 {
color=blue
23 [label="Enter block"];
24 [label="Access variable R|<local>/a|"];
25 [label="Enter safe call"];
26 [label="Access variable R|/A.x|"];
27 [label="Exit safe call"];
28 [label="Variable declaration: lval x: R|kotlin/Int?|"];
29 [label="Enter when"];
subgraph cluster_11 {
color=blue
29 [label="Enter when"];
subgraph cluster_12 {
color=blue
30 [label="Enter when branch condition "];
31 [label="Access variable R|<local>/x|"];
32 [label="Const: Null(null)"];
33 [label="Equality operator !="];
34 [label="Exit when branch condition"];
}
35 [label="Synthetic else branch"];
36 [label="Enter when branch result"];
subgraph cluster_13 {
color=blue
37 [label="Enter block"];
38 [label="Access variable R|<local>/a|"];
39 [label="Function call: R|<local>/a|.R|/A.bar|()"];
40 [label="Exit block"];
}
41 [label="Exit when branch result"];
42 [label="Exit when"];
30 [label="Enter when branch condition "];
31 [label="Access variable R|<local>/x|"];
32 [label="Const: Null(null)"];
33 [label="Equality operator !="];
34 [label="Exit when branch condition"];
}
43 [label="Exit block"];
35 [label="Synthetic else branch"];
36 [label="Enter when branch result"];
subgraph cluster_12 {
color=blue
37 [label="Enter block"];
38 [label="Access variable R|<local>/a|"];
39 [label="Function call: R|<local>/a|.R|/A.bar|()"];
40 [label="Exit block"];
}
41 [label="Exit when branch result"];
42 [label="Exit when"];
}
44 [label="Exit function test_1" style="filled" fillcolor=red];
43 [label="Exit block"];
}
22 -> {23};
23 -> {24};
24 -> {25 27};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {36 35};
35 -> {42};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {44};
44 [label="Exit function test_1" style="filled" fillcolor=red];
}
22 -> {23};
23 -> {24};
24 -> {25 27};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {36 35};
35 -> {42};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {44};
subgraph cluster_13 {
color=red
45 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_14 {
color=red
45 [label="Enter function test_2" style="filled" fillcolor=red];
color=blue
46 [label="Enter block"];
47 [label="Access variable R|<local>/a|"];
48 [label="Enter safe call"];
49 [label="Function call: $subj$.R|/A.foo|()"];
50 [label="Exit safe call"];
51 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_15 {
color=blue
46 [label="Enter block"];
47 [label="Access variable R|<local>/a|"];
48 [label="Enter safe call"];
49 [label="Function call: $subj$.R|/A.foo|()"];
50 [label="Exit safe call"];
51 [label="Variable declaration: lval x: R|kotlin/Int?|"];
52 [label="Enter when"];
subgraph cluster_16 {
color=blue
52 [label="Enter when"];
subgraph cluster_17 {
color=blue
53 [label="Enter when branch condition "];
54 [label="Access variable R|<local>/x|"];
55 [label="Const: Null(null)"];
56 [label="Equality operator !="];
57 [label="Exit when branch condition"];
}
58 [label="Synthetic else branch"];
59 [label="Enter when branch result"];
subgraph cluster_18 {
color=blue
60 [label="Enter block"];
61 [label="Access variable R|<local>/a|"];
62 [label="Function call: R|<local>/a|.R|/A.bar|()"];
63 [label="Exit block"];
}
64 [label="Exit when branch result"];
65 [label="Exit when"];
53 [label="Enter when branch condition "];
54 [label="Access variable R|<local>/x|"];
55 [label="Const: Null(null)"];
56 [label="Equality operator !="];
57 [label="Exit when branch condition"];
}
66 [label="Exit block"];
58 [label="Synthetic else branch"];
59 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
60 [label="Enter block"];
61 [label="Access variable R|<local>/a|"];
62 [label="Function call: R|<local>/a|.R|/A.bar|()"];
63 [label="Exit block"];
}
64 [label="Exit when branch result"];
65 [label="Exit when"];
}
67 [label="Exit function test_2" style="filled" fillcolor=red];
66 [label="Exit block"];
}
45 -> {46};
46 -> {47};
47 -> {48 50};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {59 58};
58 -> {65};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
67 [label="Exit function test_2" style="filled" fillcolor=red];
}
45 -> {46};
46 -> {47};
47 -> {48 50};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {59 58};
58 -> {65};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
subgraph cluster_18 {
color=red
68 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_19 {
color=red
68 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_20 {
color=blue
69 [label="Enter block"];
70 [label="Access variable R|<local>/x|"];
71 [label="Type operator: (R|<local>/x| as? R|A|)"];
72 [label="Exit lhs of ?:"];
73 [label="Enter rhs of ?:"];
74 [label="Jump: ^test_3 Unit"];
75 [label="Stub" style="filled" fillcolor=gray];
76 [label="Lhs of ?: is not null"];
77 [label="Exit ?:"];
78 [label="Variable declaration: lval a: R|A|"];
79 [label="Access variable R|<local>/a|"];
80 [label="Function call: R|<local>/a|.R|/A.foo|()"];
81 [label="Access variable R|<local>/x|"];
82 [label="Function call: R|<local>/x|.R|/A.foo|()"];
83 [label="Exit block"];
}
84 [label="Exit function test_3" style="filled" fillcolor=red];
color=blue
69 [label="Enter block"];
70 [label="Access variable R|<local>/x|"];
71 [label="Type operator: (R|<local>/x| as? R|A|)"];
72 [label="Exit lhs of ?:"];
73 [label="Enter rhs of ?:"];
74 [label="Jump: ^test_3 Unit"];
75 [label="Stub" style="filled" fillcolor=gray];
76 [label="Lhs of ?: is not null"];
77 [label="Exit ?:"];
78 [label="Variable declaration: lval a: R|A|"];
79 [label="Access variable R|<local>/a|"];
80 [label="Function call: R|<local>/a|.R|/A.foo|()"];
81 [label="Access variable R|<local>/x|"];
82 [label="Function call: R|<local>/x|.R|/A.foo|()"];
83 [label="Exit block"];
}
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {76 73};
73 -> {74};
74 -> {84};
74 -> {75} [style=dotted];
75 -> {77} [style=dotted];
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
83 -> {84};
84 [label="Exit function test_3" style="filled" fillcolor=red];
}
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {76 73};
73 -> {74};
74 -> {84};
74 -> {75} [style=dotted];
75 -> {77} [style=dotted];
76 -> {77};
77 -> {78};
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
83 -> {84};
subgraph cluster_21 {
color=red
85 [label="Enter class B" style="filled" fillcolor=red];
86 [label="Exit class B" style="filled" fillcolor=red];
}
85 -> {86} [color=green];
subgraph cluster_20 {
color=red
85 [label="Enter class B" style="filled" fillcolor=red];
86 [label="Exit class B" style="filled" fillcolor=red];
}
85 -> {86} [color=green];
subgraph cluster_22 {
color=red
87 [label="Enter function foo" style="filled" fillcolor=red];
88 [label="Exit function foo" style="filled" fillcolor=red];
}
87 -> {88};
subgraph cluster_21 {
color=red
87 [label="Enter function foo" style="filled" fillcolor=red];
88 [label="Exit function foo" style="filled" fillcolor=red];
}
87 -> {88};
subgraph cluster_23 {
color=red
89 [label="Enter function getter" style="filled" fillcolor=red];
90 [label="Exit function getter" style="filled" fillcolor=red];
}
89 -> {90};
subgraph cluster_22 {
color=red
89 [label="Enter function getter" style="filled" fillcolor=red];
90 [label="Exit function getter" style="filled" fillcolor=red];
}
89 -> {90};
subgraph cluster_24 {
color=red
91 [label="Enter function bar" style="filled" fillcolor=red];
92 [label="Exit function bar" style="filled" fillcolor=red];
}
91 -> {92};
subgraph cluster_23 {
color=red
91 [label="Enter function bar" style="filled" fillcolor=red];
92 [label="Exit function bar" style="filled" fillcolor=red];
}
91 -> {92};
subgraph cluster_24 {
color=red
93 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_25 {
color=red
93 [label="Enter function test_1" style="filled" fillcolor=red];
color=blue
94 [label="Enter block"];
95 [label="Access variable R|<local>/a|"];
96 [label="Enter safe call"];
97 [label="Access variable R|/B.x|"];
98 [label="Exit safe call"];
99 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_26 {
color=blue
94 [label="Enter block"];
95 [label="Access variable R|<local>/a|"];
96 [label="Enter safe call"];
97 [label="Access variable R|/B.x|"];
98 [label="Exit safe call"];
99 [label="Variable declaration: lval x: R|kotlin/Int?|"];
100 [label="Enter when"];
subgraph cluster_27 {
color=blue
100 [label="Enter when"];
subgraph cluster_28 {
color=blue
101 [label="Enter when branch condition "];
102 [label="Access variable R|<local>/x|"];
103 [label="Const: Null(null)"];
104 [label="Equality operator !="];
105 [label="Exit when branch condition"];
}
106 [label="Synthetic else branch"];
107 [label="Enter when branch result"];
subgraph cluster_29 {
color=blue
108 [label="Enter block"];
109 [label="Access variable R|<local>/a|"];
110 [label="Function call: R|<local>/a|.R|/B.bar|()"];
111 [label="Exit block"];
}
112 [label="Exit when branch result"];
113 [label="Exit when"];
101 [label="Enter when branch condition "];
102 [label="Access variable R|<local>/x|"];
103 [label="Const: Null(null)"];
104 [label="Equality operator !="];
105 [label="Exit when branch condition"];
}
114 [label="Exit block"];
106 [label="Synthetic else branch"];
107 [label="Enter when branch result"];
subgraph cluster_28 {
color=blue
108 [label="Enter block"];
109 [label="Access variable R|<local>/a|"];
110 [label="Function call: R|<local>/a|.R|/B.bar|()"];
111 [label="Exit block"];
}
112 [label="Exit when branch result"];
113 [label="Exit when"];
}
115 [label="Exit function test_1" style="filled" fillcolor=red];
114 [label="Exit block"];
}
93 -> {94};
94 -> {95};
95 -> {96 98};
96 -> {97};
97 -> {98};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {107 106};
106 -> {113};
107 -> {108};
108 -> {109};
109 -> {110};
110 -> {111};
111 -> {112};
112 -> {113};
113 -> {114};
114 -> {115};
115 [label="Exit function test_1" style="filled" fillcolor=red];
}
93 -> {94};
94 -> {95};
95 -> {96 98};
96 -> {97};
97 -> {98};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {107 106};
106 -> {113};
107 -> {108};
108 -> {109};
109 -> {110};
110 -> {111};
111 -> {112};
112 -> {113};
113 -> {114};
114 -> {115};
subgraph cluster_29 {
color=red
116 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_30 {
color=red
116 [label="Enter function test_2" style="filled" fillcolor=red];
color=blue
117 [label="Enter block"];
118 [label="Access variable R|<local>/a|"];
119 [label="Enter safe call"];
120 [label="Function call: $subj$.R|/B.foo|()"];
121 [label="Exit safe call"];
122 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_31 {
color=blue
117 [label="Enter block"];
118 [label="Access variable R|<local>/a|"];
119 [label="Enter safe call"];
120 [label="Function call: $subj$.R|/B.foo|()"];
121 [label="Exit safe call"];
122 [label="Variable declaration: lval x: R|kotlin/Int?|"];
123 [label="Enter when"];
subgraph cluster_32 {
color=blue
123 [label="Enter when"];
subgraph cluster_33 {
color=blue
124 [label="Enter when branch condition "];
125 [label="Access variable R|<local>/x|"];
126 [label="Const: Null(null)"];
127 [label="Equality operator !="];
128 [label="Exit when branch condition"];
}
129 [label="Synthetic else branch"];
130 [label="Enter when branch result"];
subgraph cluster_34 {
color=blue
131 [label="Enter block"];
132 [label="Access variable R|<local>/a|"];
133 [label="Function call: R|<local>/a|.R|/B.bar|()"];
134 [label="Exit block"];
}
135 [label="Exit when branch result"];
136 [label="Exit when"];
124 [label="Enter when branch condition "];
125 [label="Access variable R|<local>/x|"];
126 [label="Const: Null(null)"];
127 [label="Equality operator !="];
128 [label="Exit when branch condition"];
}
137 [label="Exit block"];
129 [label="Synthetic else branch"];
130 [label="Enter when branch result"];
subgraph cluster_33 {
color=blue
131 [label="Enter block"];
132 [label="Access variable R|<local>/a|"];
133 [label="Function call: R|<local>/a|.R|/B.bar|()"];
134 [label="Exit block"];
}
135 [label="Exit when branch result"];
136 [label="Exit when"];
}
138 [label="Exit function test_2" style="filled" fillcolor=red];
137 [label="Exit block"];
}
116 -> {117};
117 -> {118};
118 -> {119 121};
119 -> {120};
120 -> {121};
121 -> {122};
122 -> {123};
123 -> {124};
124 -> {125};
125 -> {126};
126 -> {127};
127 -> {128};
128 -> {130 129};
129 -> {136};
130 -> {131};
131 -> {132};
132 -> {133};
133 -> {134};
134 -> {135};
135 -> {136};
136 -> {137};
137 -> {138};
subgraph cluster_35 {
color=red
139 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_36 {
color=blue
140 [label="Enter block"];
141 [label="Access variable R|<local>/x|"];
142 [label="Type operator: (R|<local>/x| as? R|B|)"];
143 [label="Exit lhs of ?:"];
144 [label="Enter rhs of ?:"];
145 [label="Jump: ^test_3 Unit"];
146 [label="Stub" style="filled" fillcolor=gray];
147 [label="Lhs of ?: is not null"];
148 [label="Exit ?:"];
149 [label="Variable declaration: lval a: R|B|"];
150 [label="Access variable R|<local>/a|"];
151 [label="Function call: R|<local>/a|.R|/B.foo|()"];
152 [label="Access variable R|<local>/x|"];
153 [label="Function call: R|<local>/x|.R|/B.foo|()"];
154 [label="Exit block"];
}
155 [label="Exit function test_3" style="filled" fillcolor=red];
}
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {147 144};
144 -> {145};
145 -> {155};
145 -> {146} [style=dotted];
146 -> {148} [style=dotted];
147 -> {148};
148 -> {149};
149 -> {150};
150 -> {151};
151 -> {152};
152 -> {153};
153 -> {154};
154 -> {155};
138 [label="Exit function test_2" style="filled" fillcolor=red];
}
116 -> {117};
117 -> {118};
118 -> {119 121};
119 -> {120};
120 -> {121};
121 -> {122};
122 -> {123};
123 -> {124};
124 -> {125};
125 -> {126};
126 -> {127};
127 -> {128};
128 -> {130 129};
129 -> {136};
130 -> {131};
131 -> {132};
132 -> {133};
133 -> {134};
134 -> {135};
135 -> {136};
136 -> {137};
137 -> {138};
subgraph cluster_34 {
color=red
139 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_35 {
color=blue
140 [label="Enter block"];
141 [label="Access variable R|<local>/x|"];
142 [label="Type operator: (R|<local>/x| as? R|B|)"];
143 [label="Exit lhs of ?:"];
144 [label="Enter rhs of ?:"];
145 [label="Jump: ^test_3 Unit"];
146 [label="Stub" style="filled" fillcolor=gray];
147 [label="Lhs of ?: is not null"];
148 [label="Exit ?:"];
149 [label="Variable declaration: lval a: R|B|"];
150 [label="Access variable R|<local>/a|"];
151 [label="Function call: R|<local>/a|.R|/B.foo|()"];
152 [label="Access variable R|<local>/x|"];
153 [label="Function call: R|<local>/x|.R|/B.foo|()"];
154 [label="Exit block"];
}
155 [label="Exit function test_3" style="filled" fillcolor=red];
}
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {147 144};
144 -> {145};
145 -> {155};
145 -> {146} [style=dotted];
146 -> {148} [style=dotted];
147 -> {148};
148 -> {149};
149 -> {150};
150 -> {151};
151 -> {152};
152 -> {153};
153 -> {154};
154 -> {155};
}