[FIR] Split FirAnonymousFunction to expression and declaration

This commit is contained in:
Dmitriy Novozhilov
2021-06-10 11:06:04 +03:00
parent 85b844c748
commit 823cbc59b7
47 changed files with 466 additions and 190 deletions
+87 -85
View File
@@ -115,26 +115,27 @@ digraph lambdas_kt {
39 [label="Postponed enter to lambda"];
subgraph cluster_14 {
color=blue
47 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
48 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_15 {
color=blue
48 [label="Enter block"];
49 [label="Access variable R|<local>/x|"];
50 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
51 [label="Exit block"];
49 [label="Enter block"];
50 [label="Access variable R|<local>/x|"];
51 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
52 [label="Exit block"];
}
52 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
53 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
40 [label="Postponed exit from lambda"];
41 [label="Variable declaration: lval lambda: R|() -> kotlin/Int|"];
42 [label="Exit block"];
41 [label="Exit anonymous function expression"];
42 [label="Variable declaration: lval lambda: R|() -> kotlin/Int|"];
43 [label="Exit block"];
}
43 [label="Exit when branch result"];
44 [label="Exit when"];
44 [label="Exit when branch result"];
45 [label="Exit when"];
}
45 [label="Exit block"];
46 [label="Exit block"];
}
46 [label="Exit function test_2" style="filled" fillcolor=red];
47 [label="Exit function test_2" style="filled" fillcolor=red];
}
29 -> {30};
30 -> {31};
@@ -143,148 +144,149 @@ digraph lambdas_kt {
33 -> {34};
34 -> {35};
35 -> {37 36};
36 -> {44};
36 -> {45};
37 -> {38};
38 -> {39};
39 -> {40 47};
39 -> {47} [style=dashed];
39 -> {40 48};
39 -> {48} [style=dashed];
40 -> {41};
41 -> {42};
42 -> {43};
43 -> {44};
44 -> {45};
45 -> {46};
47 -> {48};
46 -> {47};
48 -> {49};
49 -> {50};
50 -> {51};
51 -> {52};
52 -> {53};
subgraph cluster_16 {
color=red
53 [label="Enter function getInt" style="filled" fillcolor=red];
54 [label="Enter function getInt" style="filled" fillcolor=red];
subgraph cluster_17 {
color=blue
54 [label="Enter block"];
55 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
56 [label="Const: Int(1)"];
57 [label="Jump: ^getInt Int(1)"];
58 [label="Stub" style="filled" fillcolor=gray];
59 [label="Exit block" style="filled" fillcolor=gray];
55 [label="Enter block"];
56 [label="Function call: R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()"];
57 [label="Const: Int(1)"];
58 [label="Jump: ^getInt Int(1)"];
59 [label="Stub" style="filled" fillcolor=gray];
60 [label="Exit block" style="filled" fillcolor=gray];
}
60 [label="Exit function getInt" style="filled" fillcolor=red];
61 [label="Exit function getInt" style="filled" fillcolor=red];
}
53 -> {54};
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {60};
57 -> {58} [style=dotted];
57 -> {58};
58 -> {61};
58 -> {59} [style=dotted];
59 -> {60} [style=dotted];
60 -> {61} [style=dotted];
subgraph cluster_18 {
color=red
61 [label="Enter function test_3" style="filled" fillcolor=red];
62 [label="Enter function test_3" style="filled" fillcolor=red];
subgraph cluster_19 {
color=blue
62 [label="Enter block"];
63 [label="Postponed enter to lambda"];
63 [label="Enter block"];
64 [label="Postponed enter to lambda"];
subgraph cluster_20 {
color=blue
70 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
71 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_21 {
color=blue
71 [label="Enter block"];
72 [label="Const: Int(1)"];
73 [label="Jump: ^test_3 Int(1)"];
74 [label="Stub" style="filled" fillcolor=gray];
75 [label="Exit block" style="filled" fillcolor=gray];
72 [label="Enter block"];
73 [label="Const: Int(1)"];
74 [label="Jump: ^test_3 Int(1)"];
75 [label="Stub" style="filled" fillcolor=gray];
76 [label="Exit block" style="filled" fillcolor=gray];
}
76 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
77 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
64 [label="Postponed exit from lambda"];
65 [label="Function call: R|/getInt|(...)"];
66 [label="Jump: ^test_3 R|/getInt|(<L> = getInt@fun <anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
65 [label="Postponed exit from lambda"];
66 [label="Function call: R|/getInt|(...)"];
67 [label="Jump: ^test_3 R|/getInt|(<L> = getInt@fun <anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
^test_3 Int(1)
}
)"];
67 [label="Stub" style="filled" fillcolor=gray];
68 [label="Exit block" style="filled" fillcolor=gray];
68 [label="Stub" style="filled" fillcolor=gray];
69 [label="Exit block" style="filled" fillcolor=gray];
}
69 [label="Exit function test_3" style="filled" fillcolor=red];
70 [label="Exit function test_3" style="filled" fillcolor=red];
}
61 -> {62};
62 -> {63};
63 -> {70};
63 -> {64} [color=red];
63 -> {70} [style=dashed];
64 -> {65};
63 -> {64};
64 -> {71};
64 -> {65} [color=red];
64 -> {71} [style=dashed];
65 -> {66};
66 -> {69};
66 -> {67} [style=dotted];
66 -> {67};
67 -> {70};
67 -> {68} [style=dotted];
68 -> {69} [style=dotted];
70 -> {76 71};
71 -> {72};
69 -> {70} [style=dotted];
71 -> {77 72};
72 -> {73};
73 -> {69};
73 -> {74} [style=dotted];
73 -> {74};
74 -> {70};
74 -> {75} [style=dotted];
75 -> {76} [style=dotted];
76 -> {64} [color=green];
76 -> {70} [color=green style=dashed];
76 -> {77} [style=dotted];
77 -> {65} [color=green];
77 -> {71} [color=green style=dashed];
subgraph cluster_22 {
color=red
77 [label="Enter function test_4" style="filled" fillcolor=red];
78 [label="Enter function test_4" style="filled" fillcolor=red];
subgraph cluster_23 {
color=blue
78 [label="Enter block"];
79 [label="Postponed enter to lambda"];
79 [label="Enter block"];
80 [label="Postponed enter to lambda"];
subgraph cluster_24 {
color=blue
86 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
87 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_25 {
color=blue
87 [label="Enter block"];
88 [label="Const: Int(1)"];
89 [label="Jump: ^test_4 Int(1)"];
90 [label="Stub" style="filled" fillcolor=gray];
91 [label="Exit block" style="filled" fillcolor=gray];
88 [label="Enter block"];
89 [label="Const: Int(1)"];
90 [label="Jump: ^test_4 Int(1)"];
91 [label="Stub" style="filled" fillcolor=gray];
92 [label="Exit block" style="filled" fillcolor=gray];
}
92 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
93 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
80 [label="Postponed exit from lambda"];
81 [label="Function call: R|/getInt|(...)"];
82 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun <anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
81 [label="Postponed exit from lambda"];
82 [label="Function call: R|/getInt|(...)"];
83 [label="Jump: ^test_4 R|/getInt|(block = getInt@fun <anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
^test_4 Int(1)
}
)"];
83 [label="Stub" style="filled" fillcolor=gray];
84 [label="Exit block" style="filled" fillcolor=gray];
84 [label="Stub" style="filled" fillcolor=gray];
85 [label="Exit block" style="filled" fillcolor=gray];
}
85 [label="Exit function test_4" style="filled" fillcolor=red];
86 [label="Exit function test_4" style="filled" fillcolor=red];
}
77 -> {78};
78 -> {79};
79 -> {86};
79 -> {80} [color=red];
79 -> {86} [style=dashed];
80 -> {81};
79 -> {80};
80 -> {87};
80 -> {81} [color=red];
80 -> {87} [style=dashed];
81 -> {82};
82 -> {85};
82 -> {83} [style=dotted];
82 -> {83};
83 -> {86};
83 -> {84} [style=dotted];
84 -> {85} [style=dotted];
86 -> {92 87};
87 -> {88};
85 -> {86} [style=dotted];
87 -> {93 88};
88 -> {89};
89 -> {85};
89 -> {90} [style=dotted];
89 -> {90};
90 -> {86};
90 -> {91} [style=dotted];
91 -> {92} [style=dotted];
92 -> {80} [color=green];
92 -> {86} [color=green style=dashed];
92 -> {93} [style=dotted];
93 -> {81} [color=green];
93 -> {87} [color=green style=dashed];
}