KT-52217 Rename 'use-fir' to 'use-k2', update message

This commit is contained in:
Simon Ogorodnik
2022-04-26 16:16:38 +03:00
committed by Space
parent 1c90d8a960
commit 58885a1b07
52 changed files with 96 additions and 98 deletions
@@ -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",
@@ -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
@@ -22,7 +22,7 @@ fun <A : CommonCompilerArguments> 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)
@@ -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 ->
@@ -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<GenerationState>()
@@ -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 {