提交 32cfee50 编写于 作者: M Mikhail Glukhikh

FIR CFG: remove duplicating lambda enter -> exit connection

上级 5ef37148
......@@ -310,14 +310,14 @@ digraph flowFromInplaceLambda_kt {
106 [label="Exit function test_4" style="filled" fillcolor=red];
}
105 -> {107};
107 -> {108 108} [color=green];
107 -> {108} [color=green];
107 -> {126} [color=red];
108 -> {109};
109 -> {110};
110 -> {111};
111 -> {112};
112 -> {113};
113 -> {114 114} [color=green];
113 -> {114} [color=green];
113 -> {132} [color=red];
114 -> {115};
115 -> {116};
......@@ -419,7 +419,7 @@ digraph flowFromInplaceLambda_kt {
159 [label="Exit function test_6" style="filled" fillcolor=red];
}
158 -> {160};
160 -> {161 161} [color=green];
160 -> {161} [color=green];
160 -> {165} [color=red];
161 -> {162};
162 -> {163};
......
......@@ -39,7 +39,7 @@ digraph lambdaAsReturnOfLambda_kt {
11 [label="Exit property" style="filled" fillcolor=red];
}
10 -> {12};
12 -> {13 13} [color=green];
12 -> {13} [color=green];
12 -> {0} [color=red];
13 -> {14};
14 -> {15};
......
......@@ -72,7 +72,7 @@ digraph lambdaReturningObject_kt {
18 [label="Exit function foo" style="filled" fillcolor=red];
}
17 -> {19};
19 -> {20 20} [color=green];
19 -> {20} [color=green];
19 -> {23} [color=red];
20 -> {21};
21 -> {22};
......
......@@ -54,7 +54,7 @@ digraph postponedLambdaInConstructor_kt {
13 -> {15};
14 -> {9} [color=green];
14 -> {12} [color=red];
15 -> {16 16} [color=green];
15 -> {16} [color=green];
15 -> {17} [color=red];
16 -> {14};
17 -> {19};
......
......@@ -477,7 +477,7 @@ digraph returns_kt {
166 -> {167};
167 -> {145};
168 -> {169};
169 -> {170 170} [color=green];
169 -> {170} [color=green];
169 -> {172} [color=red];
170 -> {171};
171 -> {140};
......
......@@ -142,7 +142,7 @@ digraph safeCalls_kt {
47 -> {44};
48 -> {50};
49 -> {53};
50 -> {51 51} [color=green];
50 -> {51} [color=green];
50 -> {55} [color=red];
51 -> {52};
52 -> {49};
......
......@@ -274,7 +274,7 @@ digraph callsInPlace_kt {
93 [label="Exit function test_8" style="filled" fillcolor=red];
}
92 -> {94};
94 -> {95 95} [color=green];
94 -> {95} [color=green];
94 -> {97} [color=red];
95 -> {96};
96 -> {93};
......
......@@ -163,14 +163,14 @@ digraph delegateWithAnonymousObject_kt {
66 -> {54} [color=green];
54 -> {56};
55 -> {67} [color=green];
56 -> {57 57} [color=green];
56 -> {57} [color=green];
57 -> {58};
58 -> {59};
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {64 64} [color=green];
63 -> {64} [color=green];
63 -> {21} [color=red];
64 -> {65};
65 -> {55};
......
......@@ -155,7 +155,7 @@ finally {
33 -> {41};
34 -> {35};
35 -> {36};
36 -> {37 37} [color=green];
36 -> {37} [color=green];
36 -> {46} [color=red];
37 -> {38};
38 -> {39};
......
......@@ -68,6 +68,10 @@ sealed class CFGNode<out E : FirElement>(val owner: ControlFlowGraph, val level:
internal fun addEdge(from: CFGNode<*>, to: CFGNode<*>, kind: EdgeKind, propagateDeadness: Boolean) {
from._followingNodes += to
to._previousNodes += from
addJustKindEdge(from, to, kind, propagateDeadness)
}
internal fun addJustKindEdge(from: CFGNode<*>, to: CFGNode<*>, kind: EdgeKind, propagateDeadness: Boolean) {
if (kind != EdgeKind.Simple) {
from._outgoingEdges[to] = kind
to._incomingEdges[from] = kind
......
......@@ -166,7 +166,7 @@ class ControlFlowGraphBuilder {
if (postponedExitNode != null) {
requireNotNull(postponedEnterNode)
val kind = if (postponedEnterNode.isDead) EdgeKind.Dead else EdgeKind.Cfg
CFGNode.addEdge(postponedEnterNode, postponedExitNode, kind, propagateDeadness = true)
CFGNode.addJustKindEdge(postponedEnterNode, postponedExitNode, kind, propagateDeadness = true)
}
lexicalScopes.pop()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册