Remove obsolete compiler flag -Xuse-ir
This commit is contained in:
committed by
Space Team
parent
2951e0b955
commit
60016d3e5b
-1
@@ -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
|
||||
|
||||
-10
@@ -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) {
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
-1
@@ -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) {
|
||||
|
||||
-1
@@ -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
|
||||
|
||||
-1
@@ -14,7 +14,6 @@ abstract class AbstractIncrementalFirICLightTreeJvmCompilerRunnerTest : Abstract
|
||||
super.createCompilerArguments(destinationDir, testDir).apply {
|
||||
useK2 = true
|
||||
languageVersion = "2.0"
|
||||
useIR = true
|
||||
useFirIC = true
|
||||
useFirLT = true
|
||||
}
|
||||
|
||||
-1
@@ -25,7 +25,6 @@ abstract class AbstractIncrementalFirJvmCompilerRunnerTest : AbstractIncremental
|
||||
super.createCompilerArguments(destinationDir, testDir).apply {
|
||||
useK2 = true
|
||||
languageVersion = "2.0"
|
||||
useIR = true
|
||||
}
|
||||
|
||||
override val buildLogFinder: BuildLogFinder
|
||||
|
||||
-1
@@ -14,7 +14,6 @@ abstract class AbstractIncrementalFirLightTreeJvmCompilerRunnerTest : AbstractIn
|
||||
super.createCompilerArguments(destinationDir, testDir).apply {
|
||||
useK2 = true
|
||||
languageVersion = "2.0"
|
||||
useIR = true
|
||||
useFirIC = false
|
||||
useFirLT = true
|
||||
}
|
||||
|
||||
-1
@@ -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.
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -141,7 +141,6 @@ class CompilerArgumentsContentProspectorTest {
|
||||
K2JVMCompilerArguments::noStdlib,
|
||||
K2JVMCompilerArguments::noReflect,
|
||||
K2JVMCompilerArguments::javaParameters,
|
||||
K2JVMCompilerArguments::useIR,
|
||||
K2JVMCompilerArguments::allowUnstableDependencies,
|
||||
K2JVMCompilerArguments::doNotClearBindingContext,
|
||||
K2JVMCompilerArguments::noCallAssertions,
|
||||
|
||||
-8
@@ -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)
|
||||
|
||||
-8
@@ -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)
|
||||
|
||||
-8
@@ -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)
|
||||
|
||||
+1
-2
@@ -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())
|
||||
|
||||
|
||||
-1
@@ -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),
|
||||
|
||||
|
||||
-1
@@ -133,7 +133,6 @@ internal fun reportArgumentsNotAllowed(
|
||||
messageCollector,
|
||||
reportingState,
|
||||
K2JVMCompilerArguments::useJavac,
|
||||
K2JVMCompilerArguments::useIR,
|
||||
K2JVMCompilerArguments::useK2
|
||||
)
|
||||
|
||||
|
||||
-8
@@ -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 \\""" }
|
||||
|
||||
Reference in New Issue
Block a user