[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,187 +6,236 @@ digraph inplaceLambdaInControlFlowExpressions_kt {
subgraph cluster_0 {
color=red
0 [label="Enter function materialize" style="filled" fillcolor=red];
2 [label="Const: Null(null)"];
3 [label="Check not null: Null(null)!!"];
4 [label="Jump: ^materialize Null(null)!!"];
5 [label="Stub" style="filled" fillcolor=gray];
subgraph cluster_1 {
color=blue
2 [label="Enter block"];
3 [label="Const: Null(null)"];
4 [label="Check not null: Null(null)!!"];
5 [label="Jump: ^materialize Null(null)!!"];
6 [label="Stub" style="filled" fillcolor=gray];
7 [label="Exit block" style="filled" fillcolor=gray];
}
1 [label="Exit function materialize" style="filled" fillcolor=red];
}
0 -> {2};
2 -> {3};
3 -> {4};
4 -> {1};
4 -> {5} [style=dotted];
5 -> {1} [style=dotted];
4 -> {5};
5 -> {1};
5 -> {6} [style=dotted];
6 -> {7} [style=dotted];
7 -> {1} [style=dotted];
subgraph cluster_1 {
subgraph cluster_2 {
color=red
6 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_2 {
8 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_3 {
color=blue
8 [label="Enter when"];
subgraph cluster_3 {
color=blue
10 [label="Enter when branch condition "];
11 [label="Const: Boolean(true)"];
12 [label="Exit when branch condition"];
}
10 [label="Enter block"];
subgraph cluster_4 {
color=blue
20 [label="Enter when branch condition else"];
21 [label="Exit when branch condition"];
}
22 [label="Enter when branch result"];
subgraph cluster_5 {
color=blue
23 [label="Enter block"];
24 [label="Const: String()"];
25 [label="Exit block"];
}
26 [label="Exit when branch result"];
13 [label="Enter when branch result"];
subgraph cluster_6 {
color=blue
14 [label="Enter block"];
15 [label="Postponed enter to lambda"];
11 [label="Enter when"];
subgraph cluster_5 {
color=blue
13 [label="Enter when branch condition "];
14 [label="Const: Boolean(true)"];
15 [label="Exit when branch condition"];
}
subgraph cluster_6 {
color=blue
23 [label="Enter when branch condition else"];
24 [label="Exit when branch condition"];
}
25 [label="Enter when branch result"];
subgraph cluster_7 {
color=blue
29 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
31 [label="Function call: R|/materialize|<R|kotlin/String|>()"];
30 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
26 [label="Enter block"];
27 [label="Const: String()"];
28 [label="Exit block"];
}
16 [label="Postponed exit from lambda"];
17 [label="Function call: R|kotlin/run|<R|kotlin/String|>(...)"];
18 [label="Exit block"];
29 [label="Exit when branch result"];
16 [label="Enter when branch result"];
subgraph cluster_8 {
color=blue
17 [label="Enter block"];
18 [label="Postponed enter to lambda"];
subgraph cluster_9 {
color=blue
33 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
35 [label="Enter block"];
36 [label="Function call: R|/materialize|<R|kotlin/String|>()"];
37 [label="Exit block"];
}
34 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
19 [label="Postponed exit from lambda"];
20 [label="Function call: R|kotlin/run|<R|kotlin/String|>(...)"];
21 [label="Exit block"];
}
22 [label="Exit when branch result"];
12 [label="Exit when"];
}
19 [label="Exit when branch result"];
9 [label="Exit when"];
30 [label="Call arguments union" style="filled" fillcolor=yellow];
31 [label="Variable declaration: lval x: R|kotlin/String|"];
32 [label="Exit block"];
}
27 [label="Call arguments union" style="filled" fillcolor=yellow];
28 [label="Variable declaration: lval x: R|kotlin/String|"];
7 [label="Exit function test_1" style="filled" fillcolor=red];
9 [label="Exit function test_1" style="filled" fillcolor=red];
}
6 -> {8};
8 -> {10};
9 -> {27};
10 -> {11};
11 -> {12};
12 -> {13 20};
11 -> {13};
12 -> {30};
13 -> {14};
14 -> {15};
15 -> {29};
15 -> {16} [color=red];
15 -> {16 23};
16 -> {17};
17 -> {18};
18 -> {19};
19 -> {9};
18 -> {33};
18 -> {19} [color=red];
19 -> {20};
20 -> {21};
21 -> {22};
22 -> {23};
22 -> {12};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {9};
26 -> {27};
27 -> {28};
28 -> {7};
29 -> {31};
30 -> {16} [color=green];
30 -> {27} [color=red];
31 -> {30};
28 -> {29};
29 -> {12};
30 -> {31};
31 -> {32};
32 -> {9};
33 -> {35};
34 -> {19} [color=green];
34 -> {30} [color=red];
35 -> {36};
36 -> {37};
37 -> {34};
subgraph cluster_8 {
subgraph cluster_11 {
color=red
32 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_9 {
38 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_12 {
color=blue
34 [label="Try expression enter"];
subgraph cluster_10 {
color=blue
36 [label="Try main block enter"];
subgraph cluster_11 {
color=blue
38 [label="Enter block"];
39 [label="Postponed enter to lambda"];
subgraph cluster_12 {
color=blue
50 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
52 [label="Function call: R|/materialize|<R|kotlin/String|>()"];
51 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
40 [label="Postponed exit from lambda"];
41 [label="Function call: R|kotlin/run|<R|kotlin/String|>(...)"];
42 [label="Exit block"];
}
43 [label="Try main block exit"];
}
40 [label="Enter block"];
subgraph cluster_13 {
color=blue
37 [label="Catch enter"];
41 [label="Try expression enter"];
subgraph cluster_14 {
color=blue
44 [label="Enter block"];
45 [label="Const: String()"];
46 [label="Exit block"];
43 [label="Try main block enter"];
subgraph cluster_15 {
color=blue
45 [label="Enter block"];
46 [label="Postponed enter to lambda"];
subgraph cluster_16 {
color=blue
58 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_17 {
color=blue
60 [label="Enter block"];
61 [label="Function call: R|/materialize|<R|kotlin/String|>()"];
62 [label="Exit block"];
}
59 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
47 [label="Postponed exit from lambda"];
48 [label="Function call: R|kotlin/run|<R|kotlin/String|>(...)"];
49 [label="Exit block"];
}
50 [label="Try main block exit"];
}
47 [label="Catch exit"];
subgraph cluster_18 {
color=blue
44 [label="Catch enter"];
subgraph cluster_19 {
color=blue
51 [label="Enter block"];
52 [label="Const: String()"];
53 [label="Exit block"];
}
54 [label="Catch exit"];
}
42 [label="Try expression exit"];
}
35 [label="Try expression exit"];
55 [label="Call arguments union" style="filled" fillcolor=yellow];
56 [label="Variable declaration: lval x: R|kotlin/String|"];
57 [label="Exit block"];
}
48 [label="Call arguments union" style="filled" fillcolor=yellow];
49 [label="Variable declaration: lval x: R|kotlin/String|"];
33 [label="Exit function test_2" style="filled" fillcolor=red];
39 [label="Exit function test_2" style="filled" fillcolor=red];
}
32 -> {34};
34 -> {36};
35 -> {48};
36 -> {33 37 38};
37 -> {33 44};
38 -> {39};
39 -> {50};
39 -> {40} [color=red];
38 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {35};
44 -> {45};
41 -> {43};
42 -> {55};
43 -> {39 44 45};
44 -> {39 51};
45 -> {46};
46 -> {47};
47 -> {35};
46 -> {58};
46 -> {47} [color=red];
47 -> {48};
48 -> {49};
49 -> {33};
50 -> {52};
51 -> {40} [color=green];
51 -> {48} [color=red];
52 -> {51};
subgraph cluster_15 {
color=red
53 [label="Enter function test_3" style="filled" fillcolor=red];
55 [label="Postponed enter to lambda"];
subgraph cluster_16 {
color=blue
61 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
63 [label="Function call: R|/materialize|<R|kotlin/String?|>()"];
62 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
56 [label="Postponed exit from lambda"];
57 [label="Function call: R|kotlin/run|<R|kotlin/String?|>(...)"];
58 [label="Check not null: R|kotlin/run|<R|kotlin/String?|>(...)!!"];
59 [label="Call arguments union" style="filled" fillcolor=yellow];
60 [label="Variable declaration: lval x: R|kotlin/String|"];
54 [label="Exit function test_3" style="filled" fillcolor=red];
}
53 -> {55};
55 -> {61};
55 -> {56} [color=red];
49 -> {50};
50 -> {42};
51 -> {52};
52 -> {53};
53 -> {54};
54 -> {42};
55 -> {56};
56 -> {57};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {54};
61 -> {63};
62 -> {56} [color=green];
62 -> {59} [color=red];
63 -> {62};
57 -> {39};
58 -> {60};
59 -> {47} [color=green];
59 -> {55} [color=red];
60 -> {61};
61 -> {62};
62 -> {59};
subgraph cluster_20 {
color=red
63 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_21 {
color=blue
65 [label="Enter block"];
66 [label="Postponed enter to lambda"];
subgraph cluster_22 {
color=blue
73 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
75 [label="Enter block"];
76 [label="Function call: R|/materialize|<R|kotlin/String?|>()"];
77 [label="Exit block"];
}
74 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
67 [label="Postponed exit from lambda"];
68 [label="Function call: R|kotlin/run|<R|kotlin/String?|>(...)"];
69 [label="Check not null: R|kotlin/run|<R|kotlin/String?|>(...)!!"];
70 [label="Call arguments union" style="filled" fillcolor=yellow];
71 [label="Variable declaration: lval x: R|kotlin/String|"];
72 [label="Exit block"];
}
64 [label="Exit function test_3" style="filled" fillcolor=red];
}
63 -> {65};
65 -> {66};
66 -> {73};
66 -> {67} [color=red];
67 -> {68};
68 -> {69};
69 -> {70};
70 -> {71};
71 -> {72};
72 -> {64};
73 -> {75};
74 -> {67} [color=green];
74 -> {70} [color=red];
75 -> {76};
76 -> {77};
77 -> {74};
}