[JS IR] Cleanup StageController & Lowerings magic a bit

This commit is contained in:
Roman Artemev
2021-12-23 14:36:31 +03:00
committed by teamcity
parent 7341a17a5d
commit 93e7eb2a8e
16 changed files with 62 additions and 166 deletions
@@ -8,19 +8,9 @@ package org.jetbrains.kotlin.ir.declarations
import org.jetbrains.kotlin.ir.util.IdSignature
open class StageController(open val currentStage: Int = 0) {
open fun <T> withStage(stage: Int, fn: () -> T): T = fn()
open val bodiesEnabled: Boolean get() = true
open fun <T> withInitialIr(block: () -> T): T = block()
open fun <T> restrictTo(declaration: IrDeclaration, fn: () -> T): T = fn()
open fun <T> bodyLowering(fn: () -> T): T = fn()
open fun <T> unrestrictDeclarationListsAccess(fn: () -> T): T = fn()
open fun canAccessDeclarationsOf(irClass: IrClass): Boolean = true
open fun <T> withInitialIr(block: () -> T): T = block()
// Used in JS IC. Declarations created during lowerings need meaningful signatures.
open fun createSignature(parentSignature: IdSignature): IdSignature? = null