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
@@ -76,8 +76,6 @@ digraph inAnonymousObject_kt {
4 -> {5} [color=red];
4 -> {13} [style=dashed];
5 -> {6};
5 -> {26 29} [color=green];
5 -> {26 29} [style=dashed];
6 -> {7};
7 -> {8};
8 -> {9};
@@ -91,7 +89,8 @@ digraph inAnonymousObject_kt {
15 -> {20} [color=green];
15 -> {16} [style=dotted];
15 -> {20} [style=dashed];
16 -> {5} [color=green];
16 -> {5 26 29} [color=green];
16 -> {26 29} [style=dashed];
17 -> {18};
18 -> {19};
19 -> {15} [color=green];
@@ -27,39 +27,16 @@ digraph inLocalClass_kt {
10 [label="Enter class LocalClass" style="filled" fillcolor=red];
11 [label="Part of class initialization"];
subgraph cluster_4 {
color=blue
29 [label="Enter function run" style="filled" fillcolor=red];
subgraph cluster_5 {
color=blue
30 [label="Enter block"];
31 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
32 [label="Exit block"];
}
33 [label="Exit function run" style="filled" fillcolor=red];
}
subgraph cluster_6 {
color=blue
23 [label="Enter function <init>" style="filled" fillcolor=red];
24 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
subgraph cluster_7 {
color=blue
25 [label="Enter block"];
26 [label="Function call: R|<local>/b|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
27 [label="Exit block"];
}
28 [label="Exit function <init>" style="filled" fillcolor=red];
}
subgraph cluster_8 {
color=blue
14 [label="Enter property" style="filled" fillcolor=red];
15 [label="Access variable R|<local>/a|"];
16 [label="Exit property" style="filled" fillcolor=red];
}
12 [label="Part of class initialization"];
subgraph cluster_9 {
subgraph cluster_5 {
color=blue
17 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_10 {
subgraph cluster_6 {
color=blue
18 [label="Enter block"];
19 [label="Access variable R|<local>/c|"];
@@ -70,14 +47,37 @@ digraph inLocalClass_kt {
}
13 [label="Exit class LocalClass" style="filled" fillcolor=red];
}
subgraph cluster_7 {
color=blue
29 [label="Enter function run" style="filled" fillcolor=red];
subgraph cluster_8 {
color=blue
30 [label="Enter block"];
31 [label="Function call: R|<local>/d|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
32 [label="Exit block"];
}
33 [label="Exit function run" style="filled" fillcolor=red];
}
subgraph cluster_9 {
color=blue
23 [label="Enter function <init>" style="filled" fillcolor=red];
24 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
subgraph cluster_10 {
color=blue
25 [label="Enter block"];
26 [label="Function call: R|<local>/b|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()" style="filled" fillcolor=yellow];
27 [label="Exit block"];
}
28 [label="Exit function <init>" style="filled" fillcolor=red];
}
0 -> {1};
1 -> {2};
2 -> {3};
3 -> {4};
3 -> {14 17 23 29} [color=red];
4 -> {5};
4 -> {10 23 29} [color=green];
4 -> {10 23 29} [style=dashed];
4 -> {10} [color=green];
4 -> {10} [style=dashed];
5 -> {6};
6 -> {7};
7 -> {8};
@@ -89,6 +89,8 @@ digraph inLocalClass_kt {
12 -> {17} [color=green];
12 -> {13} [style=dotted];
12 -> {17} [style=dashed];
13 -> {23 29} [color=green];
13 -> {23 29} [style=dashed];
14 -> {15};
15 -> {16};
16 -> {12} [color=green];