Commit Graph

825 Commits

Author SHA1 Message Date
Yahor Berdnikau 96316a4016 Generate KotlinNativeCompilerOptions Gradle DSL
^KT-53108 In Progress
2023-02-22 13:02:59 +00:00
Yahor Berdnikau 0cad069522 [Build] Pin api and language level to 1.8 in Kotlin compiler modules used by KGP
This is required to be able to compile KGP and it's dependencies which
set LV to 1.4 when repo will use LV 1.9. This caused by the change how
enums are compiled (KT-48872).
2023-02-18 13:26:54 +00:00
Dmitriy Novozhilov 94faa759cb [CLI] Rename -XdependsOn flag to -Xdepends-on to keep convention
^KT-56209
2023-02-17 14:09:30 +00:00
Dmitriy Novozhilov 77caa31640 [CLI] Add CLI arguments to pass HMPP module structure to the compiler
^KT-56209
2023-02-17 11:08:50 +00:00
Igor Chevdar ba172358d8 [K/N] Option to specify IR validation severity 2023-02-14 07:30:47 +00:00
Anna Kozlova f784628ebf [CLI] reduce memory usage for compiler settings
make write protection directly in properties
it creates no additional wrapper with the link to the containing class
for ij project, this reduces memory usage for ~15 mb

^KT-56351
2023-02-06 07:57:53 +00:00
Anna Kozlova 48b1456290 [CLI] create ArgumentParseErrors instances on request
spare memory for projects with big number of modules
currently 500kb for IJ monorepo of mostly empty errors
2023-01-31 16:08:23 +00:00
Yahor Berdnikau 45213e1468 Switch @GradleOption params to enum classes.
This should improve developers UX when using this annotation.
2023-01-29 20:59:28 +00:00
Ilya Goncharov 1150ec6882 [JS] Implementation dependencies for JS klibs
^KT-56158 fixed
2023-01-27 13:31:59 +00:00
Stanislav Ruban 4523535545 Deprecate -Xuse-k2 compiler flag in Gradle DSL
^KT-56239 Fixed
2023-01-27 12:42:50 +00:00
Sergey Bogolepov 851d84a865 [K/N] Enable proper LLVM IR dump and verify actions
Also introduce -Xsave-llvm-ir-directory argument
that should be used instead of -Xtemporary-files-dir
as a location for LLVM IR from phases.
Motivation for this change: it is simpler to implement
and unties LLVM actions from the awful TempFiles class.
2023-01-26 14:32:48 +00:00
Stanislav Ruban 7e0f69b8de Introduce tweaks and wording changes related to LV2.0-specific CLI warnings
Fix merge conflict related to renaming of one of the tests

Regenerate tests affected by previous commit

Fix merge conflict related to renaming of one of the tests

Improve wording of the `-Xuse-k2 -language-version 1.*` CLI warning

Improve wording of LV2.0-specific CLI warnings some more

Fix output of one of the tests for -Xuse-k2 deprecation

Tweak wording of LV2.0-specific CLI warnings

* make it clear in every warning that -Xuse-k2 is deprecated
* add a reminder to remove -Xuse-k2 for `-Xuse-k2 -language-version 2.0`
* add both possibly wanted fixes for `-Xuse-k2 -language-version 1.*`

Remove deprecated -Xuse-k2 flag from one of the tests

Merge-request: KT-MR-8449
Merged-by: Stanislav Ruban <Stanislav.Ruban@jetbrains.com>
2023-01-26 11:55:03 +00:00
Alexander Likhachev 742e240bdc [IC] Report messages with CompilerMessageSeverity.OUTPUT without grouping
#KT-49785 In Progress
2023-01-17 22:15:51 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Mikhail Glukhikh 70fc891260 K2: move -Xuse-k2 VS language version checks to CommonCompilerArguments 2023-01-16 18:16:49 +01:00
Mikhail Glukhikh 3dc05f4ec5 Introduce language version 2.0 and associate K2 compiler with it 2023-01-16 18:12:55 +01:00
Igor Chevdar 9c86532eb0 [K/N] Implemented cache orchestration machinery in the compiler 2023-01-11 14:13:01 +00:00
Yahor Berdnikau 43eea47032 Mark compiler arguments that should generate deprecated kotlinOptions DSL
This will allow to keep backward compatiblity for deprecated
kotlinOptions DSL for already existing compiler arguments, but add a new
 one only into compilerOptions DSL.

^KT-53108 In Progress
2023-01-10 14:56:11 +00:00
Ilya Chernikov 16f52f4c50 K2: use LightTree by default with K2 2023-01-02 19:54:55 +00:00
Alexander Udalov 3f2b51151f Remove -Xexclude-from-dumping
Apparently the underlying logic was removed in b07690fccf and no one
noticed.
2023-01-02 15:26:07 +00:00
Artem Kobzar fbf06b5495 [K/JS] Add a secret system property to enable the old Kotlin/JS compiler only for tests until it will be removed from the sources 2022-12-29 13:32:01 +00:00
Igor Yakovlev 71afbb36f5 [Wasm] Introduce Xwasm-generate-wat compiler flag (disabled by default) 2022-12-29 11:57:48 +00:00
Kevin Bourrillion 70cd547c26 Fix two other tests to treat both old and new JSpecify packages the same 2022-12-27 11:11:00 +00:00
Evgeniy.Zhelenskiy 25db5bf6e1 [IR] Enable -Xvalue-classes flag
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-12-22 12:24:16 +00:00
Sergey Bogolepov 366edcfe3c [K/N] Drop obsolete static driver 2022-12-20 06:30:36 +00:00
Ilya Muradyan db5913bbb6 KTIJ-8463: add possibility to pass additional analyzer flags 2022-12-15 10:30:43 +01:00
Dmitriy Novozhilov f8487ba545 [CLI] Filter out blank arguments from system environment 2022-12-09 12:02:09 +00:00
Troels Bjerre Lund bb1acf729b [K/N] Add custom allocator prototype ^KT-55364
Enable custom allocator with -Xallocator=custom.

If the gc is cms (default):
 * a patched version of the memory manager is used that does not build a
   list of allocated objects.
 * a patched version of the cms is used that defers to the allocator for
   sweeping.

Otherwise, a warning is printed, and the allocator is used using the
standard api.

Design doc:
https://docs.google.com/document/d/15xMp-nE-DWL8OrtOc8DoXB80AHUphFICEGjj5K0aNFc

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

Merge-request: KOTLIN-MR-546
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2022-12-08 17:22:04 +00:00
Alexander Korepanov 9dab8637a8 [JS Gradle] Pass incremental cache root dir to K2JS compiler 2022-11-28 20:46:40 +00:00
Ilya Chernikov e4a361a4b4 K2 Scripting: disable scripts in source roots by default
fixes ultimate FP test
2022-11-28 15:10:55 +00:00
Sebastian Sellmair 7870c82221 [Gradle][Native] K2NativeCompilerArguments.refinesPaths: Use Array<String> instead of String
^KT-55071 Verification Pending
2022-11-24 14:42:11 +00:00
Sebastian Sellmair 752ff04245 [Gradle][Native] Setup refinesPaths as expectedBy module dependencies
Previously, dependsOn dependencies were just passed as friend modules
to shared native compilations.

^KT-55071 Verification Pending
2022-11-24 14:42:10 +00:00
Artem Kobzar c1c5933c72 [K/JS] Deprecate old JS-compiler 2022-11-23 11:22:29 +00:00
Svyatoslav Kuzmich 78bd6dbdcd [Wasm] Allow implementing function interfaces 2022-11-14 11:23:18 +01:00
Ilya Chernikov 7a57e8d903 FIR JS: Add K2 support to K2JsIrCompiler 2022-11-12 16:28:24 +01:00
Alexander Korepanov 92638573ce [JS IR] Add messages about unused cli arguments 2022-11-07 17:57:42 +00:00
Alexander Korepanov 041e755c70 [JS IR] Cleanup BackendContext flags 2022-11-07 17:57:41 +00:00
Alexander Korepanov d5e9e87538 [JS BE] Drop JS scripting support
JS scripting uses the old IR to JS transformer.
 The new IR to JS transformer can not be used for
 JS scripting out of the box. Patching the new transformer for
 JS scripting is potentially dangerous and requires a lot of effort.
 Dropping JS scripting and the old IR to JS transformer allows to
 refactor and simplify JS BE codebase.
2022-11-04 14:15:15 +00:00
Yahor Berdnikau a7e1d36528 Drop compileOnly dependency on :kotlin-gradle-compiler-types in compiler
This dependency was only required for compiler options Gradle DSL
generation, but was leaking into runtime not-accessible classes.

^KT-54602 Fixed
2022-10-26 16:32:36 +02:00
Aleksei.Cherepanov 26e7c29a91 [JPS] Rebuild module on facet change
The logic of detecting changes in Kotlin facets was changed from "Include selected fields" to "Include all compiler arguments and exclude selected". This will help to avoid multiple IC issues when new change-sensitive compiler arguments will be added

(#KTIJ-17137, #KT-51536, #KTIJ-17170, #KTIJ-17300, #KT-47983) Fixed

Merge-request: KT-MR-7455
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2022-10-26 09:45:27 +00:00
Artem Kobzar 7b9aed25da [K/JS] Add the ability to turn off polyfills generating 2022-10-19 12:52:23 +00:00
Ilya Goncharov ca8b415726 [JS IR] Change names of ir-only arguments 2022-10-18 09:59:17 +00:00
Ilya Goncharov ec50036884 [JS IR] Change module name compiler flags 2022-10-18 09:59:16 +00:00
Artem Kobzar 9a4a30c9bb [K/JS] Add flag for disabling signature uniqueness checks at klib generating phase 2022-10-14 13:08:58 +00:00
Alexander Udalov d249b02cda Add JvmDefaultWithCompatibility to some interfaces
This has no effect on behavior, but will fix a binary compatibility
problem with Compose.

 #KT-54459 Fixed

Co-authored-by: Alexander Likhachev <Alexander.Likhachev@jetbrains.com>
2022-10-14 14:48:15 +02:00
Sergej Jaskiewicz 227864c6ec [JS IR] Add a compiler option for generating name entries in sourcemaps 2022-10-14 10:09:39 +00:00
Artem Kobzar de880ce9aa [K/JS] Move ES modules logic to a new transformer with IC 2022-10-13 07:32:44 +00:00
Svyatoslav Scherbina 28dea9d949 Native: remove obsolete compiler flags that have no effect
Same for compiler configuration keys.
2022-10-07 15:33:42 +00:00
Sergey Bogolepov d7fff3ca01 [K/N] Add -Xforce-compiler-driver=(static, dynamic) flag
Useful for development purposes when one wants to compare
the outputs of different drivers.
2022-10-06 13:10:50 +00:00
Simon Ogorodnik f2dee2bf85 Core. Fix data-race in ApplicationEnvironment initialization
getOrCreateApplicationEnvironment is main entrypoint to create
ApplicationEnvironment in production and compiler tests
It is subject to be called concurrently, that's why
APPLICATION_LOCK exists

ApplicationEnvironment itself hosts Application from idea-core
It is actually singleton, that is subject to be disposed, once all
operations referencing it completes

To properly dispose ApplicationEnvironment when there is no references
left, we maintain reference counter aka ourProjectCount

Originally, there was data-race caused by the fact, that ourProjectCount
was updated after publication of application

Linear, data-race occurs in following order
T1: getOrCreateApplicationEnvironment returns application
T2: Disposes its reference to application, causing ourProjectCount to
reach zero, and disposing application that is already available to T1
T1: Updates counter, but its application already disposed
2022-10-03 13:36:05 +00:00