[IR] minor: make StageController an open class

This should make creating a new "do nothing" controller more straightforward.
This commit is contained in:
Anton Bannykh
2020-03-05 20:58:27 +03:00
committed by Anton Bannykh
parent abc6ecaa1c
commit 939f0d0344
3 changed files with 15 additions and 19 deletions
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase
import org.jetbrains.kotlin.ir.expressions.IrBody
import org.jetbrains.kotlin.ir.util.isLocal
open class MutableController(val context: JsIrBackendContext, val lowerings: List<Lowering>) : StageController {
open class MutableController(val context: JsIrBackendContext, val lowerings: List<Lowering>) : StageController() {
override var currentStage: Int = 0
@@ -49,7 +49,7 @@ fun compile(
multiModule: Boolean = false,
relativeRequirePath: Boolean = false
): CompilerResult {
stageController = object : StageController {}
stageController = StageController()
val (moduleFragment: IrModuleFragment, dependencyModules, irBuiltIns, symbolTable, deserializer) =
loadIr(project, mainModule, analyzer, configuration, allDependencies, friendDependencies)
@@ -86,9 +86,7 @@ fun compile(
eliminateDeadDeclarations(allModules, context)
// TODO investigate whether this is needed anymore
stageController = object : StageController {
override val currentStage: Int = controller.currentStage
}
stageController = StageController(controller.currentStage)
val transformer = IrModuleToJsTransformer(
context,