diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt index aa62aa630ae..b2cf62a4d97 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt @@ -206,31 +206,31 @@ abstract class CommonCompilerArguments : CommonToolArguments() { value = "-Xdisable-phases", description = "Disable backend phases" ) - var disablePhases: Array by FreezableVar(emptyArray()) + var disablePhases: Array? by FreezableVar(null) @Argument( value = "-Xverbose-phases", description = "Be verbose while performing these backend phases" ) - var verbosePhases: Array by FreezableVar(emptyArray()) + var verbosePhases: Array? by FreezableVar(null) @Argument( value = "-Xphases-to-dump-before", description = "Dump backend state before these phases" ) - var phasesToDumpBefore: Array by FreezableVar(emptyArray()) + var phasesToDumpBefore: Array? by FreezableVar(null) @Argument( value = "-Xphases-to-dump-after", description = "Dump backend state after these phases" ) - var phasesToDumpAfter: Array by FreezableVar(emptyArray()) + var phasesToDumpAfter: Array? by FreezableVar(null) @Argument( value = "-Xphases-to-dump", description = "Dump backend state both before and after these phases" ) - var phasesToDump: Array by FreezableVar(emptyArray()) + var phasesToDump: Array? by FreezableVar(null) @Argument( value = "-Xprofile-phases", diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java index cdb5925c469..a45e6b59832 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/CLICompiler.java @@ -163,11 +163,21 @@ public abstract class CLICompiler extends CLI setupLanguageVersionSettings(configuration, arguments); configuration.put(CommonConfigurationKeys.LIST_PHASES, arguments.getListPhases()); - configuration.put(CommonConfigurationKeys.DISABLED_PHASES, SetsKt.setOf(arguments.getDisablePhases())); - configuration.put(CommonConfigurationKeys.VERBOSE_PHASES, SetsKt.setOf(arguments.getVerbosePhases())); - configuration.put(CommonConfigurationKeys.PHASES_TO_DUMP_STATE_BEFORE, SetsKt.setOf(arguments.getPhasesToDumpBefore())); - configuration.put(CommonConfigurationKeys.PHASES_TO_DUMP_STATE_AFTER, SetsKt.setOf(arguments.getPhasesToDumpAfter())); - configuration.put(CommonConfigurationKeys.PHASES_TO_DUMP_STATE, SetsKt.setOf(arguments.getPhasesToDump())); + if (arguments.getDisablePhases() != null) { + configuration.put(CommonConfigurationKeys.DISABLED_PHASES, SetsKt.setOf(arguments.getDisablePhases())); + } + if (arguments.getVerbosePhases() != null) { + configuration.put(CommonConfigurationKeys.VERBOSE_PHASES, SetsKt.setOf(arguments.getVerbosePhases())); + } + if (arguments.getPhasesToDumpBefore() != null) { + configuration.put(CommonConfigurationKeys.PHASES_TO_DUMP_STATE_BEFORE, SetsKt.setOf(arguments.getPhasesToDumpBefore())); + } + if (arguments.getPhasesToDumpAfter() != null) { + configuration.put(CommonConfigurationKeys.PHASES_TO_DUMP_STATE_AFTER, SetsKt.setOf(arguments.getPhasesToDumpAfter())); + } + if (arguments.getPhasesToDump() != null) { + configuration.put(CommonConfigurationKeys.PHASES_TO_DUMP_STATE, SetsKt.setOf(arguments.getPhasesToDump())); + } configuration.put(CommonConfigurationKeys.PROFILE_PHASES, arguments.getProfilePhases()); }