diff --git a/compiler/cli/cli-common/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArgumentsCopyGenerated.kt b/compiler/cli/cli-common/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArgumentsCopyGenerated.kt index 9fcb5308036..f125da99d21 100644 --- a/compiler/cli/cli-common/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArgumentsCopyGenerated.kt +++ b/compiler/cli/cli-common/gen/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArgumentsCopyGenerated.kt @@ -77,7 +77,6 @@ fun copyK2JVMCompilerArguments(from: K2JVMCompilerArguments, to: K2JVMCompilerAr to.suppressMissingBuiltinsError = from.suppressMissingBuiltinsError to.typeEnhancementImprovementsInStrictMode = from.typeEnhancementImprovementsInStrictMode to.useFastJarFileSystem = from.useFastJarFileSystem - to.useIR = from.useIR to.useJavac = from.useJavac to.useOldBackend = from.useOldBackend to.useOldClassFilesReading = from.useOldClassFilesReading 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 2a6c0d9da2e..bb19d844885 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 @@ -145,16 +145,6 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { // Advanced options - @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 = false - set(value) { - checkFrozen() - field = value - } - @Argument(value = "-Xuse-old-backend", description = "Use the old JVM backend") var useOldBackend = false set(value) { diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt index 4cd2991c269..0f2d5957eef 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt @@ -246,14 +246,8 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr put(JVMConfigurationKeys.PARAMETERS_METADATA, arguments.javaParameters) - // TODO: ignore previous configuration value when we do not need old backend in scripting by default - val useOldBackend = arguments.useOldBackend || (!arguments.useIR && get(JVMConfigurationKeys.IR) == false) - val useIR = arguments.useK2 || languageVersionSettings.languageVersion.usesK2 || - if (languageVersionSettings.supportsFeature(LanguageFeature.JvmIrEnabledByDefault)) { - !useOldBackend - } else { - arguments.useIR && !useOldBackend - } + val useOldBackend = arguments.useOldBackend + val useIR = arguments.useK2 || languageVersionSettings.languageVersion.usesK2 || !useOldBackend messageCollector.report(LOGGING, "Using ${if (useIR) "JVM IR" else "old JVM"} backend") diff --git a/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FE1FullPipelineModularizedTest.kt b/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FE1FullPipelineModularizedTest.kt index cb7105d0ecf..efa8fdf50fc 100644 --- a/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FE1FullPipelineModularizedTest.kt +++ b/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FE1FullPipelineModularizedTest.kt @@ -16,7 +16,6 @@ internal val LANGUAGE_VERSION_K1: String = System.getProperty("fir.bench.languag class FE1FullPipelineModularizedTest : AbstractFullPipelineModularizedTest() { override fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData) { args.useK2 = false - args.useIR = true args.languageVersion = LANGUAGE_VERSION_K1 // TODO: Remove when support for old modularized tests is removed if (moduleData.arguments == null) { diff --git a/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FullPipelineModularizedTest.kt b/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FullPipelineModularizedTest.kt index f36e37c4583..d7f723e42fa 100644 --- a/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FullPipelineModularizedTest.kt +++ b/compiler/fir/modularized-tests/tests/org/jetbrains/kotlin/fir/FullPipelineModularizedTest.kt @@ -18,7 +18,6 @@ internal val LANGUAGE_VERSION_K2: String = System.getProperty("fir.bench.languag class FullPipelineModularizedTest : AbstractFullPipelineModularizedTest() { override fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData) { - args.useIR = true args.languageVersion = LANGUAGE_VERSION_K2 // TODO: Remove when support for old modularized tests is removed diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest.kt index 6959f238849..d3271fe3f1c 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest.kt @@ -14,7 +14,6 @@ abstract class AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest : Abstract super.createCompilerArguments(destinationDir, testDir).apply { useK2 = true languageVersion = "2.0" - useIR = true useFirIC = true useFirLT = true } diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirJvmCompilerRunnerTest.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirJvmCompilerRunnerTest.kt index 09aa2e40b6b..d9b1eaa299a 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirJvmCompilerRunnerTest.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirJvmCompilerRunnerTest.kt @@ -25,7 +25,6 @@ abstract class AbstractIncrementalFirJvmCompilerRunnerTest : AbstractIncremental super.createCompilerArguments(destinationDir, testDir).apply { useK2 = true languageVersion = "2.0" - useIR = true } override val buildLogFinder: BuildLogFinder diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirLightTreeJvmCompilerRunnerTest.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirLightTreeJvmCompilerRunnerTest.kt index 799f19d707c..07e4eb8182d 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirLightTreeJvmCompilerRunnerTest.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalFirLightTreeJvmCompilerRunnerTest.kt @@ -14,7 +14,6 @@ abstract class AbstractIncrementalFirLightTreeJvmCompilerRunnerTest : AbstractIn super.createCompilerArguments(destinationDir, testDir).apply { useK2 = true languageVersion = "2.0" - useIR = true useFirIC = false useFirLT = true } diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 12ff2b8fc51..29999ef4426 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -141,7 +141,6 @@ where advanced options include: including freshly supported reading of the type use annotations from class files. See KT-45671 for more details -Xuse-fast-jar-file-system Use fast implementation on Jar FS. This may speed up compilation time, but currently it's an experimental mode - -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/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index d6c44ecd869..8fe05509b33 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -620,11 +620,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/inlineCycle.args"); } - @TestMetadata("inlineCycle_ir.args") - public void testInlineCycle_ir() throws Exception { - runTest("compiler/testData/cli/jvm/inlineCycle_ir.args"); - } - @TestMetadata("instanceAccessBeforeSuperCall.args") public void testInstanceAccessBeforeSuperCall() throws Exception { runTest("compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.args"); @@ -685,11 +680,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/invalidMetadataVersion.args"); } - @TestMetadata("irSupported.args") - public void testIrSupported() throws Exception { - runTest("compiler/testData/cli/jvm/irSupported.args"); - } - @TestMetadata("javaSealedClass.args") public void testJavaSealedClass() throws Exception { runTest("compiler/testData/cli/jvm/javaSealedClass.args"); @@ -995,11 +985,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/nonLocalDisabled.args"); } - @TestMetadata("nonLocalDisabled_ir.args") - public void testNonLocalDisabled_ir() throws Exception { - runTest("compiler/testData/cli/jvm/nonLocalDisabled_ir.args"); - } - @TestMetadata("nonexistentPathInModule.args") public void testNonexistentPathInModule() throws Exception { runTest("compiler/testData/cli/jvm/nonexistentPathInModule.args"); diff --git a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt index 2140ebe9f9f..95231863888 100644 --- a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt +++ b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt @@ -141,7 +141,6 @@ class CompilerArgumentsContentProspectorTest { K2JVMCompilerArguments::noStdlib, K2JVMCompilerArguments::noReflect, K2JVMCompilerArguments::javaParameters, - K2JVMCompilerArguments::useIR, K2JVMCompilerArguments::allowUnstableDependencies, K2JVMCompilerArguments::doNotClearBindingContext, K2JVMCompilerArguments::noCallAssertions, diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt index 584bb7a7c8c..db77d4e9d12 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2FirICLightTreeJvmJpsTest.kt @@ -6,19 +6,11 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments -import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder -import org.jetbrains.kotlin.jps.model.k2JvmCompilerArguments abstract class AbstractIncrementalK2FirICLightTreeJvmJpsTest( allowNoFilesWithSuffixInTestData: Boolean = false ) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) { - override fun overrideModuleSettings() { - myProject.k2JvmCompilerArguments = K2JVMCompilerArguments().also { - it.useIR = true - } - } - override fun updateCommandLineArguments(arguments: CommonCompilerArguments) { additionalCommandLineArguments = additionalCommandLineArguments + listOf("-Xuse-k2", "-Xuse-fir-ic", "-Xuse-fir-lt") super.updateCommandLineArguments(arguments) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt index 17ee5d6da5a..6eb1dc35006 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2JvmJpsTest.kt @@ -6,19 +6,11 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments -import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder -import org.jetbrains.kotlin.jps.model.k2JvmCompilerArguments abstract class AbstractIncrementalK2JvmJpsTest( allowNoFilesWithSuffixInTestData: Boolean = false ) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) { - override fun overrideModuleSettings() { - myProject.k2JvmCompilerArguments = K2JVMCompilerArguments().also { - it.useIR = true - } - } - override fun updateCommandLineArguments(arguments: CommonCompilerArguments) { additionalCommandLineArguments = additionalCommandLineArguments + listOf("-Xuse-k2", "-Xuse-fir-lt=false") super.updateCommandLineArguments(arguments) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt index 9f9e77b04fe..951b8e4d4c3 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalK2LightTreeJvmJpsTest.kt @@ -6,19 +6,11 @@ package org.jetbrains.kotlin.jps.build import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments -import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder -import org.jetbrains.kotlin.jps.model.k2JvmCompilerArguments abstract class AbstractIncrementalK2LightTreeJvmJpsTest( allowNoFilesWithSuffixInTestData: Boolean = false ) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) { - override fun overrideModuleSettings() { - myProject.k2JvmCompilerArguments = K2JVMCompilerArguments().also { - it.useIR = true - } - } - override fun updateCommandLineArguments(arguments: CommonCompilerArguments) { additionalCommandLineArguments = additionalCommandLineArguments + listOf("-Xuse-k2", "-Xuse-fir-lt") super.updateCommandLineArguments(arguments) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt index 4fbf5e75cf4..7aff708582d 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt @@ -27,6 +27,7 @@ import org.jetbrains.kotlin.daemon.common.configureDaemonJVMOptions import org.jetbrains.kotlin.daemon.common.filterExtractProps import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.dsl.multiplatformExtensionOrNull import org.jetbrains.kotlin.gradle.internal.ClassLoadersCachingBuildService import org.jetbrains.kotlin.gradle.logging.kotlinDebug @@ -46,7 +47,6 @@ import org.jetbrains.kotlin.statistics.metrics.BooleanMetrics import org.jetbrains.kotlin.statistics.metrics.StringMetrics import java.io.File import java.lang.ref.WeakReference -import org.jetbrains.kotlin.gradle.dsl.KotlinVersion const val CREATED_CLIENT_FILE_PREFIX = "Created client-is-alive flag file: " @@ -169,7 +169,6 @@ internal open class GradleCompilerRunner( KotlinBuildStatsService.getInstance()?.apply { val args = K2JVMCompilerArguments() parseCommandLineArguments(argsArray.toList(), args) - report(BooleanMetrics.JVM_COMPILER_IR_MODE, args.useIR) report(StringMetrics.JVM_DEFAULTS, args.jvmDefault) report(StringMetrics.USE_FIR, args.useK2.toString()) diff --git a/libraries/tools/kotlin-gradle-statistics/src/main/kotlin/org/jetbrains/kotlin/statistics/metrics/BooleanMetrics.kt b/libraries/tools/kotlin-gradle-statistics/src/main/kotlin/org/jetbrains/kotlin/statistics/metrics/BooleanMetrics.kt index 7b3e925d2b3..7140a99489b 100644 --- a/libraries/tools/kotlin-gradle-statistics/src/main/kotlin/org/jetbrains/kotlin/statistics/metrics/BooleanMetrics.kt +++ b/libraries/tools/kotlin-gradle-statistics/src/main/kotlin/org/jetbrains/kotlin/statistics/metrics/BooleanMetrics.kt @@ -40,7 +40,6 @@ enum class BooleanMetrics(val type: BooleanOverridePolicy, val anonymization: Bo KOTLIN_OFFICIAL_CODESTYLE(OVERRIDE, SAFE), KOTLIN_PROGRESSIVE_MODE(OVERRIDE, SAFE), KOTLIN_KTS_USED(OR, SAFE), - JVM_COMPILER_IR_MODE(OR, SAFE), JS_GENERATE_EXTERNALS(OR, SAFE), diff --git a/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/errorReporting.kt b/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/errorReporting.kt index 9d24bc40f54..93b756e4187 100644 --- a/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/errorReporting.kt +++ b/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/errorReporting.kt @@ -133,7 +133,6 @@ internal fun reportArgumentsNotAllowed( messageCollector, reportingState, K2JVMCompilerArguments::useJavac, - K2JVMCompilerArguments::useIR, K2JVMCompilerArguments::useK2 ) diff --git a/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingCompilerPluginTest.kt b/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingCompilerPluginTest.kt index 6dd3d07a871..4e4ed5a522b 100644 --- a/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingCompilerPluginTest.kt +++ b/plugins/scripting/scripting-compiler/tests/org/jetbrains/kotlin/scripting/compiler/plugin/ScriptingCompilerPluginTest.kt @@ -81,14 +81,6 @@ class ScriptingCompilerPluginTest : TestCase() { return KotlinCoreEnvironment.createForTests(disposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES) } - fun testUseOldBackendPreservedOnOptionsUpdate() { - val configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.NO_KOTLIN_REFLECT, TestJdkKind.FULL_JDK).apply { - put(JVMConfigurationKeys.IR, false) - updateWithCompilerOptions(emptyList()) - } - Assert.assertEquals(configuration[JVMConfigurationKeys.IR], false) - } - fun testScriptResolverEnvironmentArgsParsing() { val longStr = (1..100).joinToString("\\,") { """\" $it aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \\""" }