[FIR] Introduce new algorithm for building CFG for declarations

This commit is contained in:
Dmitriy Novozhilov
2020-06-05 15:47:57 +03:00
parent 950bbfe3a5
commit 87859b0faa
95 changed files with 16070 additions and 13199 deletions
@@ -6,63 +6,85 @@ digraph tryWithLambdaInside_kt {
subgraph cluster_0 {
color=red
0 [label="Enter function notInPlaceFilter" style="filled" fillcolor=red];
2 [label="Access variable this@R|/notInPlaceFilter|"];
3 [label="Jump: ^notInPlaceFilter this@R|/notInPlaceFilter|"];
4 [label="Stub" style="filled" fillcolor=gray];
subgraph cluster_1 {
color=blue
2 [label="Enter block"];
3 [label="Access variable this@R|/notInPlaceFilter|"];
4 [label="Jump: ^notInPlaceFilter this@R|/notInPlaceFilter|"];
5 [label="Stub" style="filled" fillcolor=gray];
6 [label="Exit block" style="filled" fillcolor=gray];
}
1 [label="Exit function notInPlaceFilter" style="filled" fillcolor=red];
}
0 -> {2};
2 -> {3};
3 -> {1};
3 -> {4} [style=dotted];
4 -> {1} [style=dotted];
subgraph cluster_1 {
color=red
5 [label="Enter function foo" style="filled" fillcolor=red];
6 [label="Exit function foo" style="filled" fillcolor=red];
}
5 -> {6};
3 -> {4};
4 -> {1};
4 -> {5} [style=dotted];
5 -> {6} [style=dotted];
6 -> {1} [style=dotted];
subgraph cluster_2 {
color=red
7 [label="Enter function testInPlace" style="filled" fillcolor=red];
7 [label="Enter function foo" style="filled" fillcolor=red];
subgraph cluster_3 {
color=blue
9 [label="Try expression enter"];
subgraph cluster_4 {
color=blue
11 [label="Try main block enter"];
subgraph cluster_5 {
color=blue
13 [label="Enter block"];
14 [label="Access variable R|<local>/list|"];
15 [label="Postponed enter to lambda"];
subgraph cluster_6 {
color=blue
25 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
27 [label="Access variable R|<local>/it|"];
26 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
16 [label="Postponed exit from lambda"];
17 [label="Function call: R|<local>/list|.R|kotlin/collections/filter|<R|kotlin/Boolean|>(...)"];
18 [label="Exit block"];
}
19 [label="Try main block exit"];
}
subgraph cluster_7 {
color=blue
12 [label="Enter finally"];
subgraph cluster_8 {
color=blue
20 [label="Enter block"];
21 [label="Exit block"];
}
22 [label="Exit finally"];
}
10 [label="Try expression exit"];
9 [label="Enter block"];
10 [label="Exit block"];
}
23 [label="Jump: ^testInPlace try {
8 [label="Exit function foo" style="filled" fillcolor=red];
}
7 -> {9};
9 -> {10};
10 -> {8};
subgraph cluster_4 {
color=red
11 [label="Enter function testInPlace" style="filled" fillcolor=red];
subgraph cluster_5 {
color=blue
13 [label="Enter block"];
subgraph cluster_6 {
color=blue
14 [label="Try expression enter"];
subgraph cluster_7 {
color=blue
16 [label="Try main block enter"];
subgraph cluster_8 {
color=blue
18 [label="Enter block"];
19 [label="Access variable R|<local>/list|"];
20 [label="Postponed enter to lambda"];
subgraph cluster_9 {
color=blue
31 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
33 [label="Enter block"];
34 [label="Access variable R|<local>/it|"];
35 [label="Exit block"];
}
32 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
21 [label="Postponed exit from lambda"];
22 [label="Function call: R|<local>/list|.R|kotlin/collections/filter|<R|kotlin/Boolean|>(...)"];
23 [label="Exit block"];
}
24 [label="Try main block exit"];
}
subgraph cluster_11 {
color=blue
17 [label="Enter finally"];
subgraph cluster_12 {
color=blue
25 [label="Enter block"];
26 [label="Exit block"];
}
27 [label="Exit finally"];
}
15 [label="Try expression exit"];
}
28 [label="Jump: ^testInPlace try {
R|<local>/list|.R|kotlin/collections/filter|<R|kotlin/Boolean|>(<L> = filter@fun <anonymous>(it: R|kotlin/Boolean|): R|kotlin/Boolean| <kind=UNKNOWN> {
^ R|<local>/it|
}
@@ -71,72 +93,86 @@ digraph tryWithLambdaInside_kt {
finally {
}
"];
24 [label="Stub" style="filled" fillcolor=gray];
8 [label="Exit function testInPlace" style="filled" fillcolor=red];
}
7 -> {9};
9 -> {11};
10 -> {23};
11 -> {8 12 13};
12 -> {20};
13 -> {14};
14 -> {15};
15 -> {25};
15 -> {16} [color=red];
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {10};
20 -> {21};
21 -> {22};
22 -> {10};
23 -> {8};
23 -> {24} [style=dotted];
24 -> {8} [style=dotted];
25 -> {26 27};
26 -> {16} [color=green];
26 -> {25} [color=green style=dashed];
27 -> {26};
subgraph cluster_9 {
color=red
28 [label="Enter function testNotInPlace" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
30 [label="Try expression enter"];
subgraph cluster_11 {
color=blue
32 [label="Try main block enter"];
subgraph cluster_12 {
color=blue
34 [label="Enter block"];
35 [label="Access variable R|<local>/list|"];
36 [label="Postponed enter to lambda"];
subgraph cluster_13 {
color=blue
46 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
48 [label="Access variable R|<local>/it|"];
47 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
37 [label="Postponed exit from lambda"];
38 [label="Function call: R|<local>/list|.R|/notInPlaceFilter|<R|kotlin/Boolean|>(...)"];
39 [label="Exit block"];
}
40 [label="Try main block exit"];
}
subgraph cluster_14 {
color=blue
33 [label="Enter finally"];
subgraph cluster_15 {
color=blue
41 [label="Enter block"];
42 [label="Exit block"];
}
43 [label="Exit finally"];
}
31 [label="Try expression exit"];
29 [label="Stub" style="filled" fillcolor=gray];
30 [label="Exit block" style="filled" fillcolor=gray];
}
44 [label="Jump: ^testNotInPlace try {
12 [label="Exit function testInPlace" style="filled" fillcolor=red];
}
11 -> {13};
13 -> {14};
14 -> {16};
15 -> {28};
16 -> {12 17 18};
17 -> {25};
18 -> {19};
19 -> {20};
20 -> {31};
20 -> {21} [color=red];
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {15};
25 -> {26};
26 -> {27};
27 -> {15};
28 -> {12};
28 -> {29} [style=dotted];
29 -> {30} [style=dotted];
30 -> {12} [style=dotted];
31 -> {32 33};
32 -> {21} [color=green];
32 -> {31} [color=green style=dashed];
33 -> {34};
34 -> {35};
35 -> {32};
subgraph cluster_13 {
color=red
36 [label="Enter function testNotInPlace" style="filled" fillcolor=red];
subgraph cluster_14 {
color=blue
38 [label="Enter block"];
subgraph cluster_15 {
color=blue
39 [label="Try expression enter"];
subgraph cluster_16 {
color=blue
41 [label="Try main block enter"];
subgraph cluster_17 {
color=blue
43 [label="Enter block"];
44 [label="Access variable R|<local>/list|"];
45 [label="Postponed enter to lambda"];
subgraph cluster_18 {
color=blue
56 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_19 {
color=blue
58 [label="Enter block"];
59 [label="Access variable R|<local>/it|"];
60 [label="Exit block"];
}
57 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
46 [label="Postponed exit from lambda"];
47 [label="Function call: R|<local>/list|.R|/notInPlaceFilter|<R|kotlin/Boolean|>(...)"];
48 [label="Exit block"];
}
49 [label="Try main block exit"];
}
subgraph cluster_20 {
color=blue
42 [label="Enter finally"];
subgraph cluster_21 {
color=blue
50 [label="Enter block"];
51 [label="Exit block"];
}
52 [label="Exit finally"];
}
40 [label="Try expression exit"];
}
53 [label="Jump: ^testNotInPlace try {
R|<local>/list|.R|/notInPlaceFilter|<R|kotlin/Boolean|>(<L> = notInPlaceFilter@fun <anonymous>(it: R|kotlin/Boolean|): R|kotlin/Boolean| {
^ R|<local>/it|
}
@@ -145,29 +181,34 @@ finally {
finally {
}
"];
45 [label="Stub" style="filled" fillcolor=gray];
29 [label="Exit function testNotInPlace" style="filled" fillcolor=red];
54 [label="Stub" style="filled" fillcolor=gray];
55 [label="Exit block" style="filled" fillcolor=gray];
}
37 [label="Exit function testNotInPlace" style="filled" fillcolor=red];
}
28 -> {30};
30 -> {32};
31 -> {44};
32 -> {29 33 34};
33 -> {41};
34 -> {35};
35 -> {36};
36 -> {37};
36 -> {46} [color=red];
37 -> {38};
36 -> {38};
38 -> {39};
39 -> {40};
40 -> {31};
41 -> {42};
42 -> {43};
43 -> {31};
44 -> {29};
44 -> {45} [style=dotted];
45 -> {29} [style=dotted];
46 -> {48};
48 -> {47};
39 -> {41};
40 -> {53};
41 -> {37 42 43};
42 -> {50};
43 -> {44};
44 -> {45};
45 -> {46 56};
46 -> {47};
47 -> {48};
48 -> {49};
49 -> {40};
50 -> {51};
51 -> {52};
52 -> {40};
53 -> {37};
53 -> {54} [style=dotted];
54 -> {55} [style=dotted];
55 -> {37} [style=dotted];
56 -> {58};
58 -> {59};
59 -> {60};
60 -> {57};
}