Files
kotlin-fork/compiler/testData/cli/jvm/extraHelp.out
T
Georgy Bronnikov 4caa71538d JVM_IR: introduce modes for IR serialization
Instead of a Boolean flag -Xserialize-ir, use modes: none,inline,all.
In "inline" mode, only information needed to deserialize bodies of inline
functions is serialized.
In the "all" mode, all declarations are serialized completely.
2021-10-11 11:53:29 +03:00

204 lines
18 KiB
Plaintext
Vendored

Usage: kotlinc-jvm <options> <source files>
where advanced options include:
-Xabi-stability={stable|unstable}
When using unstable compiler features such as FIR, use 'stable' to mark generated class files as stable
to prevent diagnostics from stable compilers at the call site.
When using the JVM IR backend, conversely, use 'unstable' to mark generated class files as unstable
to force diagnostics to be reported.
-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-no-source-files Allow no source files
-Xallow-unstable-dependencies Do not report errors on classes in dependencies, which were compiled by an unstable version of the Kotlin compiler
-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
-Xdump-declarations-to=<path> Path to JSON file to dump Java to Kotlin declaration mappings
-Xdefault-script-extension=<script filename extension>
Compile expressions and unrecognized scripts passed with the -script argument as scripts with given filename extension
-Xdisable-standard-script Disable standard kotlin script support
-Xir-do-not-clear-binding-context
When using the IR backend, do not clear BindingContext between psi2ir and lowerings
-Xemit-jvm-type-annotations Emit JVM type annotations in bytecode
-Xjvm-enable-preview Allow using features from Java language that are in preview phase.
Works as `--enable-preview` in Java. All class files are marked as preview-generated thus it won't be possible to use them in release environment
-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
-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
-Xjspecify-annotations=ignore|strict|warn
Specify behavior for jspecify annotations.
Default value is 'warn'
-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={all|all-compatibility|disable|enable|compatibility}
Emit JVM default methods for interface declarations with bodies.
-Xjvm-default=all-compatibility Generate both a default method in the interface, and a compatibility accessor
in the DefaultImpls class.
In case of inheritance from a Kotlin interface compiled in the old scheme
(DefaultImpls, no default methods), the compatibility accessor in DefaultImpls
will delegate to the DefaultImpls method of the superinterface. Otherwise the
compatibility accessor will invoke the default method on the interface, with
standard JVM runtime resolution semantics.
Note that if interface delegation is used, all interface methods are delegated.
The only exception are methods annotated with the deprecated @JvmDefault annotation.
-Xjvm-default=all Generate default methods for all interface declarations with bodies.
Do not generate DefaultImpls classes at all.
BREAKS BINARY COMPATIBILITY if some client code relies on the presence of
DefaultImpls classes. Also prohibits the produced binaries to be read by Kotlin
compilers earlier than 1.4.
Note that if interface delegation is used, all interface methods are delegated.
The only exception are methods annotated with the deprecated @JvmDefault annotation.
-Xjvm-default=disable Do not generate JVM default methods and prohibit @JvmDefault annotation usage.
-Xjvm-default=enable Allow usages of @JvmDefault; only generate the default method
for annotated 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 default interface method
-Xklib=<path> Paths to cross-platform libraries in .klib format
-Xlambdas={class|indy} Select code generation scheme for lambdas.
-Xlambdas=indy Generate lambdas using `invokedynamic` with `LambdaMetafactory.metafactory`. Requires `-jvm-target 1.8` or greater.
Lambda objects created using `LambdaMetafactory.metafactory` will have different `toString()`.
-Xlambdas=class Generate lambdas as explicit classes
-Xno-call-assertions Don't generate not-null assertions for arguments of platform types
-Xno-kotlin-nothing-value-exception
Do not use KotlinNothingValueException available since 1.4
-Xno-optimize Disable optimizations
-Xno-optimized-callable-references
Do not use optimized callable reference superclasses available from 1.4
-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-reset-jar-timestamps Do not reset jar entry timestamps to a fixed date
-Xno-unified-null-checks Use pre-1.4 exception types in null checks instead of java.lang.NPE. See KT-22275 for more details
-Xnullability-annotations=@<fq.name>:{ignore/strict/warn}
Specify behavior for specific Java nullability annotations (provided with fully qualified package name)
Modes:
* ignore
* strict
* warn (report a warning)
-Xbackend-threads=<N> When using the IR backend, run lowerings by file in N parallel threads.
0 means use a thread per processor core.
Default value is 1
-Xprofile=<profilerPath:command:outputDir>
Debug option: Run compiler with async profiler and save snapshots to `outputDir`; `command` is passed to async-profiler on start.
`profilerPath` is a path to libasyncProfiler.so; async-profiler.jar should be on the compiler classpath.
If it's not on the classpath, the compiler will attempt to load async-profiler.jar from the containing directory of profilerPath.
Example: -Xprofile=<PATH_TO_ASYNC_PROFILER>/async-profiler/build/libasyncProfiler.so:event=cpu,interval=1ms,threads,start,framebuf=50000000:<SNAPSHOT_DIR_PATH>
-Xrepeat=<number> Debug option: Repeats modules compilation <number> times
-Xsam-conversions={class|indy} Select code generation scheme for SAM conversions.
-Xsam-conversions=indy Generate SAM conversions using `invokedynamic` with `LambdaMetafactory.metafactory`. Requires `-jvm-target 1.8` or greater.
-Xsam-conversions=class Generate SAM conversions as explicit classes
-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)
-Xserialize-ir={none|inline|all}
Save IR to metadata (EXPERIMENTAL)
-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
-Xgenerate-strict-metadata-version
Generate metadata with strict version semantics (see kdoc on Metadata.extraInt)
-Xstring-concat={indy-with-constants|indy|inline}
Select code generation scheme for string concatenation.
-Xstring-concat=indy-with-constants Concatenate strings using `invokedynamic` `makeConcatWithConstants`. Requires `-jvm-target 9` or greater.
-Xstring-concat=indy Concatenate strings using `invokedynamic` `makeConcat`. Requires `-jvm-target 9` or greater.
-Xstring-concat=inline Concatenate strings using `StringBuilder`
default: `indy-with-constants` for JVM target 9 or greater, `inline` otherwise
-Xsupport-compatqual-checker-framework-annotations=enable|disable
Specify behavior for Checker Framework compatqual annotations (NullableDecl/NonNullDecl).
Default value is 'enable'
-Xsuppress-deprecated-jvm-target-warning
Suppress deprecation warning about deprecated JVM target versions
-Xsuppress-missing-builtins-error
Suppress the "cannot access built-in declaration" error (useful with -no-stdlib)
-Xtype-enhancement-improvements-strict-mode
Enable strict mode for some improvements in the type enhancement for loaded Java types based on nullability annotations,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.
Should be used in case of problems with the new implementation
-Xuse-14-inline-classes-mangling-scheme
Use 1.4 inline classes mangling scheme instead of 1.4.30 one
-Xuse-type-table Use type table in metadata serialization
-Xvalidate-bytecode Validate generated JVM bytecode before and after optimizations
-Xvalidate-ir Validate IR before and after lowering
-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
-Xbuiltins-from-sources Compile builtIns from sources
-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
-Xdisable-default-scripting-plugin
Do not enable scripting plugin by default
-Xdisable-phases Disable backend phases
-Xdisable-ultra-light-classes Do not use the ultra light classes implementation
-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
-Xenable-builder-inference Use the builder inference by default, for all calls with lambdas which can't be resolved without it.
The corresponding calls' declarations may not be marked with @BuilderInference.
-Xexpect-actual-linker Enable experimental expect/actual linker
-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.
-Xextended-compiler-checks Enable additional compiler checks that might provide verbose diagnostic information for certain errors.
Warning: this mode is not backward-compatible and might cause compilation errors in previously compiled code.
-Xinference-compatibility Enable compatibility changes for generic type inference algorithm
-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
-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
-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
-Xself-upper-bound-inference Support inferring type arguments based on only self upper bounds of the corresponding type parameters
-Xskip-metadata-version-check Allow to load classes with bad metadata version and pre-release classes
-Xskip-prerelease-check Allow to load pre-release classes
-Xsuppress-version-warnings Suppress warnings about outdated, inconsistent or experimental language or API versions
-Xunrestricted-builder-inference
Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call
-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-fir-extended-checkers Use extended analysis mode based on 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