FIR: don't flatten for loop blocks in raw FIR builder

This commit is contained in:
Mikhail Glukhikh
2021-04-16 15:47:44 +03:00
parent a736d62edd
commit 43a2ad0467
27 changed files with 1255 additions and 1105 deletions
@@ -166,83 +166,88 @@ digraph smartcastToNothing_kt {
52 [label="Enter block"];
53 [label="Const: Null(null)"];
54 [label="Variable declaration: lvar s: R|A?|"];
55 [label="Access variable R|<local>/results|"];
56 [label="Function call: R|<local>/results|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<kotlin/Nothing>|>|()"];
57 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<kotlin/Nothing>|"];
subgraph cluster_16 {
color=blue
58 [label="Enter while loop"];
55 [label="Enter block"];
56 [label="Access variable R|<local>/results|"];
57 [label="Function call: R|<local>/results|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<kotlin/Nothing>|>|()"];
58 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<kotlin/Nothing>|"];
subgraph cluster_17 {
color=blue
59 [label="Enter loop condition"];
60 [label="Access variable R|<local>/<iterator>|"];
61 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
62 [label="Exit loop condition"];
}
subgraph cluster_18 {
color=blue
63 [label="Enter loop block"];
59 [label="Enter while loop"];
subgraph cluster_18 {
color=blue
60 [label="Enter loop condition"];
61 [label="Access variable R|<local>/<iterator>|"];
62 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
63 [label="Exit loop condition"];
}
subgraph cluster_19 {
color=blue
64 [label="Enter block"];
65 [label="Access variable R|<local>/<iterator>|"];
66 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Nothing|>|()"];
67 [label="Stub" style="filled" fillcolor=gray];
68 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray];
69 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
70 [label="Stub" style="filled" fillcolor=gray];
71 [label="Assignment: R|<local>/s|" style="filled" fillcolor=gray];
64 [label="Enter loop block"];
subgraph cluster_20 {
color=blue
72 [label="Enter when" style="filled" fillcolor=gray];
65 [label="Enter block"];
66 [label="Access variable R|<local>/<iterator>|"];
67 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Nothing|>|()"];
68 [label="Stub" style="filled" fillcolor=gray];
69 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray];
70 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
71 [label="Stub" style="filled" fillcolor=gray];
72 [label="Assignment: R|<local>/s|" style="filled" fillcolor=gray];
subgraph cluster_21 {
color=blue
73 [label="Enter when branch condition " style="filled" fillcolor=gray];
74 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
75 [label="Stub" style="filled" fillcolor=gray];
76 [label="Access variable <Unresolved name: b>#" style="filled" fillcolor=gray];
77 [label="Exit when branch condition" style="filled" fillcolor=gray];
73 [label="Enter when" style="filled" fillcolor=gray];
subgraph cluster_22 {
color=blue
74 [label="Enter when branch condition " style="filled" fillcolor=gray];
75 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
76 [label="Stub" style="filled" fillcolor=gray];
77 [label="Access variable <Unresolved name: b>#" style="filled" fillcolor=gray];
78 [label="Exit when branch condition" style="filled" fillcolor=gray];
}
79 [label="Synthetic else branch" style="filled" fillcolor=gray];
80 [label="Enter when branch result" style="filled" fillcolor=gray];
subgraph cluster_23 {
color=blue
81 [label="Enter block" style="filled" fillcolor=gray];
82 [label="Jump: break@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()] " style="filled" fillcolor=gray];
83 [label="Stub" style="filled" fillcolor=gray];
84 [label="Exit block" style="filled" fillcolor=gray];
}
85 [label="Exit when branch result" style="filled" fillcolor=gray];
86 [label="Exit when" style="filled" fillcolor=gray];
}
78 [label="Synthetic else branch" style="filled" fillcolor=gray];
79 [label="Enter when branch result" style="filled" fillcolor=gray];
subgraph cluster_22 {
color=blue
80 [label="Enter block" style="filled" fillcolor=gray];
81 [label="Jump: break@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()] " style="filled" fillcolor=gray];
82 [label="Stub" style="filled" fillcolor=gray];
83 [label="Exit block" style="filled" fillcolor=gray];
}
84 [label="Exit when branch result" style="filled" fillcolor=gray];
85 [label="Exit when" style="filled" fillcolor=gray];
87 [label="Exit block" style="filled" fillcolor=gray];
}
86 [label="Exit block" style="filled" fillcolor=gray];
88 [label="Exit loop block" style="filled" fillcolor=gray];
}
87 [label="Exit loop block" style="filled" fillcolor=gray];
89 [label="Exit whileloop"];
}
88 [label="Exit whileloop"];
90 [label="Exit block"];
}
89 [label="Access variable R|<local>/s|"];
90 [label="Enter safe call"];
91 [label="Postponed enter to lambda"];
subgraph cluster_23 {
91 [label="Access variable R|<local>/s|"];
92 [label="Enter safe call"];
93 [label="Postponed enter to lambda"];
subgraph cluster_24 {
color=blue
98 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_24 {
100 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_25 {
color=blue
99 [label="Enter block"];
100 [label="Access variable R|<local>/it|"];
101 [label="Access variable R|/A.a|"];
102 [label="Exit block"];
101 [label="Enter block"];
102 [label="Access variable R|<local>/it|"];
103 [label="Access variable R|/A.a|"];
104 [label="Exit block"];
}
103 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
105 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
92 [label="Call arguments union" style="filled" fillcolor=yellow];
93 [label="Postponed exit from lambda"];
94 [label="Function call: $subj$.R|kotlin/let|<R|A|, R|kotlin/Int|>(...)"];
95 [label="Exit safe call"];
96 [label="Exit block"];
94 [label="Call arguments union" style="filled" fillcolor=yellow];
95 [label="Postponed exit from lambda"];
96 [label="Function call: $subj$.R|kotlin/let|<R|A|, R|kotlin/Int|>(...)"];
97 [label="Exit safe call"];
98 [label="Exit block"];
}
97 [label="Exit function test_0" style="filled" fillcolor=red];
99 [label="Exit function test_0" style="filled" fillcolor=red];
}
51 -> {52};
52 -> {53};
@@ -255,52 +260,54 @@ digraph smartcastToNothing_kt {
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {88 63};
63 -> {64};
62 -> {63};
63 -> {89 64};
64 -> {65};
65 -> {66};
66 -> {97} [label=onUncaughtException];
66 -> {67} [style=dotted];
66 -> {67};
67 -> {99} [label=onUncaughtException];
67 -> {68} [style=dotted];
68 -> {69} [style=dotted];
69 -> {70} [style=dotted];
69 -> {97} [style=dotted] [label=onUncaughtException];
70 -> {71} [style=dotted];
70 -> {99} [style=dotted] [label=onUncaughtException];
71 -> {72} [style=dotted];
72 -> {73} [style=dotted];
73 -> {74} [style=dotted];
74 -> {75} [style=dotted];
74 -> {97} [style=dotted] [label=onUncaughtException];
75 -> {76} [style=dotted];
75 -> {99} [style=dotted] [label=onUncaughtException];
76 -> {77} [style=dotted];
77 -> {79 78} [style=dotted];
78 -> {85} [style=dotted];
79 -> {80} [style=dotted];
77 -> {78} [style=dotted];
78 -> {80 79} [style=dotted];
79 -> {86} [style=dotted];
80 -> {81} [style=dotted];
81 -> {88 82} [style=dotted];
82 -> {83} [style=dotted];
81 -> {82} [style=dotted];
82 -> {89 83} [style=dotted];
83 -> {84} [style=dotted];
84 -> {85} [style=dotted];
85 -> {86} [style=dotted];
86 -> {87} [style=dotted];
87 -> {59} [color=green style=dotted];
88 -> {89};
89 -> {90 95};
87 -> {88} [style=dotted];
88 -> {60} [color=green style=dotted];
89 -> {90};
90 -> {91};
91 -> {98};
91 -> {93} [color=red];
91 -> {98} [style=dashed];
92 -> {94} [color=red];
93 -> {94} [color=green];
94 -> {95};
95 -> {96};
91 -> {92 97};
92 -> {93};
93 -> {100};
93 -> {95} [color=red];
93 -> {100} [style=dashed];
94 -> {96} [color=red];
95 -> {96} [color=green];
96 -> {97};
97 -> {98};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {92} [color=red];
103 -> {93} [color=green];
103 -> {104};
104 -> {105};
105 -> {94} [color=red];
105 -> {95} [color=green];
}