From eba8a50c43902a3c8c0fa2f46aa38149afe37cd7 Mon Sep 17 00:00:00 2001 From: Konstantin Anisimov Date: Wed, 10 May 2017 17:50:15 +0700 Subject: [PATCH] Code formatting --- .../kotlin/backend/konan/descriptors/DescriptorUtils.kt | 6 ++++-- .../kotlin/backend/konan/lower/FunctionInlining.kt | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt index b755c2ee760..2cad3e24d8b 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt @@ -312,11 +312,13 @@ internal fun DeclarationDescriptor.getMemberScope(): MemberScope { // It is possible to declare "external inline fun", // but it doesn't have much sense for native, // since externals don't have IR bodies. -// Enforce inlining of some constructors. +// Enforce inlining of constructors annotated with @InlineConstructor. + +private val inlineConstructor = FqName("konan.internal.InlineConstructor") internal val FunctionDescriptor.needsInlining: Boolean get() { - val inlineConstructor = annotations.hasAnnotation(FqName("konan.internal.InlineConstructor")) + val inlineConstructor = annotations.hasAnnotation(inlineConstructor) if (inlineConstructor) return true return (this.isInline && !this.isExternal) } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt index f21451fa3d7..17df9f56dea 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt @@ -102,7 +102,7 @@ private class Inliner(val currentScope: ScopeWithIr, val context: Context) { val copyIrElement = DeepCopyIrTreeWithDescriptors(currentScope.scope.scopeOwner, context) // Create DeepCopy for current scope. val substituteMap = mutableMapOf() - var isInlineConstructor = false + var isInlineConstructor = false //-------------------------------------------------------------------------// @@ -358,7 +358,7 @@ private class Inliner(val currentScope: ScopeWithIr, val context: Context) { //-------------------------------------------------------------------------// - private fun replaceDelegatingConstructorCall(statements: MutableList): MutableList { + private fun replaceDelegatingConstructorCall(statements: List): List { return statements.map { statement -> if (statement is IrDelegatingConstructorCallImpl) generateIrCall(statement)