Code formatting

This commit is contained in:
Konstantin Anisimov
2017-05-10 17:50:15 +07:00
committed by KonstantinAnisimov
parent ba1f3d502e
commit eba8a50c43
2 changed files with 6 additions and 4 deletions
@@ -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)
}
@@ -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<ValueDescriptor, IrExpression>()
var isInlineConstructor = false
var isInlineConstructor = false
//-------------------------------------------------------------------------//
@@ -358,7 +358,7 @@ private class Inliner(val currentScope: ScopeWithIr, val context: Context) {
//-------------------------------------------------------------------------//
private fun replaceDelegatingConstructorCall(statements: MutableList<IrStatement>): MutableList<IrStatement> {
private fun replaceDelegatingConstructorCall(statements: List<IrStatement>): List<IrStatement> {
return statements.map { statement ->
if (statement is IrDelegatingConstructorCallImpl) generateIrCall(statement)