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];
@@ -5,20 +5,21 @@ digraph delegateWithAnonymousObject_kt {
subgraph cluster_0 {
color=red
3 [label="Enter class DelegateProvider" style="filled" fillcolor=red];
4 [label="Exit class DelegateProvider" 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 DelegateProvider" style="filled" fillcolor=red];
4 [label="Exit class DelegateProvider" style="filled" fillcolor=red];
}
3 -> {4} [color=green];
subgraph cluster_2 {
color=red
5 [label="Enter function delegate" style="filled" fillcolor=red];
@@ -45,15 +46,11 @@ digraph delegateWithAnonymousObject_kt {
subgraph cluster_4 {
color=red
14 [label="Enter function <init>" style="filled" fillcolor=red];
15 [label="Delegated constructor call: super<R|DelegateProvider<IssueListView>|>()" style="filled" fillcolor=yellow];
16 [label="Exit function <init>" style="filled" fillcolor=red];
21 [label="Enter class IssueListView" style="filled" fillcolor=red];
22 [label="Exit class IssueListView" style="filled" fillcolor=red];
}
14 -> {15};
15 -> {16};
subgraph cluster_5 {
color=red
color=blue
17 [label="Enter function updateFrom" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
@@ -62,30 +59,25 @@ digraph delegateWithAnonymousObject_kt {
}
20 [label="Exit function updateFrom" style="filled" fillcolor=red];
}
subgraph cluster_7 {
color=blue
14 [label="Enter function <init>" style="filled" fillcolor=red];
15 [label="Delegated constructor call: super<R|DelegateProvider<IssueListView>|>()" style="filled" fillcolor=yellow];
16 [label="Exit function <init>" style="filled" fillcolor=red];
}
21 -> {22} [color=green];
22 -> {14 17} [color=green];
22 -> {14 17} [style=dashed];
14 -> {15};
15 -> {16};
17 -> {18};
18 -> {19};
19 -> {20};
subgraph cluster_7 {
color=red
21 [label="Enter class IssueListView" style="filled" fillcolor=red];
22 [label="Exit class IssueListView" style="filled" fillcolor=red];
}
21 -> {22} [color=green];
subgraph cluster_8 {
color=red
23 [label="Enter function <init>" style="filled" fillcolor=red];
24 [label="Delegated constructor call: super<R|DelegateProvider<IssuesListUserProfile>|>()" style="filled" fillcolor=yellow];
25 [label="Exit function <init>" style="filled" fillcolor=red];
}
23 -> {24};
24 -> {25};
subgraph cluster_9 {
color=red
54 [label="Enter function getter" style="filled" fillcolor=red];
subgraph cluster_10 {
subgraph cluster_9 {
color=blue
55 [label="Enter block"];
56 [label="Access variable D|/IssuesListUserProfile.issueListView|"];
@@ -107,10 +99,10 @@ digraph delegateWithAnonymousObject_kt {
60 -> {61} [style=dotted];
61 -> {62} [style=dotted];
subgraph cluster_11 {
subgraph cluster_10 {
color=red
63 [label="Enter function setter" style="filled" fillcolor=red];
subgraph cluster_12 {
subgraph cluster_11 {
color=blue
64 [label="Enter block"];
65 [label="Access variable D|/IssuesListUserProfile.issueListView|"];
@@ -129,22 +121,22 @@ digraph delegateWithAnonymousObject_kt {
68 -> {69};
69 -> {70};
subgraph cluster_13 {
subgraph cluster_12 {
color=red
79 [label="Enter class IssuesListUserProfile" style="filled" fillcolor=red];
80 [label="Part of class initialization"];
subgraph cluster_14 {
subgraph cluster_13 {
color=blue
71 [label="Enter property" style="filled" fillcolor=red];
72 [label="Postponed enter to lambda"];
subgraph cluster_15 {
subgraph cluster_14 {
color=blue
26 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_16 {
subgraph cluster_15 {
color=blue
27 [label="Enter block"];
28 [label="Enter anonymous object"];
subgraph cluster_17 {
subgraph cluster_16 {
color=blue
33 [label="Enter class <anonymous object>" style="filled" fillcolor=red];
34 [label="Exit class <anonymous object>" style="filled" fillcolor=red];
@@ -155,10 +147,10 @@ digraph delegateWithAnonymousObject_kt {
}
32 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
subgraph cluster_18 {
subgraph cluster_17 {
color=blue
45 [label="Enter function setValue" style="filled" fillcolor=red];
subgraph cluster_19 {
subgraph cluster_18 {
color=blue
46 [label="Enter block"];
47 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow];
@@ -170,10 +162,10 @@ digraph delegateWithAnonymousObject_kt {
}
53 [label="Exit function setValue" style="filled" fillcolor=red];
}
subgraph cluster_20 {
subgraph cluster_19 {
color=blue
38 [label="Enter function getValue" style="filled" fillcolor=red];
subgraph cluster_21 {
subgraph cluster_20 {
color=blue
39 [label="Enter block"];
40 [label="Function call: R|/IssueListView.IssueListView|()" style="filled" fillcolor=yellow];
@@ -183,7 +175,7 @@ digraph delegateWithAnonymousObject_kt {
}
44 [label="Exit function getValue" style="filled" fillcolor=red];
}
subgraph cluster_22 {
subgraph cluster_21 {
color=blue
35 [label="Enter function <init>" style="filled" fillcolor=red];
36 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
@@ -198,10 +190,18 @@ digraph delegateWithAnonymousObject_kt {
}
81 [label="Exit class IssuesListUserProfile" style="filled" fillcolor=red];
}
subgraph cluster_22 {
color=blue
23 [label="Enter function <init>" style="filled" fillcolor=red];
24 [label="Delegated constructor call: super<R|DelegateProvider<IssuesListUserProfile>|>()" style="filled" fillcolor=yellow];
25 [label="Exit function <init>" style="filled" fillcolor=red];
}
79 -> {80} [color=green];
80 -> {71} [color=green];
80 -> {81} [style=dotted];
80 -> {71} [style=dashed];
81 -> {23} [color=green];
81 -> {23} [style=dashed];
71 -> {72};
72 -> {26 73 74};
72 -> {26} [style=dashed];
@@ -219,12 +219,11 @@ digraph delegateWithAnonymousObject_kt {
28 -> {29} [color=red];
28 -> {33} [style=dashed];
29 -> {30};
29 -> {35 38 45} [color=green];
29 -> {35 38 45} [style=dashed];
30 -> {31};
31 -> {32};
33 -> {34} [color=green];
34 -> {29} [color=green];
34 -> {29 35 38 45} [color=green];
34 -> {35 38 45} [style=dashed];
35 -> {36};
36 -> {37};
38 -> {39};
@@ -243,5 +242,7 @@ digraph delegateWithAnonymousObject_kt {
50 -> {51} [style=dotted];
51 -> {52} [style=dotted];
52 -> {53} [style=dotted];
23 -> {24};
24 -> {25};
}
@@ -50,19 +50,10 @@ digraph plusAssignWithLambdaInRhs_kt {
15 -> {16} [style=dotted];
subgraph cluster_4 {
color=red
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];
}
17 -> {18};
18 -> {19};
subgraph cluster_5 {
color=red
23 [label="Enter class A" style="filled" fillcolor=red];
24 [label="Part of class initialization"];
subgraph cluster_6 {
subgraph cluster_5 {
color=blue
20 [label="Enter property" style="filled" fillcolor=red];
21 [label="Access variable R|<local>/executor|"];
@@ -70,13 +61,23 @@ digraph plusAssignWithLambdaInRhs_kt {
}
25 [label="Exit class A" 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];
}
23 -> {24} [color=green];
24 -> {20} [color=green];
24 -> {25} [style=dotted];
24 -> {20} [style=dashed];
25 -> {17} [color=green];
25 -> {17} [style=dashed];
20 -> {21};
21 -> {22};
22 -> {25} [color=green];
17 -> {18};
18 -> {19};
subgraph cluster_7 {
color=red