FIR CFG: remove duplicating lambda enter -> exit connection
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user