Change CLI flags for controlling diagnostics for ABI of FIR and JVM IR

- Use a more generic `-Xallow-unstable-dependencies` instead of
  `-Xallow-jvm-ir-dependencies`
- Change `-Xir-binary-with-stable-abi` to `-Xabi-stability=stable`, with
  an additional option to specify `unstable` after a subsequent commit
  where JVM IR becomes stable by default

 #KT-43592
This commit is contained in:
Alexander Udalov
2020-12-07 21:38:45 +01:00
parent 3f517d7e8d
commit 06805ffbaa
6 changed files with 34 additions and 17 deletions
@@ -95,18 +95,18 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
var irCheckLocalNames: Boolean by FreezableVar(false)
@Argument(
value = "-Xallow-jvm-ir-dependencies",
description = "When not using the IR backend, do not report errors on those classes in dependencies, " +
"which were compiled by the IR backend"
value = "-Xallow-unstable-dependencies",
description = "Do not report errors on classes in dependencies, which were compiled by an unstable version of the Kotlin compiler"
)
var allowJvmIrDependencies: Boolean by FreezableVar(false)
var allowUnstableDependencies: Boolean by FreezableVar(false)
@Argument(
value = "-Xir-binary-with-stable-abi",
description = "When using the IR backend, produce binaries which can be read by non-IR backend.\n" +
"The author is responsible for verifying that the resulting binaries do indeed have the correct ABI"
value = "-Xabi-stability",
valueDescription = "{stable|unstable}",
description = "When using unstable compiler features such as FIR or JVM IR, use 'stable' to mark generated class files as stable\n" +
"to prevent diagnostics from stable compilers at the call site.\n"
)
var isIrWithStableAbi: Boolean by FreezableVar(false)
var abiStability: String? by FreezableVar(null)
@Argument(
value = "-Xir-do-not-clear-binding-context",
@@ -446,7 +446,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
result[JvmAnalysisFlags.suppressMissingBuiltinsError] = suppressMissingBuiltinsError
result[JvmAnalysisFlags.irCheckLocalNames] = irCheckLocalNames
result[JvmAnalysisFlags.enableJvmPreview] = enableJvmPreview
result[AnalysisFlags.allowUnstableDependencies] = allowJvmIrDependencies || useIR || useFir
result[AnalysisFlags.allowUnstableDependencies] = allowUnstableDependencies || useIR || useFir
result[JvmAnalysisFlags.disableUltraLightClasses] = disableUltraLightClasses
return result
}