[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,314 +12,335 @@ digraph equalsAndIdentity_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_1" style="filled" fillcolor=red];
subgraph cluster_3 {
color=blue
6 [label="Enter when"];
6 [label="Enter block"];
subgraph cluster_4 {
color=blue
8 [label="Enter when branch condition "];
9 [label="Access variable R|<local>/x|"];
10 [label="Access variable R|<local>/y|"];
11 [label="Operator =="];
12 [label="Exit when branch condition"];
7 [label="Enter when"];
subgraph cluster_5 {
color=blue
9 [label="Enter when branch condition "];
10 [label="Access variable R|<local>/x|"];
11 [label="Access variable R|<local>/y|"];
12 [label="Operator =="];
13 [label="Exit when branch condition"];
}
22 [label="Synthetic else branch"];
14 [label="Enter when branch result"];
subgraph cluster_6 {
color=blue
15 [label="Enter block"];
16 [label="Access variable R|<local>/x|"];
17 [label="Function call: R|<local>/x|.R|/A.foo|()"];
18 [label="Access variable R|<local>/y|"];
19 [label="Function call: R|<local>/y|.R|/A.foo|()"];
20 [label="Exit block"];
}
21 [label="Exit when branch result"];
8 [label="Exit when"];
}
21 [label="Synthetic else branch"];
13 [label="Enter when branch result"];
subgraph cluster_5 {
color=blue
14 [label="Enter block"];
15 [label="Access variable R|<local>/x|"];
16 [label="Function call: R|<local>/x|.R|/A.foo|()"];
17 [label="Access variable R|<local>/y|"];
18 [label="Function call: R|<local>/y|.R|/A.foo|()"];
19 [label="Exit block"];
}
20 [label="Exit when branch result"];
7 [label="Exit when"];
}
subgraph cluster_6 {
color=blue
22 [label="Enter when"];
subgraph cluster_7 {
color=blue
24 [label="Enter when branch condition "];
25 [label="Access variable R|<local>/x|"];
26 [label="Access variable R|<local>/y|"];
27 [label="Operator ==="];
28 [label="Exit when branch condition"];
23 [label="Enter when"];
subgraph cluster_8 {
color=blue
25 [label="Enter when branch condition "];
26 [label="Access variable R|<local>/x|"];
27 [label="Access variable R|<local>/y|"];
28 [label="Operator ==="];
29 [label="Exit when branch condition"];
}
38 [label="Synthetic else branch"];
30 [label="Enter when branch result"];
subgraph cluster_9 {
color=blue
31 [label="Enter block"];
32 [label="Access variable R|<local>/x|"];
33 [label="Function call: R|<local>/x|.R|/A.foo|()"];
34 [label="Access variable R|<local>/y|"];
35 [label="Function call: R|<local>/y|.R|/A.foo|()"];
36 [label="Exit block"];
}
37 [label="Exit when branch result"];
24 [label="Exit when"];
}
37 [label="Synthetic else branch"];
29 [label="Enter when branch result"];
subgraph cluster_8 {
color=blue
30 [label="Enter block"];
31 [label="Access variable R|<local>/x|"];
32 [label="Function call: R|<local>/x|.R|/A.foo|()"];
33 [label="Access variable R|<local>/y|"];
34 [label="Function call: R|<local>/y|.R|/A.foo|()"];
35 [label="Exit block"];
}
36 [label="Exit when branch result"];
23 [label="Exit when"];
39 [label="Exit block"];
}
5 [label="Exit function test_1" style="filled" fillcolor=red];
}
4 -> {6};
6 -> {8};
7 -> {22};
8 -> {9};
6 -> {7};
7 -> {9};
8 -> {23};
9 -> {10};
10 -> {11};
11 -> {12};
12 -> {13 21};
13 -> {14};
12 -> {13};
13 -> {14 22};
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {20};
20 -> {7};
21 -> {7};
22 -> {24};
23 -> {5};
24 -> {25};
20 -> {21};
21 -> {8};
22 -> {8};
23 -> {25};
24 -> {39};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {29 37};
29 -> {30};
28 -> {29};
29 -> {30 38};
30 -> {31};
31 -> {32};
32 -> {33};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {23};
37 -> {23};
36 -> {37};
37 -> {24};
38 -> {24};
39 -> {5};
subgraph cluster_9 {
subgraph cluster_10 {
color=red
38 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_10 {
40 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_11 {
color=blue
40 [label="Enter when"];
subgraph cluster_11 {
color=blue
42 [label="Enter when branch condition "];
43 [label="Access variable R|<local>/x|"];
44 [label="Access variable R|<local>/y|"];
45 [label="Operator =="];
46 [label="Exit when branch condition"];
}
55 [label="Synthetic else branch"];
47 [label="Enter when branch result"];
42 [label="Enter block"];
subgraph cluster_12 {
color=blue
48 [label="Enter block"];
49 [label="Access variable R|<local>/x|"];
50 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
51 [label="Access variable R|<local>/y|"];
52 [label="Function call: R|<local>/y|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
53 [label="Exit block"];
43 [label="Enter when"];
subgraph cluster_13 {
color=blue
45 [label="Enter when branch condition "];
46 [label="Access variable R|<local>/x|"];
47 [label="Access variable R|<local>/y|"];
48 [label="Operator =="];
49 [label="Exit when branch condition"];
}
58 [label="Synthetic else branch"];
50 [label="Enter when branch result"];
subgraph cluster_14 {
color=blue
51 [label="Enter block"];
52 [label="Access variable R|<local>/x|"];
53 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
54 [label="Access variable R|<local>/y|"];
55 [label="Function call: R|<local>/y|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
56 [label="Exit block"];
}
57 [label="Exit when branch result"];
44 [label="Exit when"];
}
54 [label="Exit when branch result"];
41 [label="Exit when"];
}
subgraph cluster_13 {
color=blue
56 [label="Enter when"];
subgraph cluster_14 {
color=blue
58 [label="Enter when branch condition "];
59 [label="Access variable R|<local>/x|"];
60 [label="Access variable R|<local>/y|"];
61 [label="Operator ==="];
62 [label="Exit when branch condition"];
}
71 [label="Synthetic else branch"];
63 [label="Enter when branch result"];
subgraph cluster_15 {
color=blue
64 [label="Enter block"];
65 [label="Access variable R|<local>/x|"];
66 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
67 [label="Access variable R|<local>/y|"];
68 [label="Function call: R|<local>/y|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
69 [label="Exit block"];
59 [label="Enter when"];
subgraph cluster_16 {
color=blue
61 [label="Enter when branch condition "];
62 [label="Access variable R|<local>/x|"];
63 [label="Access variable R|<local>/y|"];
64 [label="Operator ==="];
65 [label="Exit when branch condition"];
}
74 [label="Synthetic else branch"];
66 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
67 [label="Enter block"];
68 [label="Access variable R|<local>/x|"];
69 [label="Function call: R|<local>/x|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
70 [label="Access variable R|<local>/y|"];
71 [label="Function call: R|<local>/y|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()"];
72 [label="Exit block"];
}
73 [label="Exit when branch result"];
60 [label="Exit when"];
}
70 [label="Exit when branch result"];
57 [label="Exit when"];
75 [label="Exit block"];
}
39 [label="Exit function test_2" style="filled" fillcolor=red];
41 [label="Exit function test_2" style="filled" fillcolor=red];
}
38 -> {40};
40 -> {42};
41 -> {56};
42 -> {43};
43 -> {44};
44 -> {45};
43 -> {45};
44 -> {59};
45 -> {46};
46 -> {47 55};
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {50};
49 -> {50 58};
50 -> {51};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {41};
55 -> {41};
56 -> {58};
57 -> {39};
58 -> {59};
59 -> {60};
60 -> {61};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {44};
58 -> {44};
59 -> {61};
60 -> {75};
61 -> {62};
62 -> {63 71};
62 -> {63};
63 -> {64};
64 -> {65};
65 -> {66};
65 -> {66 74};
66 -> {67};
67 -> {68};
68 -> {69};
69 -> {70};
70 -> {57};
71 -> {57};
70 -> {71};
71 -> {72};
72 -> {73};
73 -> {60};
74 -> {60};
75 -> {41};
subgraph cluster_16 {
subgraph cluster_18 {
color=red
72 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_17 {
76 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_19 {
color=blue
74 [label="Enter when"];
subgraph cluster_18 {
78 [label="Enter block"];
subgraph cluster_20 {
color=blue
76 [label="Enter when branch condition "];
77 [label="Access variable R|<local>/y|"];
78 [label="Const: Null(null)"];
79 [label="Operator =="];
80 [label="Exit when branch condition"];
79 [label="Enter when"];
subgraph cluster_21 {
color=blue
81 [label="Enter when branch condition "];
82 [label="Access variable R|<local>/y|"];
83 [label="Const: Null(null)"];
84 [label="Operator =="];
85 [label="Exit when branch condition"];
}
92 [label="Synthetic else branch"];
86 [label="Enter when branch result"];
subgraph cluster_22 {
color=blue
87 [label="Enter block"];
88 [label="Jump: ^test_3 Unit"];
89 [label="Stub" style="filled" fillcolor=gray];
90 [label="Exit block" style="filled" fillcolor=gray];
}
91 [label="Exit when branch result" style="filled" fillcolor=gray];
80 [label="Exit when"];
}
87 [label="Synthetic else branch"];
81 [label="Enter when branch result"];
subgraph cluster_19 {
subgraph cluster_23 {
color=blue
82 [label="Enter block"];
83 [label="Jump: ^test_3 Unit"];
84 [label="Stub" style="filled" fillcolor=gray];
85 [label="Exit block" style="filled" fillcolor=gray];
93 [label="Enter when"];
subgraph cluster_24 {
color=blue
95 [label="Enter when branch condition "];
96 [label="Access variable R|<local>/x|"];
97 [label="Access variable R|<local>/y|"];
98 [label="Operator =="];
99 [label="Exit when branch condition"];
}
108 [label="Synthetic else branch"];
100 [label="Enter when branch result"];
subgraph cluster_25 {
color=blue
101 [label="Enter block"];
102 [label="Access variable R|<local>/x|"];
103 [label="Function call: R|<local>/x|.R|/A.foo|()"];
104 [label="Access variable R|<local>/y|"];
105 [label="Function call: R|<local>/y|.R|/A.foo|()"];
106 [label="Exit block"];
}
107 [label="Exit when branch result"];
94 [label="Exit when"];
}
86 [label="Exit when branch result" style="filled" fillcolor=gray];
75 [label="Exit when"];
subgraph cluster_26 {
color=blue
109 [label="Enter when"];
subgraph cluster_27 {
color=blue
111 [label="Enter when branch condition "];
112 [label="Access variable R|<local>/x|"];
113 [label="Access variable R|<local>/y|"];
114 [label="Operator ==="];
115 [label="Exit when branch condition"];
}
124 [label="Synthetic else branch"];
116 [label="Enter when branch result"];
subgraph cluster_28 {
color=blue
117 [label="Enter block"];
118 [label="Access variable R|<local>/x|"];
119 [label="Function call: R|<local>/x|.R|/A.foo|()"];
120 [label="Access variable R|<local>/y|"];
121 [label="Function call: R|<local>/y|.R|/A.foo|()"];
122 [label="Exit block"];
}
123 [label="Exit when branch result"];
110 [label="Exit when"];
}
125 [label="Exit block"];
}
subgraph cluster_20 {
color=blue
88 [label="Enter when"];
subgraph cluster_21 {
color=blue
90 [label="Enter when branch condition "];
91 [label="Access variable R|<local>/x|"];
92 [label="Access variable R|<local>/y|"];
93 [label="Operator =="];
94 [label="Exit when branch condition"];
}
103 [label="Synthetic else branch"];
95 [label="Enter when branch result"];
subgraph cluster_22 {
color=blue
96 [label="Enter block"];
97 [label="Access variable R|<local>/x|"];
98 [label="Function call: R|<local>/x|.R|/A.foo|()"];
99 [label="Access variable R|<local>/y|"];
100 [label="Function call: R|<local>/y|.R|/A.foo|()"];
101 [label="Exit block"];
}
102 [label="Exit when branch result"];
89 [label="Exit when"];
}
subgraph cluster_23 {
color=blue
104 [label="Enter when"];
subgraph cluster_24 {
color=blue
106 [label="Enter when branch condition "];
107 [label="Access variable R|<local>/x|"];
108 [label="Access variable R|<local>/y|"];
109 [label="Operator ==="];
110 [label="Exit when branch condition"];
}
119 [label="Synthetic else branch"];
111 [label="Enter when branch result"];
subgraph cluster_25 {
color=blue
112 [label="Enter block"];
113 [label="Access variable R|<local>/x|"];
114 [label="Function call: R|<local>/x|.R|/A.foo|()"];
115 [label="Access variable R|<local>/y|"];
116 [label="Function call: R|<local>/y|.R|/A.foo|()"];
117 [label="Exit block"];
}
118 [label="Exit when branch result"];
105 [label="Exit when"];
}
73 [label="Exit function test_3" style="filled" fillcolor=red];
77 [label="Exit function test_3" style="filled" fillcolor=red];
}
72 -> {74};
74 -> {76};
75 -> {88};
76 -> {77};
77 -> {78};
76 -> {78};
78 -> {79};
79 -> {80};
80 -> {81 87};
79 -> {81};
80 -> {93};
81 -> {82};
82 -> {83};
83 -> {73};
83 -> {84} [style=dotted];
84 -> {85} [style=dotted];
85 -> {86} [style=dotted];
86 -> {75} [style=dotted];
87 -> {75};
88 -> {90};
89 -> {104};
90 -> {91};
91 -> {92};
92 -> {93};
93 -> {94};
94 -> {95 103};
83 -> {84};
84 -> {85};
85 -> {86 92};
86 -> {87};
87 -> {88};
88 -> {77};
88 -> {89} [style=dotted];
89 -> {90} [style=dotted];
90 -> {91} [style=dotted];
91 -> {80} [style=dotted];
92 -> {80};
93 -> {95};
94 -> {109};
95 -> {96};
96 -> {97};
97 -> {98};
98 -> {99};
99 -> {100};
99 -> {100 108};
100 -> {101};
101 -> {102};
102 -> {89};
103 -> {89};
104 -> {106};
105 -> {73};
102 -> {103};
103 -> {104};
104 -> {105};
105 -> {106};
106 -> {107};
107 -> {108};
108 -> {109};
109 -> {110};
110 -> {111 119};
107 -> {94};
108 -> {94};
109 -> {111};
110 -> {125};
111 -> {112};
112 -> {113};
113 -> {114};
114 -> {115};
115 -> {116};
115 -> {116 124};
116 -> {117};
117 -> {118};
118 -> {105};
119 -> {105};
118 -> {119};
119 -> {120};
120 -> {121};
121 -> {122};
122 -> {123};
123 -> {110};
124 -> {110};
125 -> {77};
}