FIR CFA: add edges according to constructor delegation

This commit is contained in:
pyos
2023-01-18 12:02:00 +01:00
committed by teamcity
parent 29b7a8e435
commit 9f17b5de97
21 changed files with 593 additions and 562 deletions
@@ -8,33 +8,33 @@ digraph initBlock_kt {
0 [label="Enter class Foo" style="filled" fillcolor=red];
subgraph cluster_1 {
color=blue
1 [label="Enter function <init>" style="filled" fillcolor=red];
2 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
3 [label="Exit function <init>" style="filled" fillcolor=red];
}
subgraph cluster_2 {
color=blue
4 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_3 {
1 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_2 {
color=blue
5 [label="Enter block"];
6 [label="Const: Int(1)"];
7 [label="Variable declaration: lval x: R|kotlin/Int|"];
8 [label="Exit block"];
2 [label="Enter block"];
3 [label="Const: Int(1)"];
4 [label="Variable declaration: lval x: R|kotlin/Int|"];
5 [label="Exit block"];
}
9 [label="Exit init block" style="filled" fillcolor=red];
6 [label="Exit init block" style="filled" fillcolor=red];
}
subgraph cluster_3 {
color=blue
7 [label="Enter function <init>" style="filled" fillcolor=red];
8 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
9 [label="Exit function <init>" style="filled" fillcolor=red];
}
10 [label="Exit class Foo" style="filled" fillcolor=red];
}
0 -> {1} [color=green];
0 -> {10} [style=dotted];
0 -> {1 4} [style=dashed];
0 -> {1 7} [style=dashed];
1 -> {2};
2 -> {3};
3 -> {4} [color=green];
3 -> {4};
4 -> {5};
5 -> {6};
6 -> {7};
6 -> {7} [color=green];
7 -> {8};
8 -> {9};
9 -> {10} [color=green];
@@ -44,40 +44,40 @@ digraph initBlock_kt {
11 [label="Enter class Bar" style="filled" fillcolor=red];
subgraph cluster_5 {
color=blue
12 [label="Enter function <init>" style="filled" fillcolor=red];
13 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=yellow];
14 [label="Exit function <init>" style="filled" fillcolor=red];
}
subgraph cluster_6 {
color=blue
15 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_7 {
12 [label="Enter init block" style="filled" fillcolor=red];
subgraph cluster_6 {
color=blue
16 [label="Enter block"];
17 [label="Const: Int(1)"];
18 [label="Variable declaration: lval x: R|kotlin/Int|"];
19 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
20 [label="Throw: throw R|java/lang/Exception.Exception|()"];
21 [label="Stub" style="filled" fillcolor=gray];
22 [label="Const: Int(2)" style="filled" fillcolor=gray];
23 [label="Variable declaration: lval y: R|kotlin/Int|" style="filled" fillcolor=gray];
24 [label="Exit block" style="filled" fillcolor=gray];
13 [label="Enter block"];
14 [label="Const: Int(1)"];
15 [label="Variable declaration: lval x: R|kotlin/Int|"];
16 [label="Function call: R|java/lang/Exception.Exception|()" style="filled" fillcolor=yellow];
17 [label="Throw: throw R|java/lang/Exception.Exception|()"];
18 [label="Stub" style="filled" fillcolor=gray];
19 [label="Const: Int(2)" style="filled" fillcolor=gray];
20 [label="Variable declaration: lval y: R|kotlin/Int|" style="filled" fillcolor=gray];
21 [label="Exit block" style="filled" fillcolor=gray];
}
25 [label="Exit init block" style="filled" fillcolor=gray];
22 [label="Exit init block" style="filled" fillcolor=gray];
}
subgraph cluster_7 {
color=blue
23 [label="Enter function <init>" style="filled" fillcolor=gray];
24 [label="Delegated constructor call: super<R|kotlin/Any|>()" style="filled" fillcolor=gray];
25 [label="Exit function <init>" style="filled" fillcolor=gray];
}
26 [label="Exit class Bar" style="filled" fillcolor=gray];
}
11 -> {12} [color=green];
11 -> {26} [style=dotted];
11 -> {12 15} [style=dashed];
11 -> {12 23} [style=dashed];
12 -> {13};
13 -> {14};
14 -> {15} [color=green];
14 -> {15};
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {20};
17 -> {18} [style=dotted];
18 -> {19} [style=dotted];
19 -> {20} [style=dotted];
20 -> {21} [style=dotted];
21 -> {22} [style=dotted];
22 -> {23} [style=dotted];