diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/phaser/PhaseConfig.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/phaser/PhaseConfig.kt index e4be04ab1f4..889c1b1bfd9 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/phaser/PhaseConfig.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/phaser/PhaseConfig.kt @@ -5,18 +5,6 @@ package org.jetbrains.kotlin.backend.common.phaser -fun createDefaultPhaseConfig(compoundPhase: CompilerPhase<*, *, *>): PhaseConfig { - val phases = compoundPhase.toPhaseMap() - val enabled = phases.values.toMutableSet() - - return PhaseConfig( - compoundPhase, phases, enabled, emptySet(), emptySet(), emptySet(), emptySet(), emptySet(), - needProfiling = false, - checkConditions = false, - checkStickyConditions = false - ) -} - fun CompilerPhase<*, *, *>.toPhaseMap(): MutableMap = getNamedSubphases().fold(mutableMapOf()) { acc, (_, phase) -> check(phase.name !in acc) { "Duplicate phase name '${phase.name}'"} @@ -26,16 +14,16 @@ fun CompilerPhase<*, *, *>.toPhaseMap(): MutableMap = class PhaseConfig( private val compoundPhase: CompilerPhase<*, *, *>, - private val phases: MutableMap, - enabled: MutableSet, - val verbose: Set, - val toDumpStateBefore: Set, - val toDumpStateAfter: Set, - val toValidateStateBefore: Set, - val toValidateStateAfter: Set, - val needProfiling: Boolean, - val checkConditions: Boolean, - val checkStickyConditions: Boolean + private val phases: MutableMap = compoundPhase.toPhaseMap(), + enabled: MutableSet = phases.values.toMutableSet(), + val verbose: Set = emptySet(), + val toDumpStateBefore: Set = emptySet(), + val toDumpStateAfter: Set = emptySet(), + val toValidateStateBefore: Set = emptySet(), + val toValidateStateAfter: Set = emptySet(), + val needProfiling: Boolean = false, + val checkConditions: Boolean = false, + val checkStickyConditions: Boolean = false ) { private val enabledMut = enabled diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt index eb6f3dcb991..6180f362312 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt @@ -22,7 +22,7 @@ import com.intellij.openapi.util.text.StringUtil import com.intellij.openapi.wm.ToolWindow import com.intellij.util.Alarm import org.jetbrains.kotlin.analyzer.common.CommonPlatform -import org.jetbrains.kotlin.backend.common.phaser.createDefaultPhaseConfig +import org.jetbrains.kotlin.backend.common.phaser.PhaseConfig import org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory import org.jetbrains.kotlin.backend.jvm.jvmPhases import org.jetbrains.kotlin.caches.resolve.KotlinCacheService @@ -320,7 +320,7 @@ class KotlinBytecodeToolWindow(private val myProject: Project, private val toolW .generateDeclaredClassFilter(generateClassFilter) .codegenFactory( if (configuration.getBoolean(JVMConfigurationKeys.IR)) - JvmIrCodegenFactory(createDefaultPhaseConfig(jvmPhases)) + JvmIrCodegenFactory(PhaseConfig(jvmPhases)) else DefaultCodegenFactory )