Files
kotlin-fork/compiler/testData/cli/jvm/extraHelp.out
T
Alexander Udalov 953b461c53 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.
2020-01-29 17:20:41 +01:00

130 lines
11 KiB
Plaintext
Vendored

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
-Xassertions=always-enable: enable, ignore jvm assertion settings;
-Xassertions=always-disable: disable, ignore jvm assertion settings;
-Xassertions=jvm: enable, depend on jvm assertion settings;
-Xassertions=legacy: calculate condition on each call, check depends on jvm assertion settings in the kotlin package;
default: legacy
-Xbuild-file=<path> Path to the .xml build file to compile
-Xcompile-java Reuse javac analysis and compile Java source files
-Xnormalize-constructor-calls={disable|enable}
Normalize constructor calls (disable: don't normalize; enable: normalize),
default is 'disable' in language version 1.2 and below,
'enable' since language version 1.3
-Xdump-declarations-to=<path> Path to JSON file to dump Java to Kotlin declaration mappings
-Xdisable-standard-script Disable standard kotlin script support
-Xemit-jvm-type-annotations Emit JVM type annotations in bytecode
-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
-Xjavac-arguments=<option[,]> Java compiler arguments
-Xjsr305={ignore/strict/warn}|under-migration:{ignore/strict/warn}|@<fq.name>:{ignore/strict/warn}
Specify behavior for JSR-305 nullability annotations:
-Xjsr305={ignore/strict/warn} globally (all non-@UnderMigration annotations)
-Xjsr305=under-migration:{ignore/strict/warn} all @UnderMigration annotations
-Xjsr305=@<fq.name>:{ignore/strict/warn} annotation with the given fully qualified class name
Modes:
* ignore
* strict (experimental; treat as other supported nullability annotations)
* warn (report a warning)
-Xjvm-default={disable|enable|compatibility}
Allow to use '@JvmDefault' annotation for JVM default method support.
-Xjvm-default=disable Prohibit usages of @JvmDefault
-Xjvm-default=enable Allow usages of @JvmDefault; only generate the default method
in the interface (annotating an existing method can break binary compatibility)
-Xjvm-default=compatibility Allow usages of @JvmDefault; generate a compatibility accessor
in the 'DefaultImpls' class in addition to the interface method
-Xklib=<path> Paths to cross-platform libraries in .klib format
-Xno-call-assertions Don't generate not-null assertions for arguments of platform types
-Xno-exception-on-explicit-equals-for-boxed-null
Do not throw NPE on explicit 'equals' call for null receiver of platform boxed primitive type
-Xno-optimize Disable optimizations
-Xno-param-assertions Don't generate not-null assertions on parameters of methods accessible from Java
-Xno-receiver-assertions Don't generate not-null assertion for extension receiver arguments of platform types
-Xno-use-ir Do not use the IR backend. Useful for a custom-built compiler where IR backend is enabled by default
-Xsanitize-parentheses Transform '(' and ')' in method names to some other character sequence.
This mode can BREAK BINARY COMPATIBILITY and is only supposed to be used to workaround
problems with parentheses in identifiers on certain platforms
-Xscript-resolver-environment=<key=value[,]>
Script resolver environment in key-value pairs (the value could be quoted and escaped)
-Xsingle-module Combine modules for source files and binary dependencies into a single module
-Xskip-runtime-version-check Allow Kotlin runtime libraries of incompatible versions in the classpath
-Xstrict-java-nullability-assertions
Generate nullability assertions for non-null Java expressions
-Xgenerate-strict-metadata-version
Generate metadata with strict version semantics (see kdoc on Metadata.extraInt)
-Xsupport-compatqual-checker-framework-annotations=enable|disable
Specify behavior for Checker Framework compatqual annotations (NullableDecl/NonNullDecl).
Default value is 'enable'
-Xsuppress-missing-builtins-error
Suppress the "cannot access built-in declaration" error (useful with -no-stdlib)
-Xuse-ir Use the IR backend
-Xuse-javac Use javac for Java source and class files analysis
-Xuse-old-class-files-reading Use old class files reading implementation. This may slow down the build and cause problems with Groovy interop.
Should be used in case of problems with the new implementation
-Xuse-type-table Use type table in metadata serialization
-Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info
-Xallow-result-return-type Allow compiling code when `kotlin.Result` is used as a return type
-Xcheck-phase-conditions Check pre- and postconditions on phases
-Xcheck-sticky-phase-conditions
Run sticky condition checks on subsequent phases as well. Implies -Xcheck-phase-conditions
-Xcommon-sources=<path> Sources of the common module that need to be compiled together with this module in the multi-platform mode.
Should be a subset of sources passed as free arguments
-Xcoroutines={enable|warn|error}
Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier
-Xdisable-default-scripting-plugin
Do not enable scripting plugin by default
-Xdisable-phases Disable backend phases
-Xdump-directory Dump backend state into directory
-Xdump-fqname FqName of declaration that should be dumped
-Xdump-perf=<path> Dump detailed performance statistics to the specified file
-Xeffect-system Enable experimental language feature: effect system
-Xexperimental=<fq.name> Enable and propagate usages of experimental API for marker annotation with the given fully qualified name
-Xexplicit-api={strict|warning|disable}
Force compiler to report errors on all public API declarations without explicit visibility or return type.
Use 'warning' level to issue warnings instead of errors.
-Xinline-classes Enable experimental inline classes
-Xintellij-plugin-root=<path> Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found
-Xklib-mpp Enable experimental support for multi-platform klib libraries
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xlist-phases List backend phases
-Xmetadata-version Change metadata version of the generated binary files
-Xmulti-platform Enable experimental language support for multi-platform projects
-Xexclude-from-dumping Names of elements that should not be dumped
-Xnew-inference Enable new experimental generic type inference algorithm
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
-Xno-inline Disable method inlining
-Xopt-in=<fq.name> Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name
-Xphases-to-dump Dump backend state both before and after these phases
-Xphases-to-dump-after Dump backend state after these phases
-Xphases-to-dump-before Dump backend state before these phases
-Xphases-to-validate Validate backend state both before and after these phases
-Xphases-to-validate-after Validate backend state after these phases
-Xphases-to-validate-before Validate backend state before these phases
-Xplugin=<path> Load plugins from the given classpath
-Xpolymorphic-signature Enable experimental support for @PolymorphicSignature (MethodHandle/VarHandle)
-Xprofile-phases Profile backend phases
-Xproper-ieee754-comparisons Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types
-Xread-deserialized-contracts Enable reading of contracts from metadata
-Xreport-output-files Report source to output files mapping
-Xreport-perf Report detailed performance statistics
-Xskip-metadata-version-check Load classes with bad metadata version anyway (incl. pre-release classes)
-Xuse-experimental=<fq.name> Enable, but don't propagate usages of experimental API for marker annotation with the given fully qualified name
-Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready
-Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed
-Xverbose-phases Be verbose while performing these backend phases
Advanced options are non-standard and may be changed or removed without any notice.
OK