FIR CFA: remove class initializer part nodes

Instead, attach subgraphs directly to the class enter node.
This commit is contained in:
pyos
2022-12-11 13:43:55 +01:00
committed by Dmitriy Novozhilov
parent b9f366af05
commit c6e9afb788
25 changed files with 3271 additions and 3385 deletions
@@ -6,108 +6,107 @@ digraph assignSafeCall_kt {
subgraph cluster_0 {
color=red
0 [label="Enter class A" style="filled" fillcolor=red];
1 [label="Part of class initialization"];
subgraph cluster_1 {
color=blue
2 [label="Enter property" style="filled" fillcolor=red];
3 [label="Const: Int(1)"];
4 [label="Exit property" style="filled" fillcolor=red];
1 [label="Enter property" style="filled" fillcolor=red];
2 [label="Const: Int(1)"];
3 [label="Exit property" style="filled" fillcolor=red];
}
5 [label="Exit class A" style="filled" fillcolor=red];
4 [label="Exit class A" style="filled" fillcolor=red];
}
subgraph cluster_2 {
color=blue
6 [label="Enter function bar" style="filled" fillcolor=red];
5 [label="Enter function bar" style="filled" fillcolor=red];
subgraph cluster_3 {
color=blue
7 [label="Enter block"];
8 [label="Exit block"];
6 [label="Enter block"];
7 [label="Exit block"];
}
9 [label="Exit function bar" style="filled" fillcolor=red];
8 [label="Exit function bar" style="filled" fillcolor=red];
}
subgraph cluster_4 {
color=blue
10 [label="Enter function foo" style="filled" fillcolor=red];
9 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_5 {
color=blue
11 [label="Enter block"];
12 [label="Const: Int(1)"];
13 [label="Jump: ^foo Int(1)"];
14 [label="Stub" style="filled" fillcolor=gray];
15 [label="Exit block" style="filled" fillcolor=gray];
10 [label="Enter block"];
11 [label="Const: Int(1)"];
12 [label="Jump: ^foo Int(1)"];
13 [label="Stub" style="filled" fillcolor=gray];
14 [label="Exit block" style="filled" fillcolor=gray];
}
16 [label="Exit function foo" style="filled" fillcolor=red];
15 [label="Exit function foo" style="filled" fillcolor=red];
}
subgraph cluster_6 {
color=blue
17 [label="Enter function <init>" style="filled" fillcolor=red];
18 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
19 [label="Exit function <init>" style="filled" fillcolor=red];
16 [label="Enter function <init>" style="filled" fillcolor=red];
17 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
18 [label="Exit function <init>" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
1 -> {2} [color=green];
1 -> {5} [style=dotted];
1 -> {2} [style=dashed];
0 -> {4} [style=dotted];
0 -> {1} [style=dashed];
1 -> {2};
2 -> {3};
3 -> {4};
4 -> {5} [color=green];
5 -> {6 10 17} [color=green];
5 -> {6 10 17} [style=dashed];
3 -> {4} [color=green];
4 -> {5 9 16} [color=green];
4 -> {5 9 16} [style=dashed];
5 -> {6};
6 -> {7};
7 -> {8};
8 -> {9};
9 -> {10};
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {16};
12 -> {15};
12 -> {13} [style=dotted];
13 -> {14} [style=dotted];
14 -> {15} [style=dotted];
15 -> {16} [style=dotted];
16 -> {17};
17 -> {18};
18 -> {19};
subgraph cluster_7 {
color=red
20 [label="Enter function test_1" style="filled" fillcolor=red];
19 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
21 [label="Enter block"];
22 [label="Access variable R|<local>/a|"];
23 [label="Enter safe call"];
24 [label="Access variable R|/A.x|"];
25 [label="Exit safe call"];
26 [label="Variable declaration: lval x: R|kotlin/Int?|"];
20 [label="Enter block"];
21 [label="Access variable R|<local>/a|"];
22 [label="Enter safe call"];
23 [label="Access variable R|/A.x|"];
24 [label="Exit safe call"];
25 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_9 {
color=blue
27 [label="Enter when"];
26 [label="Enter when"];
subgraph cluster_10 {
color=blue
28 [label="Enter when branch condition "];
29 [label="Access variable R|<local>/x|"];
30 [label="Const: Null(null)"];
31 [label="Equality operator !="];
32 [label="Exit when branch condition"];
27 [label="Enter when branch condition "];
28 [label="Access variable R|<local>/x|"];
29 [label="Const: Null(null)"];
30 [label="Equality operator !="];
31 [label="Exit when branch condition"];
}
33 [label="Synthetic else branch"];
34 [label="Enter when branch result"];
32 [label="Synthetic else branch"];
33 [label="Enter when branch result"];
subgraph cluster_11 {
color=blue
35 [label="Enter block"];
36 [label="Access variable R|<local>/a|"];
37 [label="Smart cast: R|<local>/a|"];
38 [label="Function call: R|<local>/a|.R|/A.bar|()" style="filled" fillcolor=yellow];
39 [label="Exit block"];
34 [label="Enter block"];
35 [label="Access variable R|<local>/a|"];
36 [label="Smart cast: R|<local>/a|"];
37 [label="Function call: R|<local>/a|.R|/A.bar|()" style="filled" fillcolor=yellow];
38 [label="Exit block"];
}
40 [label="Exit when branch result"];
41 [label="Exit when"];
39 [label="Exit when branch result"];
40 [label="Exit when"];
}
42 [label="Exit block"];
41 [label="Exit block"];
}
43 [label="Exit function test_1" style="filled" fillcolor=red];
42 [label="Exit function test_1" style="filled" fillcolor=red];
}
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23 25};
21 -> {22 24};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {26};
@@ -116,9 +115,9 @@ digraph assignSafeCall_kt {
28 -> {29};
29 -> {30};
30 -> {31};
31 -> {32};
32 -> {33 34};
33 -> {41};
31 -> {32 33};
32 -> {40};
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {37};
@@ -127,50 +126,50 @@ digraph assignSafeCall_kt {
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
subgraph cluster_12 {
color=red
44 [label="Enter function test_2" style="filled" fillcolor=red];
43 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_13 {
color=blue
45 [label="Enter block"];
46 [label="Access variable R|<local>/a|"];
47 [label="Enter safe call"];
48 [label="Function call: $subj$.R|/A.foo|()" style="filled" fillcolor=yellow];
49 [label="Exit safe call"];
50 [label="Variable declaration: lval x: R|kotlin/Int?|"];
44 [label="Enter block"];
45 [label="Access variable R|<local>/a|"];
46 [label="Enter safe call"];
47 [label="Function call: $subj$.R|/A.foo|()" style="filled" fillcolor=yellow];
48 [label="Exit safe call"];
49 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_14 {
color=blue
51 [label="Enter when"];
50 [label="Enter when"];
subgraph cluster_15 {
color=blue
52 [label="Enter when branch condition "];
53 [label="Access variable R|<local>/x|"];
54 [label="Const: Null(null)"];
55 [label="Equality operator !="];
56 [label="Exit when branch condition"];
51 [label="Enter when branch condition "];
52 [label="Access variable R|<local>/x|"];
53 [label="Const: Null(null)"];
54 [label="Equality operator !="];
55 [label="Exit when branch condition"];
}
57 [label="Synthetic else branch"];
58 [label="Enter when branch result"];
56 [label="Synthetic else branch"];
57 [label="Enter when branch result"];
subgraph cluster_16 {
color=blue
59 [label="Enter block"];
60 [label="Access variable R|<local>/a|"];
61 [label="Smart cast: R|<local>/a|"];
62 [label="Function call: R|<local>/a|.R|/A.bar|()" style="filled" fillcolor=yellow];
63 [label="Exit block"];
58 [label="Enter block"];
59 [label="Access variable R|<local>/a|"];
60 [label="Smart cast: R|<local>/a|"];
61 [label="Function call: R|<local>/a|.R|/A.bar|()" style="filled" fillcolor=yellow];
62 [label="Exit block"];
}
64 [label="Exit when branch result"];
65 [label="Exit when"];
63 [label="Exit when branch result"];
64 [label="Exit when"];
}
66 [label="Exit block"];
65 [label="Exit block"];
}
67 [label="Exit function test_2" style="filled" fillcolor=red];
66 [label="Exit function test_2" style="filled" fillcolor=red];
}
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47 49};
45 -> {46 48};
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {50};
@@ -179,9 +178,9 @@ digraph assignSafeCall_kt {
52 -> {53};
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57 58};
57 -> {65};
55 -> {56 57};
56 -> {64};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
@@ -190,41 +189,41 @@ digraph assignSafeCall_kt {
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
subgraph cluster_17 {
color=red
68 [label="Enter function test_3" style="filled" fillcolor=red];
67 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_18 {
color=blue
69 [label="Enter block"];
70 [label="Access variable R|<local>/x|"];
71 [label="Type operator: (R|<local>/x| as? R|A|)"];
72 [label="Exit lhs of ?:"];
73 [label="Enter rhs of ?:"];
74 [label="Jump: ^test_3 Unit"];
75 [label="Stub" style="filled" fillcolor=gray];
76 [label="Lhs of ?: is not null"];
77 [label="Exit ?:"];
78 [label="Variable declaration: lval a: R|A|"];
79 [label="Access variable R|<local>/a|"];
80 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
81 [label="Access variable R|<local>/x|"];
82 [label="Smart cast: R|<local>/x|"];
83 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
84 [label="Exit block"];
68 [label="Enter block"];
69 [label="Access variable R|<local>/x|"];
70 [label="Type operator: (R|<local>/x| as? R|A|)"];
71 [label="Exit lhs of ?:"];
72 [label="Enter rhs of ?:"];
73 [label="Jump: ^test_3 Unit"];
74 [label="Stub" style="filled" fillcolor=gray];
75 [label="Lhs of ?: is not null"];
76 [label="Exit ?:"];
77 [label="Variable declaration: lval a: R|A|"];
78 [label="Access variable R|<local>/a|"];
79 [label="Function call: R|<local>/a|.R|/A.foo|()" style="filled" fillcolor=yellow];
80 [label="Access variable R|<local>/x|"];
81 [label="Smart cast: R|<local>/x|"];
82 [label="Function call: R|<local>/x|.R|/A.foo|()" style="filled" fillcolor=yellow];
83 [label="Exit block"];
}
85 [label="Exit function test_3" style="filled" fillcolor=red];
84 [label="Exit function test_3" style="filled" fillcolor=red];
}
67 -> {68};
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {73 76};
73 -> {74};
74 -> {85};
74 -> {75} [style=dotted];
75 -> {77} [style=dotted];
71 -> {72 75};
72 -> {73};
73 -> {84};
73 -> {74} [style=dotted];
74 -> {76} [style=dotted];
75 -> {76};
76 -> {77};
77 -> {78};
78 -> {79};
@@ -233,71 +232,71 @@ digraph assignSafeCall_kt {
81 -> {82};
82 -> {83};
83 -> {84};
84 -> {85};
subgraph cluster_19 {
color=red
86 [label="Enter class B" style="filled" fillcolor=red];
87 [label="Exit class B" style="filled" fillcolor=red];
85 [label="Enter class B" style="filled" fillcolor=red];
86 [label="Exit class B" style="filled" fillcolor=red];
}
subgraph cluster_20 {
color=blue
88 [label="Enter function bar" style="filled" fillcolor=red];
89 [label="Exit function bar" style="filled" fillcolor=red];
87 [label="Enter function bar" style="filled" fillcolor=red];
88 [label="Exit function bar" style="filled" fillcolor=red];
}
subgraph cluster_21 {
color=blue
90 [label="Enter function foo" style="filled" fillcolor=red];
91 [label="Exit function foo" style="filled" fillcolor=red];
89 [label="Enter function foo" style="filled" fillcolor=red];
90 [label="Exit function foo" style="filled" fillcolor=red];
}
86 -> {87} [color=green];
87 -> {88 90} [color=green];
87 -> {88 90} [style=dashed];
88 -> {89};
90 -> {91};
85 -> {86} [color=green];
86 -> {87 89} [color=green];
86 -> {87 89} [style=dashed];
87 -> {88};
89 -> {90};
subgraph cluster_22 {
color=red
92 [label="Enter function test_1" style="filled" fillcolor=red];
91 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
93 [label="Enter block"];
94 [label="Access variable R|<local>/a|"];
95 [label="Enter safe call"];
96 [label="Access variable R|/B.x|"];
97 [label="Exit safe call"];
98 [label="Variable declaration: lval x: R|kotlin/Int?|"];
92 [label="Enter block"];
93 [label="Access variable R|<local>/a|"];
94 [label="Enter safe call"];
95 [label="Access variable R|/B.x|"];
96 [label="Exit safe call"];
97 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_24 {
color=blue
99 [label="Enter when"];
98 [label="Enter when"];
subgraph cluster_25 {
color=blue
100 [label="Enter when branch condition "];
101 [label="Access variable R|<local>/x|"];
102 [label="Const: Null(null)"];
103 [label="Equality operator !="];
104 [label="Exit when branch condition"];
99 [label="Enter when branch condition "];
100 [label="Access variable R|<local>/x|"];
101 [label="Const: Null(null)"];
102 [label="Equality operator !="];
103 [label="Exit when branch condition"];
}
105 [label="Synthetic else branch"];
106 [label="Enter when branch result"];
104 [label="Synthetic else branch"];
105 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
107 [label="Enter block"];
108 [label="Access variable R|<local>/a|"];
109 [label="Smart cast: R|<local>/a|"];
110 [label="Function call: R|<local>/a|.R|/B.bar|()" style="filled" fillcolor=yellow];
111 [label="Exit block"];
106 [label="Enter block"];
107 [label="Access variable R|<local>/a|"];
108 [label="Smart cast: R|<local>/a|"];
109 [label="Function call: R|<local>/a|.R|/B.bar|()" style="filled" fillcolor=yellow];
110 [label="Exit block"];
}
112 [label="Exit when branch result"];
113 [label="Exit when"];
111 [label="Exit when branch result"];
112 [label="Exit when"];
}
114 [label="Exit block"];
113 [label="Exit block"];
}
115 [label="Exit function test_1" style="filled" fillcolor=red];
114 [label="Exit function test_1" style="filled" fillcolor=red];
}
91 -> {92};
92 -> {93};
93 -> {94};
94 -> {95 97};
93 -> {94 96};
94 -> {95};
95 -> {96};
96 -> {97};
97 -> {98};
@@ -306,9 +305,9 @@ digraph assignSafeCall_kt {
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {104};
104 -> {105 106};
105 -> {113};
103 -> {104 105};
104 -> {112};
105 -> {106};
106 -> {107};
107 -> {108};
108 -> {109};
@@ -317,50 +316,50 @@ digraph assignSafeCall_kt {
111 -> {112};
112 -> {113};
113 -> {114};
114 -> {115};
subgraph cluster_27 {
color=red
116 [label="Enter function test_2" style="filled" fillcolor=red];
115 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_28 {
color=blue
117 [label="Enter block"];
118 [label="Access variable R|<local>/a|"];
119 [label="Enter safe call"];
120 [label="Function call: $subj$.R|/B.foo|()" style="filled" fillcolor=yellow];
121 [label="Exit safe call"];
122 [label="Variable declaration: lval x: R|kotlin/Int?|"];
116 [label="Enter block"];
117 [label="Access variable R|<local>/a|"];
118 [label="Enter safe call"];
119 [label="Function call: $subj$.R|/B.foo|()" style="filled" fillcolor=yellow];
120 [label="Exit safe call"];
121 [label="Variable declaration: lval x: R|kotlin/Int?|"];
subgraph cluster_29 {
color=blue
123 [label="Enter when"];
122 [label="Enter when"];
subgraph cluster_30 {
color=blue
124 [label="Enter when branch condition "];
125 [label="Access variable R|<local>/x|"];
126 [label="Const: Null(null)"];
127 [label="Equality operator !="];
128 [label="Exit when branch condition"];
123 [label="Enter when branch condition "];
124 [label="Access variable R|<local>/x|"];
125 [label="Const: Null(null)"];
126 [label="Equality operator !="];
127 [label="Exit when branch condition"];
}
129 [label="Synthetic else branch"];
130 [label="Enter when branch result"];
128 [label="Synthetic else branch"];
129 [label="Enter when branch result"];
subgraph cluster_31 {
color=blue
131 [label="Enter block"];
132 [label="Access variable R|<local>/a|"];
133 [label="Smart cast: R|<local>/a|"];
134 [label="Function call: R|<local>/a|.R|/B.bar|()" style="filled" fillcolor=yellow];
135 [label="Exit block"];
130 [label="Enter block"];
131 [label="Access variable R|<local>/a|"];
132 [label="Smart cast: R|<local>/a|"];
133 [label="Function call: R|<local>/a|.R|/B.bar|()" style="filled" fillcolor=yellow];
134 [label="Exit block"];
}
136 [label="Exit when branch result"];
137 [label="Exit when"];
135 [label="Exit when branch result"];
136 [label="Exit when"];
}
138 [label="Exit block"];
137 [label="Exit block"];
}
139 [label="Exit function test_2" style="filled" fillcolor=red];
138 [label="Exit function test_2" style="filled" fillcolor=red];
}
115 -> {116};
116 -> {117};
117 -> {118};
118 -> {119 121};
117 -> {118 120};
118 -> {119};
119 -> {120};
120 -> {121};
121 -> {122};
@@ -369,9 +368,9 @@ digraph assignSafeCall_kt {
124 -> {125};
125 -> {126};
126 -> {127};
127 -> {128};
128 -> {129 130};
129 -> {137};
127 -> {128 129};
128 -> {136};
129 -> {130};
130 -> {131};
131 -> {132};
132 -> {133};
@@ -380,41 +379,41 @@ digraph assignSafeCall_kt {
135 -> {136};
136 -> {137};
137 -> {138};
138 -> {139};
subgraph cluster_32 {
color=red
140 [label="Enter function test_3" style="filled" fillcolor=red];
139 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_33 {
color=blue
141 [label="Enter block"];
142 [label="Access variable R|<local>/x|"];
143 [label="Type operator: (R|<local>/x| as? R|B|)"];
144 [label="Exit lhs of ?:"];
145 [label="Enter rhs of ?:"];
146 [label="Jump: ^test_3 Unit"];
147 [label="Stub" style="filled" fillcolor=gray];
148 [label="Lhs of ?: is not null"];
149 [label="Exit ?:"];
150 [label="Variable declaration: lval a: R|B|"];
151 [label="Access variable R|<local>/a|"];
152 [label="Function call: R|<local>/a|.R|/B.foo|()" style="filled" fillcolor=yellow];
153 [label="Access variable R|<local>/x|"];
154 [label="Smart cast: R|<local>/x|"];
155 [label="Function call: R|<local>/x|.R|/B.foo|()" style="filled" fillcolor=yellow];
156 [label="Exit block"];
140 [label="Enter block"];
141 [label="Access variable R|<local>/x|"];
142 [label="Type operator: (R|<local>/x| as? R|B|)"];
143 [label="Exit lhs of ?:"];
144 [label="Enter rhs of ?:"];
145 [label="Jump: ^test_3 Unit"];
146 [label="Stub" style="filled" fillcolor=gray];
147 [label="Lhs of ?: is not null"];
148 [label="Exit ?:"];
149 [label="Variable declaration: lval a: R|B|"];
150 [label="Access variable R|<local>/a|"];
151 [label="Function call: R|<local>/a|.R|/B.foo|()" style="filled" fillcolor=yellow];
152 [label="Access variable R|<local>/x|"];
153 [label="Smart cast: R|<local>/x|"];
154 [label="Function call: R|<local>/x|.R|/B.foo|()" style="filled" fillcolor=yellow];
155 [label="Exit block"];
}
157 [label="Exit function test_3" style="filled" fillcolor=red];
156 [label="Exit function test_3" style="filled" fillcolor=red];
}
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {143};
143 -> {144};
144 -> {145 148};
145 -> {146};
146 -> {157};
146 -> {147} [style=dotted];
147 -> {149} [style=dotted];
143 -> {144 147};
144 -> {145};
145 -> {156};
145 -> {146} [style=dotted];
146 -> {148} [style=dotted];
147 -> {148};
148 -> {149};
149 -> {150};
150 -> {151};
@@ -423,6 +422,5 @@ digraph assignSafeCall_kt {
153 -> {154};
154 -> {155};
155 -> {156};
156 -> {157};
}