FIR CFA: attach method graphs to class exit node

Even for non-local classes. This ensures that the CFG edges in this case
will only go to a subgraph, not to an unrelated graph.
This commit is contained in:
pyos
2022-12-09 13:22:17 +01:00
committed by Dmitriy Novozhilov
parent aadea0e26f
commit 74758278d7
47 changed files with 1245 additions and 1181 deletions
@@ -4,32 +4,34 @@ digraph boundSmartcasts_kt {
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter function foo" style="filled" fillcolor=red];
1 [label="Exit function foo" style="filled" fillcolor=red];
}
0 -> {1};
subgraph cluster_1 {
color=red
2 [label="Enter class A" style="filled" fillcolor=red];
3 [label="Exit class A" style="filled" fillcolor=red];
}
subgraph cluster_1 {
color=blue
0 [label="Enter function foo" style="filled" fillcolor=red];
1 [label="Exit function foo" style="filled" fillcolor=red];
}
2 -> {3} [color=green];
3 -> {0} [color=green];
3 -> {0} [style=dashed];
0 -> {1};
subgraph cluster_2 {
color=red
4 [label="Enter function bar" style="filled" fillcolor=red];
5 [label="Exit function bar" style="filled" fillcolor=red];
}
4 -> {5};
subgraph cluster_3 {
color=red
6 [label="Enter class B" style="filled" fillcolor=red];
7 [label="Exit class B" style="filled" fillcolor=red];
}
subgraph cluster_3 {
color=blue
4 [label="Enter function bar" style="filled" fillcolor=red];
5 [label="Exit function bar" style="filled" fillcolor=red];
}
6 -> {7} [color=green];
7 -> {4} [color=green];
7 -> {4} [style=dashed];
4 -> {5};
subgraph cluster_4 {
color=red
@@ -335,19 +337,10 @@ digraph boundSmartcasts_kt {
123 -> {124};
subgraph cluster_27 {
color=red
125 [label="Enter function <init>" style="filled" fillcolor=red];
126 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
127 [label="Exit function <init>" style="filled" fillcolor=red];
}
125 -> {126};
126 -> {127};
subgraph cluster_28 {
color=red
131 [label="Enter class D" style="filled" fillcolor=red];
132 [label="Part of class initialization"];
subgraph cluster_29 {
subgraph cluster_28 {
color=blue
128 [label="Enter property" style="filled" fillcolor=red];
129 [label="Access variable R|<local>/any|"];
@@ -355,13 +348,23 @@ digraph boundSmartcasts_kt {
}
133 [label="Exit class D" style="filled" fillcolor=red];
}
subgraph cluster_29 {
color=blue
125 [label="Enter function <init>" style="filled" fillcolor=red];
126 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
127 [label="Exit function <init>" style="filled" fillcolor=red];
}
131 -> {132} [color=green];
132 -> {128} [color=green];
132 -> {133} [style=dotted];
132 -> {128} [style=dashed];
133 -> {125} [color=green];
133 -> {125} [style=dashed];
128 -> {129};
129 -> {130};
130 -> {133} [color=green];
125 -> {126};
126 -> {127};
subgraph cluster_30 {
color=red
@@ -4,19 +4,10 @@ digraph boundSmartcastsInBranches_kt {
edge [penwidth=2]
subgraph cluster_0 {
color=red
0 [label="Enter function <init>" style="filled" fillcolor=red];
1 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
2 [label="Exit function <init>" style="filled" fillcolor=red];
}
0 -> {1};
1 -> {2};
subgraph cluster_1 {
color=red
6 [label="Enter class A" style="filled" fillcolor=red];
7 [label="Part of class initialization"];
subgraph cluster_2 {
subgraph cluster_1 {
color=blue
3 [label="Enter property" style="filled" fillcolor=red];
4 [label="Const: String()"];
@@ -24,13 +15,23 @@ digraph boundSmartcastsInBranches_kt {
}
8 [label="Exit class A" style="filled" fillcolor=red];
}
subgraph cluster_2 {
color=blue
0 [label="Enter function <init>" style="filled" fillcolor=red];
1 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
2 [label="Exit function <init>" style="filled" fillcolor=red];
}
6 -> {7} [color=green];
7 -> {3} [color=green];
7 -> {8} [style=dotted];
7 -> {3} [style=dashed];
8 -> {0} [color=green];
8 -> {0} [style=dashed];
3 -> {4};
4 -> {5};
5 -> {8} [color=green];
0 -> {1};
1 -> {2};
subgraph cluster_3 {
color=red
@@ -5,34 +5,26 @@ digraph functionCallBound_kt {
subgraph cluster_0 {
color=red
3 [label="Enter class Base" style="filled" fillcolor=red];
4 [label="Exit class Base" style="filled" fillcolor=red];
}
subgraph cluster_1 {
color=blue
0 [label="Enter function <init>" style="filled" fillcolor=red];
1 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
2 [label="Exit function <init>" style="filled" fillcolor=red];
}
3 -> {4} [color=green];
4 -> {0} [color=green];
4 -> {0} [style=dashed];
0 -> {1};
1 -> {2};
subgraph cluster_1 {
color=red
3 [label="Enter class Base" style="filled" fillcolor=red];
4 [label="Exit class Base" style="filled" fillcolor=red];
}
3 -> {4} [color=green];
subgraph cluster_2 {
color=red
5 [label="Enter function <init>" style="filled" fillcolor=red];
6 [label="Delegated constructor call: super<R|Base|>()" style="filled" fillcolor=yellow];
7 [label="Exit function <init>" style="filled" fillcolor=red];
}
5 -> {6};
6 -> {7};
subgraph cluster_3 {
color=red
11 [label="Enter class Sub" style="filled" fillcolor=red];
12 [label="Part of class initialization"];
subgraph cluster_4 {
subgraph cluster_3 {
color=blue
8 [label="Enter property" style="filled" fillcolor=red];
9 [label="Access variable R|<local>/data|"];
@@ -40,13 +32,23 @@ digraph functionCallBound_kt {
}
13 [label="Exit class Sub" style="filled" fillcolor=red];
}
subgraph cluster_4 {
color=blue
5 [label="Enter function <init>" style="filled" fillcolor=red];
6 [label="Delegated constructor call: super<R|Base|>()" style="filled" fillcolor=yellow];
7 [label="Exit function <init>" style="filled" fillcolor=red];
}
11 -> {12} [color=green];
12 -> {8} [color=green];
12 -> {13} [style=dotted];
12 -> {8} [style=dashed];
13 -> {5} [color=green];
13 -> {5} [style=dashed];
8 -> {9};
9 -> {10};
10 -> {13} [color=green];
5 -> {6};
6 -> {7};
subgraph cluster_5 {
color=red