[LL FIR] reanalyse declarations on the air for incremental analysis
We cannot do it inplace now as we do not have a lock to do it under after analysis started to use declaration-level lock This part is mostly covered by the plugin tests (which failed after the previous commit) ^KT-56543
This commit is contained in:
committed by
Space Team
parent
72def186a3
commit
332cdc514b
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -57,6 +57,10 @@ open class RawFirBuilder(
|
||||
bodyBuildingMode: BodyBuildingMode = BodyBuildingMode.NORMAL
|
||||
) : BaseFirBuilder<PsiElement>(session) {
|
||||
protected open fun bindFunctionTarget(target: FirFunctionTarget, function: FirFunction) = target.bind(function)
|
||||
protected open fun FirFunctionBuilder.additionalFunctionInit() {}
|
||||
protected open fun FirPropertyBuilder.additionalPropertyInit() {}
|
||||
protected open fun FirPropertyAccessorBuilder.additionalPropertyAccessorInit() {}
|
||||
protected open fun FirBackingFieldBuilder.additionalBackingFieldInit() {}
|
||||
|
||||
var mode: BodyBuildingMode = bodyBuildingMode
|
||||
private set
|
||||
@@ -479,6 +483,8 @@ open class RawFirBuilder(
|
||||
this.contractDescription = it
|
||||
}
|
||||
this.propertySymbol = propertySymbol
|
||||
|
||||
additionalPropertyAccessorInit()
|
||||
}.also {
|
||||
it.initContainingClassAttr()
|
||||
bindFunctionTarget(accessorTarget, it)
|
||||
@@ -558,6 +564,8 @@ open class RawFirBuilder(
|
||||
this.initializer = backingFieldInitializer
|
||||
this.isVar = property.isVar
|
||||
this.isVal = !property.isVar
|
||||
|
||||
additionalBackingFieldInit()
|
||||
}
|
||||
} else {
|
||||
FirDefaultPropertyBackingField(
|
||||
@@ -1497,6 +1505,7 @@ open class RawFirBuilder(
|
||||
}
|
||||
}
|
||||
context.firFunctionTargets.removeLast()
|
||||
additionalFunctionInit()
|
||||
}.build().also {
|
||||
bindFunctionTarget(target, it)
|
||||
if (it is FirSimpleFunction) {
|
||||
@@ -1847,6 +1856,7 @@ open class RawFirBuilder(
|
||||
}
|
||||
|
||||
contextReceivers.addAll(convertContextReceivers(this@toFirProperty.contextReceivers))
|
||||
additionalPropertyInit()
|
||||
}.also {
|
||||
if (!isLocal) {
|
||||
fillDanglingConstraintsTo(it)
|
||||
|
||||
Reference in New Issue
Block a user