[FIR] Add control flow graph for class initialization

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