diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/IrElementTransformerVoidWithContext.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/IrElementTransformerVoidWithContext.kt index 94ed32b1d90..d03de2bbfff 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/IrElementTransformerVoidWithContext.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/IrElementTransformerVoidWithContext.kt @@ -24,12 +24,6 @@ import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid import org.jetbrains.kotlin.descriptors.* -private fun MutableList.push(element: E) = this.add(element) - -private fun MutableList.pop() = this.removeAt(size - 1) - -private fun MutableList.peek(): E? = if (size == 0) null else this[size - 1] - internal class ScopeWithIr(val scope: Scope, val irElement: IrElement) abstract internal class IrElementTransformerVoidWithContext : IrElementTransformerVoid() { diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/Utils.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/Utils.kt index 41433806827..c68d17df735 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/Utils.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/Utils.kt @@ -40,4 +40,11 @@ val BackendContext.messageCollector: MessageCollector fun BackendContext.reportWarning(message: String, irFile: IrFile, irElement: IrElement) { val location = irElement.getCompilerMessageLocation(irFile) this.messageCollector.report(CompilerMessageSeverity.WARNING, message, location) -} \ No newline at end of file +} + +fun MutableList.push(element: E) = this.add(element) + +fun MutableList.pop() = this.removeAt(size - 1) + +fun MutableList.peek(): E? = if (size == 0) null else this[size - 1] + diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/lower/AbstractClosureAnnotator.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/lower/AbstractClosureAnnotator.kt index dde301fa103..d80d85f54b9 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/lower/AbstractClosureAnnotator.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/common/lower/AbstractClosureAnnotator.kt @@ -16,6 +16,7 @@ package org.jetbrains.kotlin.backend.common.lower +import org.jetbrains.kotlin.backend.common.* import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.declarations.* @@ -31,12 +32,6 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils // TODO: rename the file. class Closure(val capturedValues: List = emptyList()) -private fun MutableList.push(element: E) = this.add(element) - -private fun MutableList.pop() = this.removeAt(size - 1) - -private fun MutableList.peek(): E? = if (size == 0) null else this[size - 1] - class ClosureAnnotator { private val closureBuilders = mutableMapOf() diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FinallyBlocksLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FinallyBlocksLowering.kt index d4c77f5bc07..32908bd697f 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FinallyBlocksLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FinallyBlocksLowering.kt @@ -3,6 +3,7 @@ package org.jetbrains.kotlin.backend.konan.lower import org.jetbrains.kotlin.backend.common.DeepCopyIrTreeWithDeclarations import org.jetbrains.kotlin.backend.common.FunctionLoweringPass import org.jetbrains.kotlin.backend.common.lower.* +import org.jetbrains.kotlin.backend.common.* import org.jetbrains.kotlin.backend.konan.Context import org.jetbrains.kotlin.backend.konan.descriptors.synthesizedName import org.jetbrains.kotlin.backend.konan.ir.IrReturnableBlockImpl @@ -26,12 +27,6 @@ import org.jetbrains.kotlin.types.typeUtil.isUnit internal class FinallyBlocksLowering(val context: Context): FunctionLoweringPass { - private fun MutableList.push(element: E) = this.add(element) - - private fun MutableList.pop() = this.removeAt(size - 1) - - private fun MutableList.peek(): E? = if (size == 0) null else this[size - 1] - private interface HighLevelJump { fun toIr(context: Context, startOffset: Int, endOffset: Int, value: IrExpression): IrExpression } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt index 2ea4c52cedd..a71ee1b4a4b 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.backend.common.DeclarationContainerLoweringPass import org.jetbrains.kotlin.backend.common.descriptors.explicitParameters import org.jetbrains.kotlin.backend.common.descriptors.isSuspend import org.jetbrains.kotlin.backend.common.lower.* +import org.jetbrains.kotlin.backend.common.* import org.jetbrains.kotlin.backend.konan.Context import org.jetbrains.kotlin.backend.konan.descriptors.getKonanInternalClass import org.jetbrains.kotlin.backend.konan.descriptors.getKonanInternalFunctions @@ -1288,12 +1289,6 @@ internal class SuspendFunctionsLowering(val context: Context): DeclarationContai private open class VariablesScopeTracker: IrElementVisitorVoid { - private fun MutableList.push(element: E) = this.add(element) - - private fun MutableList.pop() = this.removeAt(size - 1) - - private fun MutableList.peek(): E? = if (size == 0) null else this[size - 1] - protected val scopeStack = mutableListOf>(mutableSetOf()) override fun visitElement(element: IrElement) {