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