[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
@@ -14,10 +14,10 @@ digraph functionCallBound_kt {
subgraph cluster_1 {
color=red
3 [label="Enter class Base" style="filled" fillcolor=red];
4 [label="Exit class Base" style="filled" fillcolor=red];
4 [label="Enter class Base" style="filled" fillcolor=red];
3 [label="Exit class Base" style="filled" fillcolor=red];
}
3 -> {4} [color=green];
4 -> {3} [color=green];
subgraph cluster_2 {
color=red
@@ -30,83 +30,94 @@ digraph functionCallBound_kt {
subgraph cluster_3 {
color=red
13 [label="Enter class Sub" style="filled" fillcolor=red];
subgraph cluster_4 {
color=blue
8 [label="Enter function getter" style="filled" fillcolor=red];
9 [label="Exit function getter" style="filled" fillcolor=red];
}
8 [label="Enter function getter" style="filled" fillcolor=red];
9 [label="Exit function getter" style="filled" fillcolor=red];
}
8 -> {9};
subgraph cluster_4 {
color=red
14 [label="Enter class Sub" style="filled" fillcolor=red];
subgraph cluster_5 {
color=blue
10 [label="Enter property" style="filled" fillcolor=red];
12 [label="Access variable R|<local>/data|"];
11 [label="Exit property" style="filled" fillcolor=red];
}
14 [label="Exit class Sub" style="filled" fillcolor=red];
13 [label="Exit class Sub" style="filled" fillcolor=red];
}
13 -> {10} [color=green];
14 -> {10} [color=green];
10 -> {12};
11 -> {14} [color=green];
11 -> {13} [color=green];
12 -> {11};
8 -> {9};
subgraph cluster_6 {
color=red
15 [label="Enter function isOk" style="filled" fillcolor=red];
17 [label="Const: Boolean(true)"];
18 [label="Jump: ^isOk Boolean(true)"];
19 [label="Stub" style="filled" fillcolor=gray];
subgraph cluster_7 {
color=blue
17 [label="Enter block"];
18 [label="Const: Boolean(true)"];
19 [label="Jump: ^isOk Boolean(true)"];
20 [label="Stub" style="filled" fillcolor=gray];
21 [label="Exit block" style="filled" fillcolor=gray];
}
16 [label="Exit function isOk" style="filled" fillcolor=red];
}
15 -> {17};
17 -> {18};
18 -> {16};
18 -> {19} [style=dotted];
19 -> {16} [style=dotted];
18 -> {19};
19 -> {16};
19 -> {20} [style=dotted];
20 -> {21} [style=dotted];
21 -> {16} [style=dotted];
subgraph cluster_7 {
subgraph cluster_8 {
color=red
20 [label="Enter function check" style="filled" fillcolor=red];
subgraph cluster_8 {
22 [label="Enter function check" style="filled" fillcolor=red];
subgraph cluster_9 {
color=blue
22 [label="Enter when"];
subgraph cluster_9 {
color=blue
24 [label="Enter when branch condition "];
25 [label="Access variable R|<local>/base|"];
26 [label="Type operator: (R|<local>/base| as? R|Sub|)"];
27 [label="Enter safe call"];
29 [label="Function call: $subj$.R|/isOk|()"];
28 [label="Exit safe call"];
30 [label="Const: Boolean(true)"];
31 [label="Operator =="];
32 [label="Exit when branch condition"];
}
24 [label="Enter block"];
subgraph cluster_10 {
color=blue
39 [label="Enter when branch condition else"];
40 [label="Exit when branch condition"];
25 [label="Enter when"];
subgraph cluster_11 {
color=blue
27 [label="Enter when branch condition "];
28 [label="Access variable R|<local>/base|"];
29 [label="Type operator: (R|<local>/base| as? R|Sub|)"];
30 [label="Enter safe call"];
32 [label="Function call: $subj$.R|/isOk|()"];
31 [label="Exit safe call"];
33 [label="Const: Boolean(true)"];
34 [label="Operator =="];
35 [label="Exit when branch condition"];
}
subgraph cluster_12 {
color=blue
42 [label="Enter when branch condition else"];
43 [label="Exit when branch condition"];
}
44 [label="Enter when branch result"];
subgraph cluster_13 {
color=blue
45 [label="Enter block"];
46 [label="Access variable R|<local>/base|"];
47 [label="Exit block"];
}
48 [label="Exit when branch result"];
36 [label="Enter when branch result"];
subgraph cluster_14 {
color=blue
37 [label="Enter block"];
38 [label="Access variable R|<local>/base|"];
39 [label="Access variable R|/Sub.data|"];
40 [label="Exit block"];
}
41 [label="Exit when branch result"];
26 [label="Exit when"];
}
41 [label="Enter when branch result"];
subgraph cluster_11 {
color=blue
42 [label="Enter block"];
43 [label="Access variable R|<local>/base|"];
44 [label="Exit block"];
}
45 [label="Exit when branch result"];
33 [label="Enter when branch result"];
subgraph cluster_12 {
color=blue
34 [label="Enter block"];
35 [label="Access variable R|<local>/base|"];
36 [label="Access variable R|/Sub.data|"];
37 [label="Exit block"];
}
38 [label="Exit when branch result"];
23 [label="Exit when"];
}
46 [label="Jump: ^check when () {
49 [label="Jump: ^check when () {
==((R|<local>/base| as? R|Sub|)?.{ $subj$.R|/isOk|() }, Boolean(true)) -> {
R|<local>/base|.R|/Sub.data|
}
@@ -115,36 +126,40 @@ digraph functionCallBound_kt {
}
}
"];
47 [label="Stub" style="filled" fillcolor=gray];
21 [label="Exit function check" style="filled" fillcolor=red];
50 [label="Stub" style="filled" fillcolor=gray];
51 [label="Exit block" style="filled" fillcolor=gray];
}
23 [label="Exit function check" style="filled" fillcolor=red];
}
20 -> {22};
22 -> {24};
23 -> {46};
24 -> {25};
25 -> {26};
26 -> {27 28};
27 -> {29};
28 -> {30};
29 -> {28};
30 -> {31};
31 -> {32};
32 -> {33 39};
25 -> {27};
26 -> {49};
27 -> {28};
28 -> {29};
29 -> {30 31};
30 -> {32};
31 -> {33};
32 -> {31};
33 -> {34};
34 -> {35};
35 -> {36};
35 -> {36 42};
36 -> {37};
37 -> {38};
38 -> {23};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {42};
41 -> {26};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {23};
46 -> {21};
46 -> {47} [style=dotted];
47 -> {21} [style=dotted];
45 -> {46};
46 -> {47};
47 -> {48};
48 -> {26};
49 -> {23};
49 -> {50} [style=dotted];
50 -> {51} [style=dotted];
51 -> {23} [style=dotted];
}