Report deprecation warning when -Xuse-old-backend is specified

#KT-48532
This commit is contained in:
Alexander Udalov
2021-08-06 19:23:49 +02:00
parent 778b04ae34
commit a6336ec134
5 changed files with 14 additions and 3 deletions
@@ -212,13 +212,20 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr
arguments.useIR && !useOldBackend
}
if (arguments.useIR && arguments.useOldBackend) {
if (arguments.useOldBackend) {
messageCollector.report(
STRONG_WARNING,
"Both -Xuse-ir and -Xuse-old-backend are passed. This is an inconsistent configuration. " +
"The compiler will use the ${if (useIR) "JVM IR" else "old JVM"} backend"
"-Xuse-old-backend is deprecated and will be removed in a future release"
)
if (arguments.useIR) {
messageCollector.report(
STRONG_WARNING,
"Both -Xuse-ir and -Xuse-old-backend are passed. This is an inconsistent configuration. " +
"The compiler will use the ${if (useIR) "JVM IR" else "old JVM"} backend"
)
}
}
messageCollector.report(LOGGING, "Using ${if (useIR) "JVM IR" else "old JVM"} backend")
put(JVMConfigurationKeys.IR, useIR)