917 Commits

Author SHA1 Message Date
Dmitriy Novozhilov d352cc9d96 [Frontend] Make DiagnosticSuppressor a project-level extension
Originally it was an application-level component, which caused non-trivial
  logic and cognitive load to carefully handle those extensions to avoid
  memory leaks.

6740a596 introduced a way to easily register `DiagnosticSuppressor` to
  project, and this commit continues this work, making it a proper
  project-level extension

A lot of changes caused by the fact, that this extension is needed to be
  obtained from `BindingContext` (see `BindingContextSuppressCache` and
  its usages), so almost all changes are introducing `Project` to
  `BindingContext`

^KT-66449 Fixed
2024-03-12 06:43:58 +00:00
Artem Kobzar 77f0cba23f [K/JS] Introduce v2015 target 2024-03-06 12:21:38 +00:00
Alexander Udalov f98a22e8e4 Fir2Ir: enable IR-based fake override builder
Invert the logic of IR/FIR2IR-based generators: change the CLI argument
to -Xuse-fir-fake-override-builder, test directive to
USE_FIR_BASED_FAKE_OVERRIDE_GENERATOR, etc.

The changes in test data caused by using IR fake override builder by
default are in the subsequent commit.

 #KT-61514
2024-02-29 10:14:31 +00:00
Alexander.Likhachev 95fd91ae16 [CLI, Gradle] Update GradleDeprecatedOption.removeAfter values
The values updated to follow the deprecation cycle "warning -> error -> removed"
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Alexander.Likhachev d20f31e963 [CLI, Gradle] Fix GradleDeprecatedOption.removeAfter processing
The expected format was Kotlin language version (e.g. `2.0`), however the actual passed values were Kotlin release versions (e.g. `2.0.0`)
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
Dmitrii Gridin 072d191306 [compiler] replace Enum values() with entries
To fix warnings. Also, use of `Enum.entries` may improve the performance

^KT-48872
2024-02-20 17:56:46 +00:00
Ilya Goncharov 12cd9c4530 [Gradle, JS] Deprecate only deprecated properties in compiler arguments copy 2024-02-09 18:20:08 +00:00
Ilya Goncharov d02be30e3b [Gradle, JS] Return back deprecated options noStdlib and metaInfo 2024-02-09 18:20:08 +00:00
Ilya Goncharov 2340d59f40 [JS] Get rid of outputFile in compiler args (KT-61116)
^KT-56753 fixed
2024-02-09 18:20:08 +00:00
Pavel Mikhailovskii 7ab9e03347 KT-65684: KAPT: (Re)enable fallback to K1 KAPT and make it default
[KAPT] KT-65684 Set languageVersion=1.9 in KaptToolIntegrationTestGenerated

[KAPT] KT-65684 Re-enable a few now-passing tests in Kapt4IT

[KAPT] KT-65684 Fix the logic setting -Xuse-kapt4 flag in Kapt4IT.forceKapt4()

The change is needed to make sure that all the tests have the flag set,
 otherwise some of them would silently switch to the fallback node.
Also disables a few now failing tests.

[KAPT] KT-65684 Revert "KT-64385 Enable K2 KAPT by default"

This reverts commit 7e9d6e60


Merge-request: KT-MR-14291
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-09 12:54:28 +00:00
Roman Efremov 1f30d076de [CLI] Introduce compiler argument to suppress error about API version
...greater than language version.

^KT-63712
2024-02-09 11:02:26 +00:00
Alexander Udalov 28797a31b4 JVM: refactor JvmDefaultMode, remove/rename some entries
- remove ENABLE/COMPATIBILITY because they can no longer be used
- remove forAllMethodsWithBody because its behavior is now equivalent to
  isEnabled
- inline isCompatibility
- inline DEFAULT
- rename ALL_INCOMPATIBLE -> ALL
2024-02-06 17:18:44 +00:00
Alexander Udalov 77dba281a3 CLI: remove obsolete -Xbuiltins-from-sources
Looks like it has no effect anymore after 3f2e996803.
2024-02-01 23:37:23 +00:00
Alexander Udalov 2d308e7c27 CLI: remove obsolete language feature arguments
These arguments switch language features which cannot be disabled
anymore because they're enabled from some LV not later than 1.4, and the
minimal supported LV is currently 1.4.
2024-02-01 23:37:23 +00:00
Alexander Udalov c2e67619ba CLI: remove obsolete -Xdisable-ultra-light-classes 2024-02-01 23:37:23 +00:00
Alexander Udalov 9d5e1bdc47 CLI: remove obsolete -Xallow-result-return-type 2024-02-01 23:37:23 +00:00
Alexander Udalov 49c659b379 CLI: remove obsolete -Xdump-declarations-to
It was only used in the very old version of binary compatibility
validator. It was never supported in the JVM IR backend.
2024-02-01 23:37:23 +00:00
Sergej Jaskiewicz e8aa05928d [FIR2IR] Unconditionally disable linkViaSignatures on JVM
It was an experimental compilation mode that we don't need anymore.

KT-64809
2024-01-19 13:35:59 +00:00
strangepleasures 7e9d6e601d KT-64385 Enable K2 KAPT by default
Also adds support for front-end compiler plugins in Kapt
2024-01-15 10:22:32 +00:00
Alexander Shabalin 3f2584bb02 [K/N] Move calls checker into separate module ^KT-62091 2024-01-05 13:35:35 +00:00
Troels Bjerre Lund b668433256 [CLI] Add cache for reflection lookup of CLI arguments
Add cache for reflection lookup of CLI arguments.

Replace CLI argument list with map.

The current cli parser tries to match every possible command line
argument against each command line argument, essentially in a double
loop. This fix replaces one of the loops with a map lookup. Building the 
map is not expensive, and pays for itself even with a modest number of
parameters. The map is cached between calls, making subsequent calls
much cheaper. If run in a daemon, repeatedly parsing, e.g., 250 
arguments, this speeds up argument parsing by a factor 20. 

Disallow -shortName=value in CLI arguments.

Co-authored-by: Troels Lund <troels@google.com>
2023-12-19 17:05:03 +00:00
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Ivan Kochurkin 145958e284 [K2] Disable constants evaluation with native metadata compilation
^KT-63835 Fixed
2023-12-08 16:38:04 +00:00
Troels Bjerre Lund 4f77434ea5 [K/N] Remove LLVM coverage
The -Xcoverage feature has not worked and has been disabled for a while.
This fix removes it, and all of its uses.


Co-authored-by: Troels Lund <troels@google.com>


Merge-request: KOTLIN-MR-821
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-12-06 14:07:16 +00:00
Dmitriy Dolovov b1c9791404 [Native] Warn on any usage of -repo CLI option
^KT-61098
2023-11-21 09:36:07 +00:00
Artem Kobzar 1832f5a3f7 [K/JS] Introduce the ability to consume platform-specific cli arguments inside the main function ^KT-16981 Fixed 2023-11-18 11:01:34 +00:00
Kirill Rakhman 4964ee12a9 [CLI] Update CLI argument descriptions after review 2023-11-17 14:36:28 +00:00
Yahor Berdnikau 3413b07550 [IC, Gradle] Remove 'kotlin.incremental.useClasspathSnapshot' system property
^KT-62962 Fixed
2023-11-17 11:34:19 +00:00
Dmitriy Dolovov e7b8f3ecde [Native] Deprecate KLIB repositories in Kotlin/Native compiler
1. Log warnings on usage of KLIB repositories.
2. Don't block using repositories for now.

^KT-61098
2023-11-15 19:38:24 +00:00
Chris Povirk 72c9378500 Fix error message for -Xjspecify-annotations.
The message currently claims that you can pass the value "disable," but
in fact the value it means is "ignore."
2023-11-13 09:59:27 +00:00
Ilya Kirillov 6f097dc8f6 Introduce utility function for specifying compiler argument names
^KT-63294
2023-11-08 17:32:48 +00:00
Alexander Udalov 4f96171716 K2: report IR_WITH_UNSTABLE_ABI_COMPILED_CLASS
Also, remove setting the value of allowUnstableDependencies to true if
K2 is used because we want K2 to report errors (as K1 does) on
unstable-ABI dependencies.

 #KT-61598 Fixed
2023-10-31 10:39:43 +00:00
Nikolay Lunyak ba9baa7457 [FIR] Don't enable features without sinceKotlin in Progressive Mode
There are two BUG_FIX features that have
been added to the compiler, without a clear
decision to enable them somewhere in the
future. Since there is no decision to
force users rewrite their code, such
features should not be enabled in
Progressive Mode.

^KT-62644 Fixed
^KT-62143 Fixed
2023-10-18 13:16:10 +00:00
Stanislav Erokhin 0cfa721585 [KMP] Remove experimental from -Xmulti-platform flag
#KT-61686
2023-10-04 18:19:35 +00:00
Dmitriy Dolovov 78a962f6d2 [KLIB] Deprecate -Xexpect-actual-linker CLI argument
This argument has been finally superseded by `-Xmetadata-klib`.

^KT-61136
2023-10-02 16:21:17 +00:00
Dmitriy Dolovov 38a67f3d30 [KLIB] Use -Xmetadata-klib to produce metadata KLIBs
With this change a new `-Xmetadata-klib` CLI flag becomes the
preferable way to instruct K2MetadataCompiler to produce metadata
KLIBs. The old `-Xexpect-actual-linker` flag still works for
K2MetadataCompiler, but that would last just for a short transition
period until the necessary changes are made in the Gradle plugin.

The K2NativeCompiler does not work anymore with `-Xexpect-actual-linker`
and respects only the `-Xmetadata-klib` flag. This is not an
issue since the Gradle plugin anyway supplies both flags for Native
metadata compilations.

^KT-61136
2023-09-20 22:26:36 +00:00
Dmitriy Dolovov 848c88b1a5 [KLIB] Lift up -Xmetadata-klib CLI key from Native to Common args
This is a precondition for obsoleting and finally removing
`-Xexpect-actual-linker` CLI key, which became useless since
the removal of ExpectActualTable.

^KT-61136
2023-09-20 22:26:36 +00:00
strangepleasures 8fb7ea1126 [KAPT4] KT-61333 Support REPORT_OUTPUT_FILES
Add extra logging
2023-09-15 11:05:05 +00:00
Dmitriy Dolovov 98b3bdb175 [K1] Rename analysis flag expectActualLinker
Rename analysis flag `expectActualLinker` to `skipExpectedActualDeclarationChecker`
to better reflect its semantics. This flag isn't used on IDE plugin side, so no
additional changes in `intellij` repo are needed.

^KT-61136
2023-09-14 07:32:18 +00:00
Alexander Udalov fd68b9f49c CLI: add -Xuse-ir-fake-override-builder
To be able to test IR fake override builder (KT-61514) outside of
compiler tests.
2023-09-13 15:01:52 +02:00
Nikita Bobko 2127b2ce68 expect/actual classes: experimental -> Beta
KT-61573
^KT-61712 Fixed
Review: https://jetbrains.team/p/kt/reviews/12044/files

It's a follow up commit

According our guidelines, it must be in Beta
https://kotlinlang.org/docs/components-stability.html#stability-of-subcomponents

And the whole multiplatform was in Beta, so we can't make part of the
multiplatform to have lower stability level
2023-09-11 13:57:28 +00:00
Nikita Bobko 01fc708a0f Mark expect/actual classifiers as experimental
^KT-61573 Fixed
Review: https://jetbrains.team/p/kt/reviews/11969/timeline

Tests:
- MultiPlatformIntegrationTestGenerated
- CliTestGenerated
- MultiPlatformIntegrationTestGenerated
- DiagnosticTestGenerated.Multiplatform
- FirLightTreeOldFrontendDiagnosticsTestGenerated

Also add -Xexpect-actual-classes flag to all necessary ./libraries/* modules
Otherwise compilation of those modules failes because of `-Werror`
2023-09-04 12:21:37 +00:00
Johan Bay 0a612e4268 [klib] Add an option to write out header klibs
The header klib is supposed to only contain the public abi of the module
similar to jvm-abi-gen. It is intended to be used as a dependency for other
klib compilations instead of the full klib for compilation avoidance.

^KT-60807
2023-08-29 13:25:07 +00:00
Bogdan Mukvich 7b00323b89 [Build] Update guava
Fix some reports from "Show Vulnerable Dependencies"

^KTI-1342
2023-08-25 14:10:37 +00:00
Kirill Rakhman 969c716c76 [FIR] Implement flag for disabling warning on error suppression
#KT-61129
2023-08-18 13:29:20 +00:00
Svyatoslav Kuzmich 47ade4530c [Wasm] Add compiler flag to disable exception handling proposal
Fail with unreachable instead of throwing an exception

Merge-request: KT-MR-11481
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-08-07 16:19:29 +00:00
Dmitrii Krasnov f2816a5531 Added property for overriding konan distribution location
#KT-50463 Fixed

Merge-request: KT-MR-10310
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-07-12 12:36:51 +00:00
Igor Yakovlev 750653e4b3 [Wasm] Add kotlin wasm wasi mode compiler flag 2023-07-07 15:23:18 +00:00
Pavel Mikhailovskii 083f54aceb [KAPT4] Create basic infrastructure for KAPT4 2023-07-07 11:09:16 +00:00