Skip to content

Commit

Permalink
Don't apply language feature IrInlinerBeforeKlibSerialization to JV…
Browse files Browse the repository at this point in the history
…M backend

^KT-69765 Fixed


Merge-request: KT-MR-18250
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
  • Loading branch information
vsukharev authored and qodana-bot committed Oct 4, 2024
1 parent 888c18a commit 78af239
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ fun copyCommonCompilerArguments(from: CommonCompilerArguments, to: CommonCompile
to.inferenceCompatibility = from.inferenceCompatibility
to.inlineClasses = from.inlineClasses
to.intellijPluginRoot = from.intellijPluginRoot
to.irInlinerBeforeKlibSerialization = from.irInlinerBeforeKlibSerialization
to.kotlinHome = from.kotlinHome
to.languageVersion = from.languageVersion
to.legacySmartCastAfterTry = from.legacySmartCastAfterTry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fun copyCommonKlibBasedCompilerArguments(from: CommonKlibBasedCompilerArguments,

to.duplicatedUniqueNameStrategy = from.duplicatedUniqueNameStrategy
to.enableSignatureClashChecks = from.enableSignatureClashChecks
to.irInlinerBeforeKlibSerialization = from.irInlinerBeforeKlibSerialization
to.noDoubleInlining = from.noDoubleInlining
to.normalizeAbsolutePath = from.normalizeAbsolutePath
to.partialLinkageLogLevel = from.partialLinkageLogLevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,16 +813,6 @@ The corresponding calls' declarations may not be marked with @BuilderInference."
field = value
}

@Argument(
value = "-Xklib-ir-inliner",
description = "Enable experimental support to invoke IR Inliner before Klib serialization."
)
var irInlinerBeforeKlibSerialization = false
set(value) {
checkFrozen()
field = value
}

@Argument(
value = "-Xsuppress-warning",
valueDescription = "<WARNING_NAME>",
Expand Down Expand Up @@ -924,10 +914,6 @@ The corresponding calls' declarations may not be marked with @BuilderInference."
put(LanguageFeature.WhenGuards, LanguageFeature.State.ENABLED)
}

if (irInlinerBeforeKlibSerialization) {
put(LanguageFeature.IrInlinerBeforeKlibSerialization, LanguageFeature.State.ENABLED)
}

if (multiDollarInterpolation) {
put(LanguageFeature.MultiDollarInterpolation, LanguageFeature.State.ENABLED)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package org.jetbrains.kotlin.cli.common.arguments

import org.jetbrains.kotlin.config.DuplicatedUniqueNameStrategy
import org.jetbrains.kotlin.config.LanguageFeature

abstract class CommonKlibBasedCompilerArguments : CommonCompilerArguments() {
companion object {
Expand Down Expand Up @@ -77,4 +78,21 @@ abstract class CommonKlibBasedCompilerArguments : CommonCompilerArguments() {
checkFrozen()
field = if (value.isNullOrEmpty()) null else value
}

@Argument(
value = "-Xklib-ir-inliner",
description = "Enable experimental support to invoke IR Inliner before Klib serialization."
)
var irInlinerBeforeKlibSerialization = false
set(value) {
checkFrozen()
field = value
}

override fun configureExtraLanguageFeatures(map: HashMap<LanguageFeature, LanguageFeature.State>) {
super.configureExtraLanguageFeatures(map)
if (irInlinerBeforeKlibSerialization) {
map[LanguageFeature.IrInlinerBeforeKlibSerialization] = LanguageFeature.State.ENABLED
}
}
}
1 change: 0 additions & 1 deletion compiler/testData/cli/jvm/extraHelp.out
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ where advanced options include:
-Xinference-compatibility Enable compatibility changes for the generic type inference algorithm.
-Xinline-classes Enable experimental inline classes.
-Xintellij-plugin-root=<path> Path to 'kotlin-compiler.jar' or the directory where the IntelliJ IDEA configuration files can be found.
-Xklib-ir-inliner Enable experimental support to invoke IR Inliner before Klib serialization.
-Xlegacy-smart-cast-after-try Allow 'var' smart casts even in the presence of assignments in 'try' blocks.
-Xlist-phases List backend phases.
-Xmetadata-klib Produce a klib that only contains the metadata of declarations.
Expand Down

0 comments on commit 78af239

Please sign in to comment.