From 415d52fe549fe58ed0644b157d84ecc9faa6168d Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 18 Mar 2021 12:17:46 +0100 Subject: [PATCH] Deprecate KotlinJvmOptions.useIR Starting from language version 1.5, JVM IR is enabled by default, so this option has no effect. To rollback to the old JVM backend, the new option useOldBackend can be used. #KT-45504 Fixed --- .../kotlin/cli/common/arguments/K2JVMCompilerArguments.kt | 6 +++++- compiler/testData/cli/jvm/extraHelp.out | 2 +- .../org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index 62b4a81297e..4e0ce2ffc1b 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -84,8 +84,12 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { // Advanced options + @DeprecatedOption(removeAfter = "1.5", level = DeprecationLevel.WARNING) @GradleOption(DefaultValues.BooleanFalseDefault::class) - @Argument(value = "-Xuse-ir", description = "Use the IR backend") + @Argument( + value = "-Xuse-ir", + description = "Use the IR backend. This option has no effect unless the language version less than 1.5 is used" + ) var useIR: Boolean by FreezableVar(false) @GradleOption(DefaultValues.BooleanFalseDefault::class) diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index e17c509546c..323e5c2a4cd 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -126,7 +126,7 @@ where advanced options include: Suppress deprecation warning about deprecated JVM target versions -Xsuppress-missing-builtins-error Suppress the "cannot access built-in declaration" error (useful with -no-stdlib) - -Xuse-ir Use the IR backend + -Xuse-ir Use the IR backend. This option has no effect unless the language version less than 1.5 is used -Xuse-javac Use javac for Java source and class files analysis -Xuse-old-backend Use the old JVM backend -Xuse-old-class-files-reading Use old class files reading implementation. This may slow down the build and cause problems with Groovy interop. diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt index d38233bd727..f4904ee5917 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt @@ -57,9 +57,10 @@ interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOption var noStdlib: kotlin.Boolean /** - * Use the IR backend + * Use the IR backend. This option has no effect unless the language version less than 1.5 is used * Default value: false */ + @Deprecated(message = "This option has no effect and will be removed in a future release.", level = DeprecationLevel.WARNING) var useIR: kotlin.Boolean /**