[FIR] Add Stub kind for CFG
Edges of stub graphs shouldn't be completed
This commit is contained in:
@@ -35,6 +35,7 @@ class ControlFlowGraph(val declaration: FirDeclaration?, val name: String, val k
|
|||||||
internal fun complete() {
|
internal fun complete() {
|
||||||
assertState(State.Building)
|
assertState(State.Building)
|
||||||
state = State.Completed
|
state = State.Completed
|
||||||
|
if (kind == Kind.Stub) return
|
||||||
val sortedNodes = orderNodes()
|
val sortedNodes = orderNodes()
|
||||||
assert(sortedNodes.size == _nodes.size)
|
assert(sortedNodes.size == _nodes.size)
|
||||||
for (node in _nodes) {
|
for (node in _nodes) {
|
||||||
@@ -80,6 +81,7 @@ class ControlFlowGraph(val declaration: FirDeclaration?, val name: String, val k
|
|||||||
TopLevel(withBody = false),
|
TopLevel(withBody = false),
|
||||||
AnnotationCall(withBody = true),
|
AnnotationCall(withBody = true),
|
||||||
DefaultArgument(withBody = false),
|
DefaultArgument(withBody = false),
|
||||||
|
Stub(withBody = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -318,7 +318,7 @@ class ControlFlowGraphBuilder {
|
|||||||
|
|
||||||
fun enterClass() {
|
fun enterClass() {
|
||||||
pushGraph(
|
pushGraph(
|
||||||
ControlFlowGraph(null, "STUB_CLASS_GRAPH", ControlFlowGraph.Kind.ClassInitializer),
|
ControlFlowGraph(null, "STUB_CLASS_GRAPH", ControlFlowGraph.Kind.Stub),
|
||||||
mode = Mode.ClassInitializer
|
mode = Mode.ClassInitializer
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user