[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
@@ -12,19 +12,24 @@ digraph bangbang_kt {
subgraph cluster_1 {
color=red
2 [label="Enter class A" style="filled" fillcolor=red];
3 [label="Exit class A" style="filled" fillcolor=red];
3 [label="Enter class A" style="filled" fillcolor=red];
2 [label="Exit class A" style="filled" fillcolor=red];
}
2 -> {3} [color=green];
3 -> {2} [color=green];
subgraph cluster_2 {
color=red
4 [label="Enter function test_0" style="filled" fillcolor=red];
6 [label="Access variable R|<local>/a|"];
7 [label="Check not null: R|<local>/a|!!"];
8 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
9 [label="Access variable R|<local>/a|"];
10 [label="Function call: R|<local>/a|.R|/A.foo|()"];
subgraph cluster_3 {
color=blue
6 [label="Enter block"];
7 [label="Access variable R|<local>/a|"];
8 [label="Check not null: R|<local>/a|!!"];
9 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
10 [label="Access variable R|<local>/a|"];
11 [label="Function call: R|<local>/a|.R|/A.foo|()"];
12 [label="Exit block"];
}
5 [label="Exit function test_0" style="filled" fillcolor=red];
}
4 -> {6};
@@ -32,324 +37,375 @@ digraph bangbang_kt {
7 -> {8};
8 -> {9};
9 -> {10};
10 -> {5};
10 -> {11};
11 -> {12};
12 -> {5};
subgraph cluster_3 {
subgraph cluster_4 {
color=red
11 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_4 {
13 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_5 {
color=blue
13 [label="Enter when"];
subgraph cluster_5 {
color=blue
15 [label="Enter when branch condition "];
16 [label="Access variable R|<local>/a|"];
17 [label="Check not null: R|<local>/a|!!"];
18 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
19 [label="Exit when branch condition"];
}
26 [label="Synthetic else branch"];
20 [label="Enter when branch result"];
15 [label="Enter block"];
subgraph cluster_6 {
color=blue
21 [label="Enter block"];
22 [label="Access variable R|<local>/a|"];
23 [label="Function call: R|<local>/a|.R|/A.foo|()"];
24 [label="Exit block"];
16 [label="Enter when"];
subgraph cluster_7 {
color=blue
18 [label="Enter when branch condition "];
19 [label="Access variable R|<local>/a|"];
20 [label="Check not null: R|<local>/a|!!"];
21 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
22 [label="Exit when branch condition"];
}
29 [label="Synthetic else branch"];
23 [label="Enter when branch result"];
subgraph cluster_8 {
color=blue
24 [label="Enter block"];
25 [label="Access variable R|<local>/a|"];
26 [label="Function call: R|<local>/a|.R|/A.foo|()"];
27 [label="Exit block"];
}
28 [label="Exit when branch result"];
17 [label="Exit when"];
}
25 [label="Exit when branch result"];
14 [label="Exit when"];
30 [label="Access variable R|<local>/a|"];
31 [label="Function call: R|<local>/a|.R|/A.foo|()"];
32 [label="Exit block"];
}
27 [label="Access variable R|<local>/a|"];
28 [label="Function call: R|<local>/a|.R|/A.foo|()"];
12 [label="Exit function test_1" style="filled" fillcolor=red];
14 [label="Exit function test_1" style="filled" fillcolor=red];
}
11 -> {13};
13 -> {15};
14 -> {27};
15 -> {16};
16 -> {17};
17 -> {18};
16 -> {18};
17 -> {30};
18 -> {19};
19 -> {20 26};
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
22 -> {23 29};
23 -> {24};
24 -> {25};
25 -> {14};
26 -> {14};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {12};
28 -> {17};
29 -> {17};
30 -> {31};
31 -> {32};
32 -> {14};
subgraph cluster_7 {
subgraph cluster_9 {
color=red
29 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_8 {
33 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
31 [label="Enter when"];
subgraph cluster_9 {
color=blue
33 [label="Enter when branch condition "];
subgraph cluster_10 {
color=blue
35 [label="Enter &&"];
36 [label="Access variable R|<local>/a|"];
37 [label="Check not null: R|<local>/a|!!"];
38 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
39 [label="Exit left part of &&"];
40 [label="Enter right part of &&"];
41 [label="Access variable R|<local>/b|"];
34 [label="Exit &&"];
}
42 [label="Exit when branch condition"];
}
49 [label="Synthetic else branch"];
43 [label="Enter when branch result"];
35 [label="Enter block"];
subgraph cluster_11 {
color=blue
44 [label="Enter block"];
45 [label="Access variable R|<local>/a|"];
46 [label="Function call: R|<local>/a|.R|/A.foo|()"];
47 [label="Exit block"];
}
48 [label="Exit when branch result"];
32 [label="Exit when"];
}
50 [label="Access variable R|<local>/a|"];
51 [label="Function call: R|<local>/a|.R|/A.foo|()"];
30 [label="Exit function test_2" style="filled" fillcolor=red];
}
29 -> {31};
31 -> {33};
32 -> {50};
33 -> {35};
34 -> {42};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {34 40};
40 -> {41};
41 -> {34};
42 -> {43 49};
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {48};
48 -> {32};
49 -> {32};
50 -> {51};
51 -> {30};
subgraph cluster_12 {
color=red
52 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
54 [label="Enter when"];
subgraph cluster_14 {
color=blue
56 [label="Enter when branch condition "];
subgraph cluster_15 {
36 [label="Enter when"];
subgraph cluster_12 {
color=blue
58 [label="Enter &&"];
59 [label="Access variable R|<local>/b|"];
60 [label="Exit left part of &&"];
61 [label="Enter right part of &&"];
62 [label="Access variable R|<local>/a|"];
63 [label="Check not null: R|<local>/a|!!"];
64 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
57 [label="Exit &&"];
38 [label="Enter when branch condition "];
subgraph cluster_13 {
color=blue
40 [label="Enter &&"];
41 [label="Access variable R|<local>/a|"];
42 [label="Check not null: R|<local>/a|!!"];
43 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
44 [label="Exit left part of &&"];
45 [label="Enter right part of &&"];
46 [label="Access variable R|<local>/b|"];
39 [label="Exit &&"];
}
47 [label="Exit when branch condition"];
}
65 [label="Exit when branch condition"];
54 [label="Synthetic else branch"];
48 [label="Enter when branch result"];
subgraph cluster_14 {
color=blue
49 [label="Enter block"];
50 [label="Access variable R|<local>/a|"];
51 [label="Function call: R|<local>/a|.R|/A.foo|()"];
52 [label="Exit block"];
}
53 [label="Exit when branch result"];
37 [label="Exit when"];
}
72 [label="Synthetic else branch"];
66 [label="Enter when branch result"];
subgraph cluster_16 {
color=blue
67 [label="Enter block"];
68 [label="Access variable R|<local>/a|"];
69 [label="Function call: R|<local>/a|.R|/A.foo|()"];
70 [label="Exit block"];
}
71 [label="Exit when branch result"];
55 [label="Exit when"];
55 [label="Access variable R|<local>/a|"];
56 [label="Function call: R|<local>/a|.R|/A.foo|()"];
57 [label="Exit block"];
}
73 [label="Access variable R|<local>/a|"];
74 [label="Function call: R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
53 [label="Exit function test_3" style="filled" fillcolor=red];
34 [label="Exit function test_2" style="filled" fillcolor=red];
}
52 -> {54};
54 -> {56};
55 -> {73};
56 -> {58};
57 -> {65};
58 -> {59};
59 -> {60};
60 -> {57 61};
61 -> {62};
62 -> {63};
63 -> {64};
64 -> {57};
65 -> {66 72};
33 -> {35};
35 -> {36};
36 -> {38};
37 -> {55};
38 -> {40};
39 -> {47};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {39 45};
45 -> {46};
46 -> {39};
47 -> {48 54};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {37};
54 -> {37};
55 -> {56};
56 -> {57};
57 -> {34};
subgraph cluster_15 {
color=red
58 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_16 {
color=blue
60 [label="Enter block"];
subgraph cluster_17 {
color=blue
61 [label="Enter when"];
subgraph cluster_18 {
color=blue
63 [label="Enter when branch condition "];
subgraph cluster_19 {
color=blue
65 [label="Enter &&"];
66 [label="Access variable R|<local>/b|"];
67 [label="Exit left part of &&"];
68 [label="Enter right part of &&"];
69 [label="Access variable R|<local>/a|"];
70 [label="Check not null: R|<local>/a|!!"];
71 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
64 [label="Exit &&"];
}
72 [label="Exit when branch condition"];
}
79 [label="Synthetic else branch"];
73 [label="Enter when branch result"];
subgraph cluster_20 {
color=blue
74 [label="Enter block"];
75 [label="Access variable R|<local>/a|"];
76 [label="Function call: R|<local>/a|.R|/A.foo|()"];
77 [label="Exit block"];
}
78 [label="Exit when branch result"];
62 [label="Exit when"];
}
80 [label="Access variable R|<local>/a|"];
81 [label="Function call: R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
82 [label="Exit block"];
}
59 [label="Exit function test_3" style="filled" fillcolor=red];
}
58 -> {60};
60 -> {61};
61 -> {63};
62 -> {80};
63 -> {65};
64 -> {72};
65 -> {66};
66 -> {67};
67 -> {68};
67 -> {64 68};
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {55};
72 -> {55};
71 -> {64};
72 -> {73 79};
73 -> {74};
74 -> {53};
subgraph cluster_17 {
color=red
75 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_18 {
color=blue
77 [label="Enter when"];
subgraph cluster_19 {
color=blue
79 [label="Enter when branch condition "];
subgraph cluster_20 {
color=blue
81 [label="Enter ||"];
82 [label="Access variable R|<local>/a|"];
83 [label="Check not null: R|<local>/a|!!"];
84 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
85 [label="Exit left part of ||"];
86 [label="Enter right part of ||"];
87 [label="Access variable R|<local>/b|"];
80 [label="Exit ||"];
}
88 [label="Exit when branch condition"];
}
95 [label="Synthetic else branch"];
89 [label="Enter when branch result"];
subgraph cluster_21 {
color=blue
90 [label="Enter block"];
91 [label="Access variable R|<local>/a|"];
92 [label="Function call: R|<local>/a|.R|/A.foo|()"];
93 [label="Exit block"];
}
94 [label="Exit when branch result"];
78 [label="Exit when"];
}
96 [label="Access variable R|<local>/a|"];
97 [label="Function call: R|<local>/a|.R|/A.foo|()"];
76 [label="Exit function test_4" style="filled" fillcolor=red];
}
75 -> {77};
77 -> {79};
78 -> {96};
79 -> {81};
80 -> {88};
74 -> {75};
75 -> {76};
76 -> {77};
77 -> {78};
78 -> {62};
79 -> {62};
80 -> {81};
81 -> {82};
82 -> {83};
83 -> {84};
84 -> {85};
85 -> {80 86};
86 -> {87};
87 -> {80};
88 -> {89 95};
89 -> {90};
82 -> {59};
subgraph cluster_21 {
color=red
83 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_22 {
color=blue
85 [label="Enter block"];
subgraph cluster_23 {
color=blue
86 [label="Enter when"];
subgraph cluster_24 {
color=blue
88 [label="Enter when branch condition "];
subgraph cluster_25 {
color=blue
90 [label="Enter ||"];
91 [label="Access variable R|<local>/a|"];
92 [label="Check not null: R|<local>/a|!!"];
93 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
94 [label="Exit left part of ||"];
95 [label="Enter right part of ||"];
96 [label="Access variable R|<local>/b|"];
89 [label="Exit ||"];
}
97 [label="Exit when branch condition"];
}
104 [label="Synthetic else branch"];
98 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
99 [label="Enter block"];
100 [label="Access variable R|<local>/a|"];
101 [label="Function call: R|<local>/a|.R|/A.foo|()"];
102 [label="Exit block"];
}
103 [label="Exit when branch result"];
87 [label="Exit when"];
}
105 [label="Access variable R|<local>/a|"];
106 [label="Function call: R|<local>/a|.R|/A.foo|()"];
107 [label="Exit block"];
}
84 [label="Exit function test_4" style="filled" fillcolor=red];
}
83 -> {85};
85 -> {86};
86 -> {88};
87 -> {105};
88 -> {90};
89 -> {97};
90 -> {91};
91 -> {92};
92 -> {93};
93 -> {94};
94 -> {78};
95 -> {78};
96 -> {97};
97 -> {76};
subgraph cluster_22 {
color=red
98 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
100 [label="Enter when"];
subgraph cluster_24 {
color=blue
102 [label="Enter when branch condition "];
subgraph cluster_25 {
color=blue
104 [label="Enter ||"];
105 [label="Access variable R|<local>/b|"];
106 [label="Exit left part of ||"];
107 [label="Enter right part of ||"];
108 [label="Access variable R|<local>/a|"];
109 [label="Check not null: R|<local>/a|!!"];
110 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
103 [label="Exit ||"];
}
111 [label="Exit when branch condition"];
}
118 [label="Synthetic else branch"];
112 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
113 [label="Enter block"];
114 [label="Access variable R|<local>/a|"];
115 [label="Function call: R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
116 [label="Exit block"];
}
117 [label="Exit when branch result"];
101 [label="Exit when"];
}
119 [label="Access variable R|<local>/a|"];
120 [label="Function call: R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
99 [label="Exit function test_5" style="filled" fillcolor=red];
}
98 -> {100};
100 -> {102};
101 -> {119};
102 -> {104};
103 -> {111};
104 -> {105};
94 -> {89 95};
95 -> {96};
96 -> {89};
97 -> {98 104};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {87};
104 -> {87};
105 -> {106};
106 -> {103 107};
107 -> {108};
108 -> {109};
109 -> {110};
110 -> {103};
111 -> {112 118};
112 -> {113};
113 -> {114};
114 -> {115};
115 -> {116};
116 -> {117};
117 -> {101};
118 -> {101};
119 -> {120};
120 -> {99};
106 -> {107};
107 -> {84};
subgraph cluster_27 {
color=red
121 [label="Enter function test_6" style="filled" fillcolor=red];
123 [label="Access variable R|<local>/x|"];
124 [label="Check not null: R|<local>/x|!!"];
125 [label="Function call: R|<local>/x|!!.R|/A.foo|()"];
122 [label="Exit function test_6" style="filled" fillcolor=red];
108 [label="Enter function test_5" style="filled" fillcolor=red];
subgraph cluster_28 {
color=blue
110 [label="Enter block"];
subgraph cluster_29 {
color=blue
111 [label="Enter when"];
subgraph cluster_30 {
color=blue
113 [label="Enter when branch condition "];
subgraph cluster_31 {
color=blue
115 [label="Enter ||"];
116 [label="Access variable R|<local>/b|"];
117 [label="Exit left part of ||"];
118 [label="Enter right part of ||"];
119 [label="Access variable R|<local>/a|"];
120 [label="Check not null: R|<local>/a|!!"];
121 [label="Function call: R|<local>/a|!!.R|/A.foo|()"];
114 [label="Exit ||"];
}
122 [label="Exit when branch condition"];
}
129 [label="Synthetic else branch"];
123 [label="Enter when branch result"];
subgraph cluster_32 {
color=blue
124 [label="Enter block"];
125 [label="Access variable R|<local>/a|"];
126 [label="Function call: R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
127 [label="Exit block"];
}
128 [label="Exit when branch result"];
112 [label="Exit when"];
}
130 [label="Access variable R|<local>/a|"];
131 [label="Function call: R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
132 [label="Exit block"];
}
109 [label="Exit function test_5" style="filled" fillcolor=red];
}
121 -> {123};
108 -> {110};
110 -> {111};
111 -> {113};
112 -> {130};
113 -> {115};
114 -> {122};
115 -> {116};
116 -> {117};
117 -> {114 118};
118 -> {119};
119 -> {120};
120 -> {121};
121 -> {114};
122 -> {123 129};
123 -> {124};
124 -> {125};
125 -> {122};
125 -> {126};
126 -> {127};
127 -> {128};
128 -> {112};
129 -> {112};
130 -> {131};
131 -> {132};
132 -> {109};
subgraph cluster_28 {
subgraph cluster_33 {
color=red
126 [label="Enter function test_7" style="filled" fillcolor=red];
128 [label="Access variable R|<local>/x|"];
129 [label="Check not null: R|<local>/x|!!"];
130 [label="Function call: R|<local>/x|!!.R|/A.foo|()"];
127 [label="Exit function test_7" style="filled" fillcolor=red];
133 [label="Enter function test_6" style="filled" fillcolor=red];
subgraph cluster_34 {
color=blue
135 [label="Enter block"];
136 [label="Access variable R|<local>/x|"];
137 [label="Check not null: R|<local>/x|!!"];
138 [label="Function call: R|<local>/x|!!.R|/A.foo|()"];
139 [label="Exit block"];
}
134 [label="Exit function test_6" style="filled" fillcolor=red];
}
126 -> {128};
128 -> {129};
129 -> {130};
130 -> {127};
133 -> {135};
135 -> {136};
136 -> {137};
137 -> {138};
138 -> {139};
139 -> {134};
subgraph cluster_35 {
color=red
140 [label="Enter function test_7" style="filled" fillcolor=red];
subgraph cluster_36 {
color=blue
142 [label="Enter block"];
143 [label="Access variable R|<local>/x|"];
144 [label="Check not null: R|<local>/x|!!"];
145 [label="Function call: R|<local>/x|!!.R|/A.foo|()"];
146 [label="Exit block"];
}
141 [label="Exit function test_7" style="filled" fillcolor=red];
}
140 -> {142};
142 -> {143};
143 -> {144};
144 -> {145};
145 -> {146};
146 -> {141};
}