From 58885a1b072dccda6de53ce67499c5ce80a1d262 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 26 Apr 2022 16:16:38 +0300 Subject: [PATCH] KT-52217 Rename 'use-fir' to 'use-k2', update message --- .../arguments/CommonCompilerArguments.kt | 7 ++++--- .../common/arguments/K2JVMCompilerArguments.kt | 2 +- .../jetbrains/kotlin/cli/common/arguments.kt | 2 +- .../compiler/FirKotlinToJvmBytecodeCompiler.kt | 2 +- .../jvm/compiler/pipeline/compilerPipeline.kt | 2 +- .../jetbrains/kotlin/cli/jvm/jvmArguments.kt | 2 +- .../fir/FE1FullPipelineModularizedTest.kt | 2 +- .../kotlin/fir/FullPipelineModularizedTest.kt | 2 +- .../IncrementalJvmCompilerRunner.kt | 4 ++-- ...entalFirICLightTreeJvmCompilerRunnerTest.kt | 2 +- ...tractIncrementalFirJvmCompilerRunnerTest.kt | 2 +- ...ementalFirLightTreeJvmCompilerRunnerTest.kt | 2 +- compiler/testData/cli/js/jsExtraHelp.out | 2 +- .../cli/jvm/conflictingProjection.args | 2 +- .../testData/cli/jvm/conflictingProjection.out | 4 ++-- .../testData/cli/jvm/extendedCheckers.args | 2 +- compiler/testData/cli/jvm/extendedCheckers.out | 4 ++-- .../cli/jvm/extendedCheckersNoWarning.args | 2 +- .../cli/jvm/extendedCheckersNoWarning.out | 4 ++-- compiler/testData/cli/jvm/extraHelp.out | 2 +- compiler/testData/cli/jvm/firError.args | 2 +- compiler/testData/cli/jvm/firError.out | 4 ++-- compiler/testData/cli/jvm/firHello.args | 2 +- compiler/testData/cli/jvm/firHello.out | 4 ++-- .../firMultiplatformCompilationWithError.args | 2 +- .../firMultiplatformCompilationWithError.out | 4 ++-- ...rMultiplatformCompilationWithoutErrors.args | 2 +- ...irMultiplatformCompilationWithoutErrors.out | 4 ++-- .../testData/cli/jvm/firStdlibDependency.args | 2 +- .../testData/cli/jvm/firStdlibDependency.out | 4 ++-- .../cli/jvm/firVsClassicAnnotation.args | 2 +- .../cli/jvm/firVsClassicAnnotation.out | 4 ++-- .../cli/jvm/inapplicableLateinitModifier.args | 2 +- .../cli/jvm/inapplicableLateinitModifier.out | 4 ++-- .../cli/jvm/instanceAccessBeforeSuperCall.args | 2 +- .../cli/jvm/instanceAccessBeforeSuperCall.out | 4 ++-- .../testData/cli/jvm/optInEmptyMessageFir.args | 2 +- .../testData/cli/jvm/optInEmptyMessageFir.out | 4 ++-- .../cli/jvm/optInOverrideMessageFir.args | 2 +- .../cli/jvm/optInOverrideMessageFir.out | 4 ++-- .../AbstractKotlinCompilerIntegrationTest.kt | 5 +---- .../CompileKotlinAgainstCustomBinariesTest.kt | 18 +++++++++--------- .../CompilerArgumentsContentProspectorTest.kt | 2 +- .../kotlin/gradle/dsl/KotlinCommonOptions.kt | 4 ++-- .../GradleKotlinCompilerRunner.kt | 2 +- .../kotlin/gradle/dsl/KotlinJsOptionsBase.kt | 12 ++++++------ .../kotlin/gradle/dsl/KotlinJvmOptionsBase.kt | 12 ++++++------ .../KotlinMultiplatformCommonOptionsBase.kt | 12 ++++++------ .../kotlin/gradle/plugin/KotlinProperties.kt | 4 ++-- .../targets/native/KotlinNativeCompilation.kt | 4 ++-- .../tasks/configuration/KotlinCompileConfig.kt | 4 ++-- .../compiler/plugin/impl/errorReporting.kt | 2 +- 52 files changed, 96 insertions(+), 98 deletions(-) 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 f12a68a905f..5e52b1c9b19 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 @@ -294,10 +294,11 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @GradleOption(DefaultValues.BooleanFalseDefault::class) @Argument( - value = "-Xuse-fir", - description = "Compile using Front-end IR. Warning: this feature is far from being production-ready" + value = "-Xuse-k2", + deprecatedName = "-Xuse-fir", + description = "Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided" ) - var useFir: Boolean by FreezableVar(false) + var useK2: Boolean by FreezableVar(false) @Argument( value = "-Xuse-fir-extended-checkers", 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 21f4d15c16b..1d8150f1560 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 @@ -528,7 +528,7 @@ Also sets `-jvm-target` value equal to the selected JDK version""" result[JvmAnalysisFlags.sanitizeParentheses] = sanitizeParentheses result[JvmAnalysisFlags.suppressMissingBuiltinsError] = suppressMissingBuiltinsError result[JvmAnalysisFlags.enableJvmPreview] = enableJvmPreview - result[AnalysisFlags.allowUnstableDependencies] = allowUnstableDependencies || useFir + result[AnalysisFlags.allowUnstableDependencies] = allowUnstableDependencies || useK2 result[JvmAnalysisFlags.disableUltraLightClasses] = disableUltraLightClasses result[JvmAnalysisFlags.useIR] = !useOldBackend return result diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/common/arguments.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/common/arguments.kt index 7384cf33020..80a54a8a1a5 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/common/arguments.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/common/arguments.kt @@ -22,7 +22,7 @@ fun CompilerConfiguration.setupCommonArguments( createMetadataVersion: ((IntArray) -> BinaryVersion)? = null ) { put(CommonConfigurationKeys.DISABLE_INLINE, arguments.noInline) - put(CommonConfigurationKeys.USE_FIR, arguments.useFir) + put(CommonConfigurationKeys.USE_FIR, arguments.useK2) put(CommonConfigurationKeys.USE_FIR_EXTENDED_CHECKERS, arguments.useFirExtendedCheckers) put(CommonConfigurationKeys.EXPECT_ACTUAL_LINKER, arguments.expectActualLinker) putIfNotNull(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, arguments.intellijPluginRoot) diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/FirKotlinToJvmBytecodeCompiler.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/FirKotlinToJvmBytecodeCompiler.kt index e6444cc3136..bec27b4cc8d 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/FirKotlinToJvmBytecodeCompiler.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/FirKotlinToJvmBytecodeCompiler.kt @@ -82,7 +82,7 @@ object FirKotlinToJvmBytecodeCompiler { messageCollector.report( STRONG_WARNING, - "ATTENTION!\n This build uses in-dev FIR: \n -Xuse-fir" + "ATTENTION!\n This build uses experimental K2 compiler: \n -Xuse-k2" ) projectConfiguration.get(ComponentRegistrar.PLUGIN_COMPONENT_REGISTRARS)?.let { pluginComponentRegistrars -> diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/pipeline/compilerPipeline.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/pipeline/compilerPipeline.kt index e4feb3ea911..0b304375f2b 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/pipeline/compilerPipeline.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/pipeline/compilerPipeline.kt @@ -97,7 +97,7 @@ fun compileModulesUsingFrontendIrAndLightTree( messageCollector.report( CompilerMessageSeverity.STRONG_WARNING, - "ATTENTION!\n This build uses in-dev FIR: \n -Xuse-fir" + "ATTENTION!\n This build uses experimental K2 compiler: \n -Xuse-k2" ) val outputs = mutableListOf() 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 49d82b2a475..b9ab51bd4b4 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt @@ -230,7 +230,7 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr // 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.useFir || + val useIR = arguments.useK2 || if (languageVersionSettings.supportsFeature(LanguageFeature.JvmIrEnabledByDefault)) { !useOldBackend } else { 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 799039567be..dec5bf3436d 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 @@ -15,7 +15,7 @@ class FE1FullPipelineModularizedTest : AbstractFullPipelineModularizedTest() { override fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData) { args.useIR = USE_BE_IR args.useOldBackend = !USE_BE_IR - args.useFir = false + args.useK2 = false args.jvmDefault = "compatibility" args.apiVersion = "1.4" args.optIn = arrayOf( 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 ae8d1743f63..eecdebc12c6 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 @@ -12,7 +12,7 @@ private val LANGUAGE_VERSION: String = System.getProperty("fir.bench.language.ve class FullPipelineModularizedTest : AbstractFullPipelineModularizedTest() { override fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData) { - args.useFir = true + args.useK2 = true args.useIR = true args.apiVersion = LANGUAGE_VERSION args.jvmDefault = "compatibility" diff --git a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt index 9e623d8996a..204e8eaf230 100644 --- a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt +++ b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt @@ -88,7 +88,7 @@ fun makeIncrementally( withIC(args) { val compiler = - if (args.useFir && args.useFirIC && args.useFirLT /* TODO: move LT check into runner */ ) + if (args.useK2 && args.useFirIC && args.useFirLT /* TODO: move LT check into runner */ ) IncrementalFirJvmCompilerRunner( cachesDir, buildReporter, buildHistoryFile, emptyList(), EmptyModulesApiHistory, kotlinExtensions, ClasspathSnapshotDisabled ) @@ -97,7 +97,7 @@ fun makeIncrementally( cachesDir, buildReporter, // Use precise setting in case of non-Gradle build - usePreciseJavaTracking = !args.useFir, // TODO: add fir-based java classes tracker when available and set this to true + usePreciseJavaTracking = !args.useK2, // TODO: add fir-based java classes tracker when available and set this to true outputFiles = emptyList(), buildHistoryFile = buildHistoryFile, modulesApiHistory = EmptyModulesApiHistory, 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 edd8a36c009..08f5b2cd3aa 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 @@ -12,7 +12,7 @@ import java.io.File abstract class AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() { override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments = super.createCompilerArguments(destinationDir, testDir).apply { - useFir = true + useK2 = true 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 9e552aead33..04d8fa18568 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 @@ -23,7 +23,7 @@ import java.io.File abstract class AbstractIncrementalFirJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() { override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments = super.createCompilerArguments(destinationDir, testDir).apply { - useFir = true + useK2 = true useIR = true } 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 25bd8565db8..cbed336c9d9 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 @@ -12,7 +12,7 @@ import java.io.File abstract class AbstractIncrementalFirLightTreeJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() { override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments = super.createCompilerArguments(destinationDir, testDir).apply { - useFir = true + useK2 = true useIR = true useFirIC = false useFirLT = true diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 1a980c45652..72727d18946 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -104,10 +104,10 @@ where advanced options include: -Xsuppress-version-warnings Suppress warnings about outdated, inconsistent or experimental language or API versions -Xunrestricted-builder-inference Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call - -Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir-ic Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready -Xuse-fir-lt Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready + -Xuse-k2 Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided -Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed -Xverbose-phases Be verbose while performing these backend phases diff --git a/compiler/testData/cli/jvm/conflictingProjection.args b/compiler/testData/cli/jvm/conflictingProjection.args index 3736b3db902..029be42cd1d 100644 --- a/compiler/testData/cli/jvm/conflictingProjection.args +++ b/compiler/testData/cli/jvm/conflictingProjection.args @@ -1,4 +1,4 @@ $TESTDATA_DIR$/conflictingProjection.kt --Xuse-fir +-Xuse-k2 -d $TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/conflictingProjection.out b/compiler/testData/cli/jvm/conflictingProjection.out index a4b264b8848..705f3c6201c 100644 --- a/compiler/testData/cli/jvm/conflictingProjection.out +++ b/compiler/testData/cli/jvm/conflictingProjection.out @@ -1,6 +1,6 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/conflictingProjection.kt:10:19: error: projection is conflicting with variance of the corresponding type parameter of Out. Remove the projection or replace it with '*' fun a8(value: Out) {} ^ diff --git a/compiler/testData/cli/jvm/extendedCheckers.args b/compiler/testData/cli/jvm/extendedCheckers.args index 730e0e1a775..88effb435ae 100644 --- a/compiler/testData/cli/jvm/extendedCheckers.args +++ b/compiler/testData/cli/jvm/extendedCheckers.args @@ -1,5 +1,5 @@ $TESTDATA_DIR$/extendedCheckers.kt --Xuse-fir +-Xuse-k2 -Xuse-fir-extended-checkers -d $TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/extendedCheckers.out b/compiler/testData/cli/jvm/extendedCheckers.out index aa7f09ef564..97b723fbf72 100644 --- a/compiler/testData/cli/jvm/extendedCheckers.out +++ b/compiler/testData/cli/jvm/extendedCheckers.out @@ -1,6 +1,6 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/extendedCheckers.kt:2:12: warning: redundant explicit type val i: Int = 1 ^ diff --git a/compiler/testData/cli/jvm/extendedCheckersNoWarning.args b/compiler/testData/cli/jvm/extendedCheckersNoWarning.args index e75708410b4..f815eee846a 100644 --- a/compiler/testData/cli/jvm/extendedCheckersNoWarning.args +++ b/compiler/testData/cli/jvm/extendedCheckersNoWarning.args @@ -1,5 +1,5 @@ $TESTDATA_DIR$/extendedCheckersNoWarning.kt --Xuse-fir +-Xuse-k2 -Xuse-fir-extended-checkers -d $TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/extendedCheckersNoWarning.out b/compiler/testData/cli/jvm/extendedCheckersNoWarning.out index b2e67e607be..ffcff5c3b33 100644 --- a/compiler/testData/cli/jvm/extendedCheckersNoWarning.out +++ b/compiler/testData/cli/jvm/extendedCheckersNoWarning.out @@ -1,4 +1,4 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 OK diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 07cecb5b8cb..cb3c9750afe 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -210,10 +210,10 @@ where advanced options include: -Xsuppress-version-warnings Suppress warnings about outdated, inconsistent or experimental language or API versions -Xunrestricted-builder-inference Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call - -Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir-ic Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready -Xuse-fir-lt Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready + -Xuse-k2 Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided -Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed -Xverbose-phases Be verbose while performing these backend phases diff --git a/compiler/testData/cli/jvm/firError.args b/compiler/testData/cli/jvm/firError.args index b996f1faecc..8291989e7f1 100644 --- a/compiler/testData/cli/jvm/firError.args +++ b/compiler/testData/cli/jvm/firError.args @@ -1,4 +1,4 @@ $TESTDATA_DIR$/firError.kt --Xuse-fir +-Xuse-k2 -d $TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/firError.out b/compiler/testData/cli/jvm/firError.out index 7edb302fe70..31a3a294d47 100644 --- a/compiler/testData/cli/jvm/firError.out +++ b/compiler/testData/cli/jvm/firError.out @@ -1,6 +1,6 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/firError.kt:5:13: error: variable 'x' must be initialized println(x) ^ diff --git a/compiler/testData/cli/jvm/firHello.args b/compiler/testData/cli/jvm/firHello.args index 6c3d66c2a85..b4060ff074f 100644 --- a/compiler/testData/cli/jvm/firHello.args +++ b/compiler/testData/cli/jvm/firHello.args @@ -1,4 +1,4 @@ $TESTDATA_DIR$/firHello.kt --Xuse-fir +-Xuse-k2 -d $TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/firHello.out b/compiler/testData/cli/jvm/firHello.out index b2e67e607be..ffcff5c3b33 100644 --- a/compiler/testData/cli/jvm/firHello.out +++ b/compiler/testData/cli/jvm/firHello.out @@ -1,4 +1,4 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 OK diff --git a/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.args b/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.args index d9ddd94e7b4..fc82e67224f 100644 --- a/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.args +++ b/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.args @@ -2,7 +2,7 @@ $TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt $TESTDATA_DIR$/firMultiplatformCompilationWithError/jvm.kt -Xcommon-sources $TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt --Xuse-fir +-Xuse-k2 -cp . -d diff --git a/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.out b/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.out index bddab365a06..faedd86bf73 100644 --- a/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.out +++ b/compiler/testData/cli/jvm/firMultiplatformCompilationWithError.out @@ -9,8 +9,8 @@ as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: actual class 'public abstract actual interface A : R|kotlin/Any|' has no corresponding members for expected class members: public abstract expect fun foo(): R|kotlin/Unit| diff --git a/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.args b/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.args index 3c64a034140..d4a26478359 100644 --- a/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.args +++ b/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.args @@ -2,7 +2,7 @@ $TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt $TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/jvm.kt -Xcommon-sources $TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt --Xuse-fir +-Xuse-k2 -cp . -d diff --git a/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.out b/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.out index 8ad7871a715..12cc44ccf11 100644 --- a/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.out +++ b/compiler/testData/cli/jvm/firMultiplatformCompilationWithoutErrors.out @@ -9,6 +9,6 @@ as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 OK diff --git a/compiler/testData/cli/jvm/firStdlibDependency.args b/compiler/testData/cli/jvm/firStdlibDependency.args index 160be8bc9ca..76032f4ff50 100644 --- a/compiler/testData/cli/jvm/firStdlibDependency.args +++ b/compiler/testData/cli/jvm/firStdlibDependency.args @@ -1,5 +1,5 @@ $TESTDATA_DIR$/firStdlibDependency.kt --Xuse-fir +-Xuse-k2 -cp . -d diff --git a/compiler/testData/cli/jvm/firStdlibDependency.out b/compiler/testData/cli/jvm/firStdlibDependency.out index b2e67e607be..ffcff5c3b33 100644 --- a/compiler/testData/cli/jvm/firStdlibDependency.out +++ b/compiler/testData/cli/jvm/firStdlibDependency.out @@ -1,4 +1,4 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 OK diff --git a/compiler/testData/cli/jvm/firVsClassicAnnotation.args b/compiler/testData/cli/jvm/firVsClassicAnnotation.args index 4da212cfd5c..29b65855a41 100644 --- a/compiler/testData/cli/jvm/firVsClassicAnnotation.args +++ b/compiler/testData/cli/jvm/firVsClassicAnnotation.args @@ -1,6 +1,6 @@ $TESTDATA_DIR$/firVsClassicAnnotation.kt -classpath $TESTDATA_DIR$/firVsClassicAnnotation --Xuse-fir +-Xuse-k2 -d $TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/firVsClassicAnnotation.out b/compiler/testData/cli/jvm/firVsClassicAnnotation.out index b2e67e607be..ffcff5c3b33 100644 --- a/compiler/testData/cli/jvm/firVsClassicAnnotation.out +++ b/compiler/testData/cli/jvm/firVsClassicAnnotation.out @@ -1,4 +1,4 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 OK diff --git a/compiler/testData/cli/jvm/inapplicableLateinitModifier.args b/compiler/testData/cli/jvm/inapplicableLateinitModifier.args index 7e0831dbd85..e58653d69b7 100644 --- a/compiler/testData/cli/jvm/inapplicableLateinitModifier.args +++ b/compiler/testData/cli/jvm/inapplicableLateinitModifier.args @@ -1,4 +1,4 @@ $TESTDATA_DIR$/inapplicableLateinitModifier.kt --Xuse-fir +-Xuse-k2 -d $TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/inapplicableLateinitModifier.out b/compiler/testData/cli/jvm/inapplicableLateinitModifier.out index f65dab31e01..23be76c0cf6 100644 --- a/compiler/testData/cli/jvm/inapplicableLateinitModifier.out +++ b/compiler/testData/cli/jvm/inapplicableLateinitModifier.out @@ -1,6 +1,6 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:6:1: error: 'lateinit' modifier is not allowed on delegated properties lateinit var kest by Delegate ^ diff --git a/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.args b/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.args index c67f1b6ec05..1a04a495a39 100644 --- a/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.args +++ b/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.args @@ -1,4 +1,4 @@ $TESTDATA_DIR$/instanceAccessBeforeSuperCall.kt --Xuse-fir +-Xuse-k2 -d $TEMP_DIR$ \ No newline at end of file diff --git a/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out b/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out index d61d7a63fb2..446e2212b9e 100644 --- a/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out +++ b/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out @@ -1,6 +1,6 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:2:26: error: unresolved reference: getSomeInt constructor(x: Int = getSomeInt(), other: A = this, header: String = keker) {} ^ diff --git a/compiler/testData/cli/jvm/optInEmptyMessageFir.args b/compiler/testData/cli/jvm/optInEmptyMessageFir.args index f9f8c27de5f..ff73545342b 100644 --- a/compiler/testData/cli/jvm/optInEmptyMessageFir.args +++ b/compiler/testData/cli/jvm/optInEmptyMessageFir.args @@ -2,5 +2,5 @@ $TESTDATA_DIR$/optInEmptyMessageFir.kt -d $TEMP_DIR$ -opt-in=kotlin.RequiresOptIn --Xuse-fir +-Xuse-k2 diff --git a/compiler/testData/cli/jvm/optInEmptyMessageFir.out b/compiler/testData/cli/jvm/optInEmptyMessageFir.out index 56de940031f..6bfd51ba14b 100644 --- a/compiler/testData/cli/jvm/optInEmptyMessageFir.out +++ b/compiler/testData/cli/jvm/optInEmptyMessageFir.out @@ -1,6 +1,6 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/optInEmptyMessageFir.kt:8:5: error: this declaration needs opt-in. Its usage must be marked with '@EmptyMarker' or '@OptIn(EmptyMarker::class)' foo() ^ diff --git a/compiler/testData/cli/jvm/optInOverrideMessageFir.args b/compiler/testData/cli/jvm/optInOverrideMessageFir.args index 75ec0f2cd3e..5bebce861f1 100644 --- a/compiler/testData/cli/jvm/optInOverrideMessageFir.args +++ b/compiler/testData/cli/jvm/optInOverrideMessageFir.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/optInOverrideMessageFir.kt -d $TEMP_DIR$ -opt-in=kotlin.RequiresOptIn --Xuse-fir +-Xuse-k2 diff --git a/compiler/testData/cli/jvm/optInOverrideMessageFir.out b/compiler/testData/cli/jvm/optInOverrideMessageFir.out index 47f7dc82ff1..6dc08d9cb6e 100644 --- a/compiler/testData/cli/jvm/optInOverrideMessageFir.out +++ b/compiler/testData/cli/jvm/optInOverrideMessageFir.out @@ -1,6 +1,6 @@ warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir + This build uses experimental K2 compiler: + -Xuse-k2 compiler/testData/cli/jvm/optInOverrideMessageFir.kt:16:18: error: base declaration of supertype 'Base' needs opt-in. This API is experimental and can change at any time, please use with care. The declaration override must be annotated with '@Marker' or '@OptIn(Marker::class)' override fun foo() {} ^ diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt index 3994f33d244..d9fd813dfac 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt @@ -137,10 +137,7 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() { private fun String.removeFirWarning(): String { return this.replace( - """warning: ATTENTION! - This build uses in-dev FIR: - -Xuse-fir -""", "" + "warning: ATTENTION!\n This build uses experimental K2 compiler: \n -Xuse-k2\n", "" ) } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt index 2b68c3d3e76..b1538efd9a8 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt @@ -546,7 +546,7 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration fun testInternalFromFriendModuleFir() { val library = compileLibrary("library") - compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xfriend-paths=${library.path}", "-Xuse-fir")) + compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xfriend-paths=${library.path}", "-Xuse-k2")) } fun testJvmDefaultClashWithOld() { @@ -620,20 +620,20 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration } fun testFirAgainstFir() { - val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir")) - compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-fir")) + val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2")) + compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-k2")) } fun testFirAgainstOldJvm() { val library = compileLibrary("library") - compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-fir")) + compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xuse-k2")) } fun testFirIncorrectJavaSignature() { compileKotlin( "source.kt", tmpdir, listOf(), - additionalOptions = listOf("-Xuse-fir"), + additionalOptions = listOf("-Xuse-k2"), additionalSources = listOf("A.java", "B.java"), ) } @@ -647,10 +647,10 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration } fun testOldJvmAgainstFir() { - val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir")) + val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2")) compileKotlin("source.kt", tmpdir, listOf(library)) - val library2 = compileLibrary("library", additionalOptions = listOf("-Xuse-fir", "-Xabi-stability=unstable")) + val library2 = compileLibrary("library", additionalOptions = listOf("-Xuse-k2", "-Xabi-stability=unstable")) compileKotlin("source.kt", tmpdir, listOf(library2)) } @@ -660,12 +660,12 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration } fun testOldJvmAgainstFirWithStableAbi() { - val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir", "-Xabi-stability=stable")) + val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2", "-Xabi-stability=stable")) compileKotlin("source.kt", tmpdir, listOf(library)) } fun testOldJvmAgainstFirWithAllowUnstableDependencies() { - val library = compileLibrary("library", additionalOptions = listOf("-Xuse-fir")) + val library = compileLibrary("library", additionalOptions = listOf("-Xuse-k2")) compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xallow-unstable-dependencies")) } diff --git a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt index 486338e6b6f..835ca24883e 100644 --- a/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt +++ b/jps/jps-common/test/CompilerArgumentsContentProspectorTest.kt @@ -95,7 +95,7 @@ class CompilerArgumentsContentProspectorTest { CommonCompilerArguments::profilePhases, CommonCompilerArguments::checkPhaseConditions, CommonCompilerArguments::checkStickyPhaseConditions, - CommonCompilerArguments::useFir, + CommonCompilerArguments::useK2, CommonCompilerArguments::useFirExtendedCheckers, CommonCompilerArguments::disableUltraLightClasses, CommonCompilerArguments::useMixedNamedArguments, diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt index 311c41400d6..bf3fbb79f93 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt @@ -20,8 +20,8 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToo var languageVersion: kotlin.String? /** - * Compile using Front-end IR. Warning: this feature is far from being production-ready + * Compile using experimental K2. K2 is a new compiler pipeline, no compatibility guarantees are yet provided * Default value: false */ - var useFir: kotlin.Boolean + var useK2: kotlin.Boolean } 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 8cad9990ce7..c9b3ce17b7f 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 @@ -152,7 +152,7 @@ internal open class GradleCompilerRunner( report(BooleanMetrics.JVM_COMPILER_IR_MODE, args.useIR) report(StringMetrics.JVM_DEFAULTS, args.jvmDefault) report(StringMetrics.USE_OLD_BACKEND, args.useOldBackend.toString()) - report(StringMetrics.USE_FIR, args.useFir.toString()) + report(StringMetrics.USE_FIR, args.useK2.toString()) } } is K2JSCompilerArguments -> { diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt index 8197c78350f..79a4c017594 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJsOptionsBase.kt @@ -30,11 +30,11 @@ internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.Ko override var languageVersion: kotlin.String? = null - private var useFirField: kotlin.Boolean? = null - override var useFir: kotlin.Boolean - get() = useFirField ?: false + private var useK2Field: kotlin.Boolean? = null + override var useK2: kotlin.Boolean + get() = useK2Field ?: false set(value) { - useFirField = value + useK2Field = value } private var friendModulesDisabledField: kotlin.Boolean? = null @@ -105,7 +105,7 @@ internal abstract class KotlinJsOptionsBase : org.jetbrains.kotlin.gradle.dsl.Ko verboseField?.let { args.verbose = it } apiVersion?.let { args.apiVersion = it } languageVersion?.let { args.languageVersion = it } - useFirField?.let { args.useFir = it } + useK2Field?.let { args.useK2 = it } friendModulesDisabledField?.let { args.friendModulesDisabled = it } mainField?.let { args.main = it } metaInfoField?.let { args.metaInfo = it } @@ -126,7 +126,7 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments.fil verbose = false apiVersion = null languageVersion = null - useFir = false + useK2 = false friendModulesDisabled = false main = "call" metaInfo = true diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt index b74cd377388..36680d4f12f 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptionsBase.kt @@ -30,11 +30,11 @@ internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.K override var languageVersion: kotlin.String? = null - private var useFirField: kotlin.Boolean? = null - override var useFir: kotlin.Boolean - get() = useFirField ?: false + private var useK2Field: kotlin.Boolean? = null + override var useK2: kotlin.Boolean + get() = useK2Field ?: false set(value) { - useFirField = value + useK2Field = value } private var javaParametersField: kotlin.Boolean? = null @@ -68,7 +68,7 @@ internal abstract class KotlinJvmOptionsBase : org.jetbrains.kotlin.gradle.dsl.K verboseField?.let { args.verbose = it } apiVersion?.let { args.apiVersion = it } languageVersion?.let { args.languageVersion = it } - useFirField?.let { args.useFir = it } + useK2Field?.let { args.useK2 = it } javaParametersField?.let { args.javaParameters = it } jvmTarget?.let { args.jvmTarget = it } moduleName?.let { args.moduleName = it } @@ -83,7 +83,7 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments.fi verbose = false apiVersion = null languageVersion = null - useFir = false + useK2 = false javaParameters = false jvmTarget = null moduleName = null diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinMultiplatformCommonOptionsBase.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinMultiplatformCommonOptionsBase.kt index f6847b31d4c..c0308ed06a4 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinMultiplatformCommonOptionsBase.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinMultiplatformCommonOptionsBase.kt @@ -30,11 +30,11 @@ internal abstract class KotlinMultiplatformCommonOptionsBase : org.jetbrains.kot override var languageVersion: kotlin.String? = null - private var useFirField: kotlin.Boolean? = null - override var useFir: kotlin.Boolean - get() = useFirField ?: false + private var useK2Field: kotlin.Boolean? = null + override var useK2: kotlin.Boolean + get() = useK2Field ?: false set(value) { - useFirField = value + useK2Field = value } internal open fun updateArguments(args: org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments) { @@ -43,7 +43,7 @@ internal abstract class KotlinMultiplatformCommonOptionsBase : org.jetbrains.kot verboseField?.let { args.verbose = it } apiVersion?.let { args.apiVersion = it } languageVersion?.let { args.languageVersion = it } - useFirField?.let { args.useFir = it } + useK2Field?.let { args.useK2 = it } } } @@ -53,5 +53,5 @@ internal fun org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArgumen verbose = false apiVersion = null languageVersion = null - useFir = false + useK2 = false } diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt index 04999dda8fb..dfa5f1744cd 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt @@ -132,8 +132,8 @@ internal class PropertiesProvider private constructor(private val project: Proje val useKotlinAbiSnapshot: Boolean get() = booleanProperty(KOTLIN_ABI_SNAPSHOT) ?: false - val useFir: Boolean? - get() = booleanProperty("kotlin.useFir") + val useK2: Boolean? + get() = booleanProperty("kotlin.useK2") val keepMppDependenciesIntactInPoms: Boolean? get() = booleanProperty("kotlin.mpp.keepMppDependenciesIntactInPoms") diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeCompilation.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeCompilation.kt index 1a5135c37a8..9ac2d6460ec 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeCompilation.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/KotlinNativeCompilation.kt @@ -36,8 +36,8 @@ internal class NativeCompileOptions(languageSettingsProvider: () -> LanguageSett set(value) { languageSettings.languageVersion = value } - - override var useFir: Boolean + + override var useK2: Boolean get() = false set(@Suppress("UNUSED_PARAMETER") value) {} diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/configuration/KotlinCompileConfig.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/configuration/KotlinCompileConfig.kt index 69ffcf5fd04..e4e5b00f7a6 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/configuration/KotlinCompileConfig.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/configuration/KotlinCompileConfig.kt @@ -39,8 +39,8 @@ internal open class BaseKotlinCompileConfig : AbstractKotl taskProvider.configure { task -> task.incremental = propertiesProvider.incrementalJvm ?: true - if (propertiesProvider.useFir == true) { - task.kotlinOptions.useFir = true + if (propertiesProvider.useK2 == true) { + task.kotlinOptions.useK2 = true } task.usePreciseJavaTracking = propertiesProvider.usePreciseJavaTracking ?: true task.jvmTargetValidationMode.set(propertiesProvider.jvmTargetValidationMode) 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 9bfe07b87fa..574cc798673 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 @@ -129,7 +129,7 @@ internal fun reportArgumentsNotAllowed( K2JVMCompilerArguments::useJavac, K2JVMCompilerArguments::useIR, K2JVMCompilerArguments::useOldBackend, - K2JVMCompilerArguments::useFir + K2JVMCompilerArguments::useK2 ) internal fun reportArgumentsIgnoredGenerally(