Add new compiler errors and flags when JVM compiles against JVM IR
From now on, the old JVM backend will report an error by default when compiling against class files produced by the JVM IR backend. This is needed because we're not yet sure that the ABI generated by JVM IR is fully correct and do not want to land in a 2-dimensional compatibility situation where we'll need to consider twice more scenarios when introducing any breaking change in the language. This is generally OK since the JVM IR backend is still going to be experimental in 1.4. However, for purposes of users which _do_ need to compile something with the old backend against JVM IR, we provide two new compiler flags: * -Xallow-jvm-ir-dependencies -- allows to suppress the error when compiling with the old backend against JVM IR. * -Xir-binary-with-stable-api -- allows to mark the generated binaries as stable, when compiling anything with JVM IR, so that dependent modules will compile even with the old backend automatically. In this case, the author usually does not care for the generated ABI, or s/he ensures that it's consistent with the one expected by the old compiler with some external tools. Internally, this is implemented by storing two new flags in kotlin.Metadata: one tells if the class file was compiled with the JVM IR, and another tells if the class file is stable (in case it's compiled with JVM IR). Implementation is similar to the diagnostic reported by the pre-release dependency checker.
This commit is contained in:
+3
@@ -2,6 +2,7 @@ Usage: kotlinc-jvm <options> <source files>
|
||||
where advanced options include:
|
||||
-Xadd-modules=<module[,]> Root modules to resolve in addition to the initial modules,
|
||||
or all modules on the module path if <module> is ALL-MODULE-PATH
|
||||
-Xallow-jvm-ir-dependencies When not using the IR backend, do not report errors on those classes in dependencies, which were compiled by the IR backend
|
||||
-Xallow-no-source-files Allow no source files
|
||||
-Xassertions={always-enable|always-disable|jvm|legacy}
|
||||
Assert calls behaviour
|
||||
@@ -22,6 +23,8 @@ where advanced options include:
|
||||
-Xfriend-paths=<path> Paths to output directories for friend modules (whose internals should be visible)
|
||||
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
|
||||
-Xir-check-local-names Check that names of local classes and anonymous objects are the same in the IR backend as in the old backend
|
||||
-Xir-binary-with-stable-abi When using the IR backend, produce binaries which can be read by non-IR backend.
|
||||
The author is responsible for verifying that the resulting binaries do indeed have the correct ABI
|
||||
-Xmodule-path=<path> Paths where to find Java 9+ modules
|
||||
-Xjava-package-prefix Package prefix for Java files
|
||||
-Xjava-source-roots=<path> Paths to directories with Java source files
|
||||
|
||||
Reference in New Issue
Block a user