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