FirAbstractBodyResolveTransformer: drop some unused context functions

This commit is contained in:
Mikhail Glukhikh
2021-03-10 19:21:44 +03:00
parent cbf38b119c
commit 6ae948b655
@@ -54,33 +54,10 @@ abstract class FirAbstractBodyResolveTransformer(phase: FirResolvePhase) : FirAb
}
}
protected inline fun <T> withLocalScope(localScope: FirLocalScope?, crossinline l: () -> T): T {
if (localScope == null) return l()
return context.withTowerDataCleanup {
addLocalScope(localScope)
l()
}
}
protected inline fun <T> withPrimaryConstructorParameters(includeProperties: Boolean, crossinline l: () -> T): T {
return context.withTowerDataCleanup {
addLocalScope(
if (includeProperties) context.getPrimaryConstructorAllParametersScope()
else context.getPrimaryConstructorPureParametersScope()
)
l()
}
}
protected fun addNewLocalScope() {
context.addLocalScope(FirLocalScope())
}
protected fun addLocalScope(localScope: FirLocalScope?) {
if (localScope == null) return
context.addLocalScope(localScope)
}
protected open fun needReplacePhase(firDeclaration: FirDeclaration) = true
fun replaceDeclarationResolvePhaseIfNeeded(firDeclaration: FirDeclaration, newResolvePhase: FirResolvePhase) {