Code formatting
This commit is contained in:
committed by
KonstantinAnisimov
parent
ba1f3d502e
commit
eba8a50c43
+4
-2
@@ -312,11 +312,13 @@ internal fun DeclarationDescriptor.getMemberScope(): MemberScope {
|
|||||||
// It is possible to declare "external inline fun",
|
// It is possible to declare "external inline fun",
|
||||||
// but it doesn't have much sense for native,
|
// but it doesn't have much sense for native,
|
||||||
// since externals don't have IR bodies.
|
// 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
|
internal val FunctionDescriptor.needsInlining: Boolean
|
||||||
get() {
|
get() {
|
||||||
val inlineConstructor = annotations.hasAnnotation(FqName("konan.internal.InlineConstructor"))
|
val inlineConstructor = annotations.hasAnnotation(inlineConstructor)
|
||||||
if (inlineConstructor) return true
|
if (inlineConstructor) return true
|
||||||
return (this.isInline && !this.isExternal)
|
return (this.isInline && !this.isExternal)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -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 copyIrElement = DeepCopyIrTreeWithDescriptors(currentScope.scope.scopeOwner, context) // Create DeepCopy for current scope.
|
||||||
val substituteMap = mutableMapOf<ValueDescriptor, IrExpression>()
|
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 ->
|
return statements.map { statement ->
|
||||||
if (statement is IrDelegatingConstructorCallImpl) generateIrCall(statement)
|
if (statement is IrDelegatingConstructorCallImpl) generateIrCall(statement)
|
||||||
|
|||||||
Reference in New Issue
Block a user