[FIR] Introduce new algorithm for building CFG for declarations

This commit is contained in:
Dmitriy Novozhilov
2020-06-05 15:47:57 +03:00
parent 950bbfe3a5
commit 87859b0faa
95 changed files with 16070 additions and 13199 deletions
@@ -8,411 +8,467 @@ digraph booleanOperatorsWithConsts_kt {
0 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_1 {
color=blue
2 [label="Enter when"];
2 [label="Enter block"];
subgraph cluster_2 {
color=blue
4 [label="Enter when branch condition "];
3 [label="Enter when"];
subgraph cluster_3 {
color=blue
6 [label="Enter ||"];
7 [label="Access variable R|<local>/b|"];
8 [label="Exit left part of ||"];
9 [label="Enter right part of ||"];
10 [label="Const: Boolean(false)"];
5 [label="Exit ||"];
5 [label="Enter when branch condition "];
subgraph cluster_4 {
color=blue
7 [label="Enter ||"];
8 [label="Access variable R|<local>/b|"];
9 [label="Exit left part of ||"];
10 [label="Enter right part of ||"];
11 [label="Const: Boolean(false)"];
6 [label="Exit ||"];
}
12 [label="Exit when branch condition"];
}
11 [label="Exit when branch condition"];
18 [label="Synthetic else branch"];
13 [label="Enter when branch result"];
subgraph cluster_5 {
color=blue
14 [label="Enter block"];
15 [label="Const: Int(1)"];
16 [label="Exit block"];
}
17 [label="Exit when branch result"];
4 [label="Exit when"];
}
17 [label="Synthetic else branch"];
12 [label="Enter when branch result"];
subgraph cluster_4 {
color=blue
13 [label="Enter block"];
14 [label="Const: Int(1)"];
15 [label="Exit block"];
}
16 [label="Exit when branch result"];
3 [label="Exit when"];
19 [label="Exit block"];
}
1 [label="Exit function test_1" style="filled" fillcolor=red];
}
0 -> {2};
2 -> {4};
3 -> {1};
4 -> {6};
5 -> {11};
6 -> {7};
2 -> {3};
3 -> {5};
4 -> {19};
5 -> {7};
6 -> {12};
7 -> {8};
8 -> {5 9};
9 -> {10};
10 -> {5};
11 -> {12 17};
12 -> {13};
8 -> {9};
9 -> {6 10};
10 -> {11};
11 -> {6};
12 -> {13 18};
13 -> {14};
14 -> {15};
15 -> {16};
16 -> {3};
17 -> {3};
16 -> {17};
17 -> {4};
18 -> {4};
19 -> {1};
subgraph cluster_5 {
subgraph cluster_6 {
color=red
18 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_6 {
20 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_7 {
color=blue
20 [label="Enter when"];
subgraph cluster_7 {
22 [label="Enter block"];
subgraph cluster_8 {
color=blue
22 [label="Enter when branch condition "];
subgraph cluster_8 {
23 [label="Enter when"];
subgraph cluster_9 {
color=blue
24 [label="Enter ||"];
25 [label="Const: Boolean(false)"];
26 [label="Exit left part of ||"];
27 [label="Enter right part of ||"];
28 [label="Access variable R|<local>/b|"];
23 [label="Exit ||"];
25 [label="Enter when branch condition "];
subgraph cluster_10 {
color=blue
27 [label="Enter ||"];
28 [label="Const: Boolean(false)"];
29 [label="Exit left part of ||"];
30 [label="Enter right part of ||"];
31 [label="Access variable R|<local>/b|"];
26 [label="Exit ||"];
}
32 [label="Exit when branch condition"];
}
29 [label="Exit when branch condition"];
38 [label="Synthetic else branch"];
33 [label="Enter when branch result"];
subgraph cluster_11 {
color=blue
34 [label="Enter block"];
35 [label="Const: Int(1)"];
36 [label="Exit block"];
}
37 [label="Exit when branch result"];
24 [label="Exit when"];
}
35 [label="Synthetic else branch"];
30 [label="Enter when branch result"];
subgraph cluster_9 {
color=blue
31 [label="Enter block"];
32 [label="Const: Int(1)"];
33 [label="Exit block"];
}
34 [label="Exit when branch result"];
21 [label="Exit when"];
39 [label="Exit block"];
}
19 [label="Exit function test_2" style="filled" fillcolor=red];
21 [label="Exit function test_2" style="filled" fillcolor=red];
}
18 -> {20};
20 -> {22};
21 -> {19};
22 -> {24};
23 -> {29};
24 -> {25};
25 -> {26};
26 -> {27};
26 -> {23} [style=dotted];
22 -> {23};
23 -> {25};
24 -> {39};
25 -> {27};
26 -> {32};
27 -> {28};
28 -> {23};
29 -> {30 35};
28 -> {29};
29 -> {30};
29 -> {26} [style=dotted];
30 -> {31};
31 -> {32};
32 -> {33};
31 -> {26};
32 -> {33 38};
33 -> {34};
34 -> {21};
35 -> {21};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {24};
38 -> {24};
39 -> {21};
subgraph cluster_10 {
subgraph cluster_12 {
color=red
36 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_11 {
40 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
38 [label="Enter when"];
subgraph cluster_12 {
color=blue
40 [label="Enter when branch condition "];
subgraph cluster_13 {
color=blue
42 [label="Enter ||"];
43 [label="Access variable R|<local>/b|"];
44 [label="Exit left part of ||"];
45 [label="Enter right part of ||"];
46 [label="Const: Boolean(true)"];
41 [label="Exit ||"];
}
47 [label="Exit when branch condition"];
}
53 [label="Synthetic else branch"];
48 [label="Enter when branch result"];
42 [label="Enter block"];
subgraph cluster_14 {
color=blue
49 [label="Enter block"];
50 [label="Const: Int(1)"];
51 [label="Exit block"];
}
52 [label="Exit when branch result"];
39 [label="Exit when"];
}
37 [label="Exit function test_3" style="filled" fillcolor=red];
}
36 -> {38};
38 -> {40};
39 -> {37};
40 -> {42};
41 -> {47};
42 -> {43};
43 -> {44};
44 -> {41 45};
45 -> {46};
46 -> {41};
47 -> {48 53};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {39};
53 -> {39};
subgraph cluster_15 {
color=red
54 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_16 {
color=blue
56 [label="Enter when"];
subgraph cluster_17 {
color=blue
58 [label="Enter when branch condition "];
subgraph cluster_18 {
43 [label="Enter when"];
subgraph cluster_15 {
color=blue
60 [label="Enter ||"];
61 [label="Const: Boolean(true)"];
62 [label="Exit left part of ||"];
63 [label="Enter right part of ||" style="filled" fillcolor=gray];
64 [label="Access variable R|<local>/b|" style="filled" fillcolor=gray];
59 [label="Exit ||"];
45 [label="Enter when branch condition "];
subgraph cluster_16 {
color=blue
47 [label="Enter ||"];
48 [label="Access variable R|<local>/b|"];
49 [label="Exit left part of ||"];
50 [label="Enter right part of ||"];
51 [label="Const: Boolean(true)"];
46 [label="Exit ||"];
}
52 [label="Exit when branch condition"];
}
65 [label="Exit when branch condition"];
58 [label="Synthetic else branch"];
53 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
54 [label="Enter block"];
55 [label="Const: Int(1)"];
56 [label="Exit block"];
}
57 [label="Exit when branch result"];
44 [label="Exit when"];
}
71 [label="Synthetic else branch"];
66 [label="Enter when branch result"];
subgraph cluster_19 {
color=blue
67 [label="Enter block"];
68 [label="Const: Int(1)"];
69 [label="Exit block"];
}
70 [label="Exit when branch result"];
57 [label="Exit when"];
59 [label="Exit block"];
}
55 [label="Exit function test_4" style="filled" fillcolor=red];
41 [label="Exit function test_3" style="filled" fillcolor=red];
}
54 -> {56};
56 -> {58};
57 -> {55};
58 -> {60};
59 -> {65};
60 -> {61};
61 -> {62};
62 -> {59};
62 -> {63} [style=dotted];
63 -> {64} [style=dotted];
64 -> {59} [style=dotted];
65 -> {66 71};
66 -> {67};
67 -> {68};
68 -> {69};
69 -> {70};
70 -> {57};
71 -> {57};
40 -> {42};
42 -> {43};
43 -> {45};
44 -> {59};
45 -> {47};
46 -> {52};
47 -> {48};
48 -> {49};
49 -> {46 50};
50 -> {51};
51 -> {46};
52 -> {53 58};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {44};
58 -> {44};
59 -> {41};
subgraph cluster_20 {
subgraph cluster_18 {
color=red
72 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_21 {
60 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_19 {
color=blue
74 [label="Enter when"];
subgraph cluster_22 {
62 [label="Enter block"];
subgraph cluster_20 {
color=blue
76 [label="Enter when branch condition "];
63 [label="Enter when"];
subgraph cluster_21 {
color=blue
65 [label="Enter when branch condition "];
subgraph cluster_22 {
color=blue
67 [label="Enter ||"];
68 [label="Const: Boolean(true)"];
69 [label="Exit left part of ||"];
70 [label="Enter right part of ||" style="filled" fillcolor=gray];
71 [label="Access variable R|<local>/b|" style="filled" fillcolor=gray];
66 [label="Exit ||"];
}
72 [label="Exit when branch condition"];
}
78 [label="Synthetic else branch"];
73 [label="Enter when branch result"];
subgraph cluster_23 {
color=blue
78 [label="Enter &&"];
79 [label="Access variable R|<local>/b|"];
80 [label="Exit left part of &&"];
81 [label="Enter right part of &&"];
82 [label="Const: Boolean(false)"];
77 [label="Exit &&"];
74 [label="Enter block"];
75 [label="Const: Int(1)"];
76 [label="Exit block"];
}
83 [label="Exit when branch condition"];
77 [label="Exit when branch result"];
64 [label="Exit when"];
}
89 [label="Synthetic else branch"];
84 [label="Enter when branch result"];
subgraph cluster_24 {
color=blue
85 [label="Enter block"];
86 [label="Const: Int(1)"];
87 [label="Exit block"];
}
88 [label="Exit when branch result"];
75 [label="Exit when"];
79 [label="Exit block"];
}
73 [label="Exit function test_5" style="filled" fillcolor=red];
61 [label="Exit function test_4" style="filled" fillcolor=red];
}
72 -> {74};
74 -> {76};
75 -> {73};
76 -> {78};
77 -> {83};
78 -> {79};
79 -> {80};
80 -> {77 81};
81 -> {82};
82 -> {77};
83 -> {84 89};
84 -> {85};
85 -> {86};
86 -> {87};
87 -> {88};
88 -> {75};
89 -> {75};
60 -> {62};
62 -> {63};
63 -> {65};
64 -> {79};
65 -> {67};
66 -> {72};
67 -> {68};
68 -> {69};
69 -> {66};
69 -> {70} [style=dotted];
70 -> {71} [style=dotted];
71 -> {66} [style=dotted];
72 -> {73 78};
73 -> {74};
74 -> {75};
75 -> {76};
76 -> {77};
77 -> {64};
78 -> {64};
79 -> {61};
subgraph cluster_25 {
subgraph cluster_24 {
color=red
90 [label="Enter function test_6" style="filled" fillcolor=red];
subgraph cluster_26 {
80 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_25 {
color=blue
92 [label="Enter when"];
subgraph cluster_27 {
82 [label="Enter block"];
subgraph cluster_26 {
color=blue
94 [label="Enter when branch condition "];
subgraph cluster_28 {
83 [label="Enter when"];
subgraph cluster_27 {
color=blue
96 [label="Enter &&"];
97 [label="Const: Boolean(false)"];
98 [label="Exit left part of &&"];
99 [label="Enter right part of &&" style="filled" fillcolor=gray];
100 [label="Access variable R|<local>/b|" style="filled" fillcolor=gray];
95 [label="Exit &&"];
85 [label="Enter when branch condition "];
subgraph cluster_28 {
color=blue
87 [label="Enter &&"];
88 [label="Access variable R|<local>/b|"];
89 [label="Exit left part of &&"];
90 [label="Enter right part of &&"];
91 [label="Const: Boolean(false)"];
86 [label="Exit &&"];
}
92 [label="Exit when branch condition"];
}
101 [label="Exit when branch condition"];
98 [label="Synthetic else branch"];
93 [label="Enter when branch result"];
subgraph cluster_29 {
color=blue
94 [label="Enter block"];
95 [label="Const: Int(1)"];
96 [label="Exit block"];
}
97 [label="Exit when branch result"];
84 [label="Exit when"];
}
107 [label="Synthetic else branch"];
102 [label="Enter when branch result"];
subgraph cluster_29 {
color=blue
103 [label="Enter block"];
104 [label="Const: Int(1)"];
105 [label="Exit block"];
}
106 [label="Exit when branch result"];
93 [label="Exit when"];
99 [label="Exit block"];
}
91 [label="Exit function test_6" style="filled" fillcolor=red];
81 [label="Exit function test_5" style="filled" fillcolor=red];
}
90 -> {92};
92 -> {94};
93 -> {91};
94 -> {96};
95 -> {101};
80 -> {82};
82 -> {83};
83 -> {85};
84 -> {99};
85 -> {87};
86 -> {92};
87 -> {88};
88 -> {89};
89 -> {86 90};
90 -> {91};
91 -> {86};
92 -> {93 98};
93 -> {94};
94 -> {95};
95 -> {96};
96 -> {97};
97 -> {98};
98 -> {95};
98 -> {99} [style=dotted];
99 -> {100} [style=dotted];
100 -> {95} [style=dotted];
101 -> {102 107};
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {106};
106 -> {93};
107 -> {93};
97 -> {84};
98 -> {84};
99 -> {81};
subgraph cluster_30 {
color=red
108 [label="Enter function test_7" style="filled" fillcolor=red];
100 [label="Enter function test_6" style="filled" fillcolor=red];
subgraph cluster_31 {
color=blue
110 [label="Enter when"];
102 [label="Enter block"];
subgraph cluster_32 {
color=blue
112 [label="Enter when branch condition "];
103 [label="Enter when"];
subgraph cluster_33 {
color=blue
114 [label="Enter &&"];
115 [label="Access variable R|<local>/b|"];
116 [label="Exit left part of &&"];
117 [label="Enter right part of &&"];
118 [label="Const: Boolean(true)"];
113 [label="Exit &&"];
105 [label="Enter when branch condition "];
subgraph cluster_34 {
color=blue
107 [label="Enter &&"];
108 [label="Const: Boolean(false)"];
109 [label="Exit left part of &&"];
110 [label="Enter right part of &&" style="filled" fillcolor=gray];
111 [label="Access variable R|<local>/b|" style="filled" fillcolor=gray];
106 [label="Exit &&"];
}
112 [label="Exit when branch condition"];
}
119 [label="Exit when branch condition"];
118 [label="Synthetic else branch"];
113 [label="Enter when branch result"];
subgraph cluster_35 {
color=blue
114 [label="Enter block"];
115 [label="Const: Int(1)"];
116 [label="Exit block"];
}
117 [label="Exit when branch result"];
104 [label="Exit when"];
}
125 [label="Synthetic else branch"];
120 [label="Enter when branch result"];
subgraph cluster_34 {
color=blue
121 [label="Enter block"];
122 [label="Const: Int(1)"];
123 [label="Exit block"];
}
124 [label="Exit when branch result"];
111 [label="Exit when"];
119 [label="Exit block"];
}
109 [label="Exit function test_7" style="filled" fillcolor=red];
101 [label="Exit function test_6" style="filled" fillcolor=red];
}
108 -> {110};
110 -> {112};
111 -> {109};
112 -> {114};
113 -> {119};
100 -> {102};
102 -> {103};
103 -> {105};
104 -> {119};
105 -> {107};
106 -> {112};
107 -> {108};
108 -> {109};
109 -> {106};
109 -> {110} [style=dotted];
110 -> {111} [style=dotted];
111 -> {106} [style=dotted];
112 -> {113 118};
113 -> {114};
114 -> {115};
115 -> {116};
116 -> {113 117};
117 -> {118};
118 -> {113};
119 -> {120 125};
120 -> {121};
121 -> {122};
122 -> {123};
123 -> {124};
124 -> {111};
125 -> {111};
116 -> {117};
117 -> {104};
118 -> {104};
119 -> {101};
subgraph cluster_35 {
subgraph cluster_36 {
color=red
126 [label="Enter function test_8" style="filled" fillcolor=red];
subgraph cluster_36 {
120 [label="Enter function test_7" style="filled" fillcolor=red];
subgraph cluster_37 {
color=blue
128 [label="Enter when"];
subgraph cluster_37 {
122 [label="Enter block"];
subgraph cluster_38 {
color=blue
130 [label="Enter when branch condition "];
subgraph cluster_38 {
123 [label="Enter when"];
subgraph cluster_39 {
color=blue
132 [label="Enter &&"];
133 [label="Const: Boolean(true)"];
134 [label="Exit left part of &&"];
135 [label="Enter right part of &&"];
136 [label="Access variable R|<local>/b|"];
131 [label="Exit &&"];
125 [label="Enter when branch condition "];
subgraph cluster_40 {
color=blue
127 [label="Enter &&"];
128 [label="Access variable R|<local>/b|"];
129 [label="Exit left part of &&"];
130 [label="Enter right part of &&"];
131 [label="Const: Boolean(true)"];
126 [label="Exit &&"];
}
132 [label="Exit when branch condition"];
}
137 [label="Exit when branch condition"];
138 [label="Synthetic else branch"];
133 [label="Enter when branch result"];
subgraph cluster_41 {
color=blue
134 [label="Enter block"];
135 [label="Const: Int(1)"];
136 [label="Exit block"];
}
137 [label="Exit when branch result"];
124 [label="Exit when"];
}
143 [label="Synthetic else branch"];
138 [label="Enter when branch result"];
subgraph cluster_39 {
color=blue
139 [label="Enter block"];
140 [label="Const: Int(1)"];
141 [label="Exit block"];
}
142 [label="Exit when branch result"];
129 [label="Exit when"];
139 [label="Exit block"];
}
127 [label="Exit function test_8" style="filled" fillcolor=red];
121 [label="Exit function test_7" style="filled" fillcolor=red];
}
126 -> {128};
128 -> {130};
129 -> {127};
130 -> {132};
131 -> {137};
132 -> {133};
120 -> {122};
122 -> {123};
123 -> {125};
124 -> {139};
125 -> {127};
126 -> {132};
127 -> {128};
128 -> {129};
129 -> {126 130};
130 -> {131};
131 -> {126};
132 -> {133 138};
133 -> {134};
134 -> {135};
134 -> {131} [style=dotted];
135 -> {136};
136 -> {131};
137 -> {138 143};
138 -> {139};
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {129};
143 -> {129};
136 -> {137};
137 -> {124};
138 -> {124};
139 -> {121};
subgraph cluster_42 {
color=red
140 [label="Enter function test_8" style="filled" fillcolor=red];
subgraph cluster_43 {
color=blue
142 [label="Enter block"];
subgraph cluster_44 {
color=blue
143 [label="Enter when"];
subgraph cluster_45 {
color=blue
145 [label="Enter when branch condition "];
subgraph cluster_46 {
color=blue
147 [label="Enter &&"];
148 [label="Const: Boolean(true)"];
149 [label="Exit left part of &&"];
150 [label="Enter right part of &&"];
151 [label="Access variable R|<local>/b|"];
146 [label="Exit &&"];
}
152 [label="Exit when branch condition"];
}
158 [label="Synthetic else branch"];
153 [label="Enter when branch result"];
subgraph cluster_47 {
color=blue
154 [label="Enter block"];
155 [label="Const: Int(1)"];
156 [label="Exit block"];
}
157 [label="Exit when branch result"];
144 [label="Exit when"];
}
159 [label="Exit block"];
}
141 [label="Exit function test_8" style="filled" fillcolor=red];
}
140 -> {142};
142 -> {143};
143 -> {145};
144 -> {159};
145 -> {147};
146 -> {152};
147 -> {148};
148 -> {149};
149 -> {150};
149 -> {146} [style=dotted];
150 -> {151};
151 -> {146};
152 -> {153 158};
153 -> {154};
154 -> {155};
155 -> {156};
156 -> {157};
157 -> {144};
158 -> {144};
159 -> {141};
}