From ad5df79e396516d6dbbc04da0fe0235e671cd236 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Tue, 10 Nov 2020 03:54:07 +0300 Subject: [PATCH] [IR] KotlinLikeDumper: merge Break & Continue --- .../jetbrains/kotlin/ir/util/KotlinLikeDumper.kt | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/KotlinLikeDumper.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/KotlinLikeDumper.kt index cfb0956b43e09..8d4ca4ee046cd 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/KotlinLikeDumper.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/KotlinLikeDumper.kt @@ -1194,23 +1194,15 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printlnWithNoIndent() } - private fun IrBreakContinue.printLabel() { - label?.let { + override fun visitBreakContinue(jump: IrBreakContinue, data: IrDeclaration?) { + // TODO render loop reference + p.printWithNoIndent(if (jump is IrContinue) "continue" else "break") + jump.label?.let { p.printWithNoIndent("@") p.printWithNoIndent(it) } } - override fun visitBreak(jump: IrBreak, data: IrDeclaration?) { - p.printWithNoIndent("break") - jump.printLabel() - } - - override fun visitContinue(jump: IrContinue, data: IrDeclaration?) { - p.printWithNoIndent("continue") - jump.printLabel() - } - override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: IrDeclaration?) { p.println("/* ERROR DECLARATION */") }