[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
@@ -8,53 +8,56 @@ digraph implicitReceiverAsWhenSubject_kt {
0 [label="Enter function test_1" style="filled" fillcolor=red];
subgraph cluster_1 {
color=blue
2 [label="Enter when"];
4 [label="Access variable this@R|/test_1|"];
2 [label="Enter block"];
subgraph cluster_2 {
color=blue
5 [label="Enter when branch condition "];
6 [label="Type operator: ($subj$ is R|kotlin/collections/List<*>|)"];
7 [label="Exit when branch condition"];
3 [label="Enter when"];
5 [label="Access variable this@R|/test_1|"];
subgraph cluster_3 {
color=blue
6 [label="Enter when branch condition "];
7 [label="Type operator: ($subj$ is R|kotlin/collections/List<*>|)"];
8 [label="Exit when branch condition"];
}
subgraph cluster_4 {
color=blue
15 [label="Enter when branch condition "];
16 [label="Type operator: ($subj$ is R|kotlin/String|)"];
17 [label="Exit when branch condition"];
}
subgraph cluster_5 {
color=blue
23 [label="Enter when branch condition else"];
24 [label="Exit when branch condition"];
}
25 [label="Enter when branch result"];
subgraph cluster_6 {
color=blue
26 [label="Enter block"];
27 [label="Const: Int(0)"];
28 [label="Exit block"];
}
29 [label="Exit when branch result"];
18 [label="Enter when branch result"];
subgraph cluster_7 {
color=blue
19 [label="Enter block"];
20 [label="Access variable R|kotlin/String.length|"];
21 [label="Exit block"];
}
22 [label="Exit when branch result"];
9 [label="Enter when branch result"];
subgraph cluster_8 {
color=blue
10 [label="Enter block"];
11 [label="Access variable this@R|/test_1|"];
12 [label="Access variable R|kotlin/collections/List.size|"];
13 [label="Exit block"];
}
14 [label="Exit when branch result"];
4 [label="Exit when"];
}
subgraph cluster_3 {
color=blue
14 [label="Enter when branch condition "];
15 [label="Type operator: ($subj$ is R|kotlin/String|)"];
16 [label="Exit when branch condition"];
}
subgraph cluster_4 {
color=blue
22 [label="Enter when branch condition else"];
23 [label="Exit when branch condition"];
}
24 [label="Enter when branch result"];
subgraph cluster_5 {
color=blue
25 [label="Enter block"];
26 [label="Const: Int(0)"];
27 [label="Exit block"];
}
28 [label="Exit when branch result"];
17 [label="Enter when branch result"];
subgraph cluster_6 {
color=blue
18 [label="Enter block"];
19 [label="Access variable R|kotlin/String.length|"];
20 [label="Exit block"];
}
21 [label="Exit when branch result"];
8 [label="Enter when branch result"];
subgraph cluster_7 {
color=blue
9 [label="Enter block"];
10 [label="Access variable this@R|/test_1|"];
11 [label="Access variable R|kotlin/collections/List.size|"];
12 [label="Exit block"];
}
13 [label="Exit when branch result"];
3 [label="Exit when"];
}
29 [label="Jump: ^test_1 when (this@R|/test_1|) {
30 [label="Jump: ^test_1 when (this@R|/test_1|) {
($subj$ is R|kotlin/collections/List<*>|) -> {
this@R|/test_1|.R|kotlin/collections/List.size|
}
@@ -66,98 +69,105 @@ digraph implicitReceiverAsWhenSubject_kt {
}
}
"];
30 [label="Stub" style="filled" fillcolor=gray];
31 [label="Stub" style="filled" fillcolor=gray];
32 [label="Exit block" style="filled" fillcolor=gray];
}
1 [label="Exit function test_1" style="filled" fillcolor=red];
}
0 -> {2};
2 -> {4};
3 -> {29};
4 -> {5};
2 -> {3};
3 -> {5};
4 -> {30};
5 -> {6};
6 -> {7};
7 -> {8 14};
8 -> {9};
7 -> {8};
8 -> {9 15};
9 -> {10};
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {3};
14 -> {15};
13 -> {14};
14 -> {4};
15 -> {16};
16 -> {17 22};
17 -> {18};
16 -> {17};
17 -> {18 23};
18 -> {19};
19 -> {20};
20 -> {21};
21 -> {3};
22 -> {23};
21 -> {22};
22 -> {4};
23 -> {24};
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {28};
28 -> {3};
29 -> {1};
29 -> {30} [style=dotted];
30 -> {1} [style=dotted];
28 -> {29};
29 -> {4};
30 -> {1};
30 -> {31} [style=dotted];
31 -> {32} [style=dotted];
32 -> {1} [style=dotted];
subgraph cluster_8 {
subgraph cluster_9 {
color=red
31 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_9 {
33 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_10 {
color=blue
33 [label="Enter when"];
35 [label="Access variable this@R|/test_2|"];
36 [label="Variable declaration: lval x: R|kotlin/Any|"];
subgraph cluster_10 {
color=blue
37 [label="Enter when branch condition "];
38 [label="Type operator: ($subj$ is R|kotlin/collections/List<*>|)"];
39 [label="Exit when branch condition"];
}
35 [label="Enter block"];
subgraph cluster_11 {
color=blue
48 [label="Enter when branch condition "];
49 [label="Type operator: ($subj$ is R|kotlin/String|)"];
50 [label="Exit when branch condition"];
36 [label="Enter when"];
38 [label="Access variable this@R|/test_2|"];
39 [label="Variable declaration: lval x: R|kotlin/Any|"];
subgraph cluster_12 {
color=blue
40 [label="Enter when branch condition "];
41 [label="Type operator: ($subj$ is R|kotlin/collections/List<*>|)"];
42 [label="Exit when branch condition"];
}
subgraph cluster_13 {
color=blue
51 [label="Enter when branch condition "];
52 [label="Type operator: ($subj$ is R|kotlin/String|)"];
53 [label="Exit when branch condition"];
}
subgraph cluster_14 {
color=blue
61 [label="Enter when branch condition else"];
62 [label="Exit when branch condition"];
}
63 [label="Enter when branch result"];
subgraph cluster_15 {
color=blue
64 [label="Enter block"];
65 [label="Const: Int(0)"];
66 [label="Exit block"];
}
67 [label="Exit when branch result"];
54 [label="Enter when branch result"];
subgraph cluster_16 {
color=blue
55 [label="Enter block"];
56 [label="Access variable R|<local>/x|"];
57 [label="Access variable R|kotlin/String.length|"];
58 [label="Access variable R|kotlin/String.length|"];
59 [label="Exit block"];
}
60 [label="Exit when branch result"];
43 [label="Enter when branch result"];
subgraph cluster_17 {
color=blue
44 [label="Enter block"];
45 [label="Access variable R|<local>/x|"];
46 [label="Access variable R|kotlin/collections/List.size|"];
47 [label="Access variable this@R|/test_2|"];
48 [label="Access variable R|kotlin/collections/List.size|"];
49 [label="Exit block"];
}
50 [label="Exit when branch result"];
37 [label="Exit when"];
}
subgraph cluster_12 {
color=blue
58 [label="Enter when branch condition else"];
59 [label="Exit when branch condition"];
}
60 [label="Enter when branch result"];
subgraph cluster_13 {
color=blue
61 [label="Enter block"];
62 [label="Const: Int(0)"];
63 [label="Exit block"];
}
64 [label="Exit when branch result"];
51 [label="Enter when branch result"];
subgraph cluster_14 {
color=blue
52 [label="Enter block"];
53 [label="Access variable R|<local>/x|"];
54 [label="Access variable R|kotlin/String.length|"];
55 [label="Access variable R|kotlin/String.length|"];
56 [label="Exit block"];
}
57 [label="Exit when branch result"];
40 [label="Enter when branch result"];
subgraph cluster_15 {
color=blue
41 [label="Enter block"];
42 [label="Access variable R|<local>/x|"];
43 [label="Access variable R|kotlin/collections/List.size|"];
44 [label="Access variable this@R|/test_2|"];
45 [label="Access variable R|kotlin/collections/List.size|"];
46 [label="Exit block"];
}
47 [label="Exit when branch result"];
34 [label="Exit when"];
}
65 [label="Jump: ^test_2 when (lval x: R|kotlin/Any| = this@R|/test_2|) {
68 [label="Jump: ^test_2 when (lval x: R|kotlin/Any| = this@R|/test_2|) {
($subj$ is R|kotlin/collections/List<*>|) -> {
R|<local>/x|.R|kotlin/collections/List.size|
this@R|/test_2|.R|kotlin/collections/List.size|
@@ -171,44 +181,48 @@ digraph implicitReceiverAsWhenSubject_kt {
}
}
"];
66 [label="Stub" style="filled" fillcolor=gray];
32 [label="Exit function test_2" style="filled" fillcolor=red];
69 [label="Stub" style="filled" fillcolor=gray];
70 [label="Exit block" style="filled" fillcolor=gray];
}
34 [label="Exit function test_2" style="filled" fillcolor=red];
}
31 -> {33};
33 -> {35};
34 -> {65};
35 -> {36};
36 -> {37};
37 -> {38};
36 -> {38};
37 -> {68};
38 -> {39};
39 -> {40 48};
39 -> {40};
40 -> {41};
41 -> {42};
42 -> {43};
42 -> {43 51};
43 -> {44};
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {34};
47 -> {48};
48 -> {49};
49 -> {50};
50 -> {51 58};
50 -> {37};
51 -> {52};
52 -> {53};
53 -> {54};
53 -> {54 61};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {34};
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
60 -> {37};
61 -> {62};
62 -> {63};
63 -> {64};
64 -> {34};
65 -> {32};
65 -> {66} [style=dotted];
66 -> {32} [style=dotted];
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {37};
68 -> {34};
68 -> {69} [style=dotted];
69 -> {70} [style=dotted];
70 -> {34} [style=dotted];
}