Commit Graph

505 Commits

Author SHA1 Message Date
Dmitriy Dolovov 0de04f934e [Commonizer] Switch from trove4j to fastutil
^KT-63159
2023-11-06 19:56:17 +00:00
Dmitriy Dolovov 7658b818ac [Commonizer] Add a performance test (muted by default)
This test can be used to make small performance measurements of
the core commonizer on occasional basis. This test is not intended
for regular execution, e.g. at the CI server.

^KT-63159
2023-11-06 19:56:17 +00:00
Dmitriy Novozhilov 7ff2fc9dbe Add workaround for KT-62702 2023-10-19 12:13:46 +00:00
Sebastian Sellmair 9031deeacf [Commonizer] PropertyCommonizer: Support annotation commonization
^KT-62028 Verification Pending
2023-09-21 12:39:15 +00:00
Sebastian Sellmair f5b107d4f0 [Commonizer] ClassCommonizer: Support annotation commonization
^KT-62028 Verification Pending
2023-09-21 12:39:15 +00:00
Alexander.Likhachev 357d12fc8e [Build] Move JUnit dependencies into the version catalog
The `kotlin-test` dependencies are left untouched as changing them affects publications, thus these versions are independent from the used inside our build
#KTI-1349 In Progress
2023-09-06 22:47:33 +00:00
Leonid Startsev 06c471d413 Remove deprecated Flag usages in MetadataDeclarationsComparator.kt
#KT-59440
2023-08-23 16:47:05 +00:00
Leonid Startsev 8b821e1feb Deprecate KmProperty.hasGetter(hasSetter) in favor of KmProperty.getter(setter)
as a follow-up of flag deprecation.

#KT-59440
2023-08-14 12:36:34 +00:00
Dmitriy Dolovov 3b626ea97c [Commonizer] Replace ResettableClockMark by TimeSource.Monotonic 2023-08-08 09:40:18 +00:00
Sebastian Sellmair d510c93241 [Commonizer] Support generic/simple annotation commonization (to support kotlinx.cinterop.* annotations)
^KT-59302 Verification Pending
2023-08-04 11:29:23 +00:00
Nikita Bobko 4f3ecedbca [FE] Stop ignoring ABSTRACT_MEMBER_NOT_IMPLEMENTED for expect classes
^KT-59739 Fixed
Review: https://jetbrains.team/p/kt/reviews/11038/timeline
2023-07-24 09:15:11 +00:00
Pavel Kunyavskiy fd564d4af9 [K/N] Disable custom import for forward declarations
If forward declaration exists in a library, it was
possible to import it both by forward declaration name
and normal library name. This is strange unique behavior.
And it would also make KT-59643 changes binary incompatible.
So from now it's only possible to import forward declaration by
forward declaration name only.

^KT-59642
2023-07-24 08:24:20 +00:00
Pavel Kunyavskiy ef9413108b [K/N] Consolidate forward declarations handling
This is refactoring in preparation for KT-59764.
Names and layout of forward declarations related classes
was copy-pasted many times over compiler code.

Implementing KT-59764 would require copy-pasting it two more times.
So instead of doing this it was put in single place.

No behaviour changes intended in this commit.
2023-07-10 08:59:16 +00:00
Leonid Startsev b15da7c63a Deprecate old kotlinx-metadata flags API:
Flag, Flag constants, Flags typealias, flagsOf() function, and
Flag accessors in nodes (such as KmClass.flags, KmClass.jvmFlags, KmProperty.setterFlags, etc)

#KT-59440
2023-06-27 15:12:46 +00:00
Leonid Startsev 1a1cbcb321 Rework flags in kotlinx.metadata:
Introduce extensions for KmNodes to work with various modifiers instead of old Flags.SOMETHING.invoke(flags).
Provide Visibility, Modality, and Kind enums.
Introduce KmPropertyAccessorAttributes to replace KmProperty.getterFlags and KmProperty.setterFlags.
Deprecate nodes constructors which take flags but not flags itself (yet).
Adapt KotlinP to changes.

#KT-59440 Fixed
2023-06-27 15:12:46 +00:00
Pavel Kunyavskiy b28b0e70b6 [commonizer] Support commonizing includedForwardDeclarations in manifest
It is a new manifest property which is used only in K2, and it is
required for correct K2 processing of forward declarations.

^KT-59132
2023-06-27 08:05:52 +00:00
Leonid Startsev 0cfe2b04f5 Move KmModuleFragment to an internal.common package
because it is klib-related and can be read only with KotlinCommonMetadata.
2023-06-08 17:53:31 +00:00
Pavel Punegov 47c7dfe6b4 [K/N][klib] Wrap library dependencies with quotation marks
Fixes ^KT-58537. Space in the library now should be correctly parsed now
Klib readers can already read this
2023-06-05 14:40:11 +00:00
Roman Efremov c8023eac13 [commonizer] Don't commonize "tailrec" and "external" modifiers
expect external and tailrec were prohibited
in previous commit.

^KT-58536
2023-05-23 12:43:51 +00:00
Nataliya.Valtman 2a391f7330 Move kotlin-build-statistic project to :compiler 2023-04-25 11:29:09 +00:00
nataliya.valtman e34dd043da Add minimal statistic report for JPS build
Fix build stat for gradle 8

#KT-56438 Fixed
2023-04-25 11:29:09 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Vyacheslav Gerasimov 76c54a8ff3 Build: Fix usages of apis deprecated in Gradle 8 2023-03-20 19:45:39 +00:00
Sebastian Sellmair d103f60af8 [Commonizer] Demote duplicate dependency libraries to 'warning'
^KT-56729 Verification Pending
2023-02-20 16:30:10 +00:00
Sebastian Sellmair 513f4a3c42 [Commonizer] Commonize 'HAS_ENUM_ENTRIES' flag
^KT-56207 Verification Pending
2023-02-06 18:36:37 +00:00
Nikita Bobko 62b27b4613 Cleanup: drop KlibIrVersion
Review: https://jetbrains.team/p/kt/reviews/8401
In scope of: KT-55082

Because this version isn't used for anything. We have KotlinAbiVersion
to version the IR format.
2023-02-01 15:13:34 +01:00
Dmitriy Novozhilov 993695a7d0 [Commonizer] Mute tests due to KT-56207 2023-01-30 09:30:00 +00:00
Roman Efremov 2dc3871954 Add "hasEnumEntries" class flag to kotlinx-metadata
^KT-53929 Fixed
2023-01-23 12:53:06 +01:00
Mikhail Glukhikh 89dd28226b BinaryVersion: introduce isCompatibleWithCurrentCompilerVersion 2023-01-16 18:12:55 +01:00
Sergej Jaskiewicz 1539d7ef1a [klib] Bring package names in sync with the directory layout
Basically, some package names were Native-specific, whilst the packages
themselves were not Native-specific at all. This was already reflected
in the directory layout, but not in the package names.
This is fixed here.

NFC, just an automatic rename of packages with fixes of imports.
2022-12-01 21:46:43 +00:00
Leonid Startsev 471882b743 Introduce @DeprecatedVisitor; mark up visitor-related declarations with it.
Provide convenient JVM writing API.

Get rid of ExperimentalUnsignedTypes.
2022-11-10 13:30:09 +00:00
Anton Lakotka 1b3cc0dfaa [Gradle] Register watchosDeviceArm64 in commonizer
^KT-53107
2022-10-05 19:32:03 +00:00
Sergey Bogolepov 289f540530 [Commonizer] workaround for CoreGraphics from Xcode 14 2022-10-05 09:59:10 +00:00
Nikita Bobko 70ed76e0bd Drop unused ':dist' dependency in some tests
Review: https://jetbrains.team/p/kt/reviews/6753

This commit doesn't fix any issue except for "cleanup". If you find a
mistake in this commit feel free to revert part of it/the whole commit

I checked every module where I drop ':dist' dependency. Tests still pass
in those modules
2022-08-22 15:42:34 +02:00
Aurimas e2ac24cc90 Make sure to sort klib manifest data
Not sorting results in non reproducible output causing up-to-date check failures
2022-06-24 07:43:01 +00:00
sebastian.sellmair 204bc4ca95 [Commonizer] Provide union of forwardDeclarations as common dependencies
^KT-52050 Verification Pending

The issue described in KT-52050 happened, because forwardDeclarations
were not carried into next commonization steps. For commonization
it is fair to choose the union of all modules forwardDeclarations
as common dependency (instead of a union), since we can assume that
all those forward declarations will be provided.
2022-04-22 08:47:39 +00:00
Pavel Kirpichenkov 621f14c5bb [MPP] Improve creation of @UnsafeNumber w.r.t. non-aliased types and PIC
^KT-51643
2022-03-25 16:22:25 +00:00
sebastian.sellmair 25c5d99a0c [Commonizer] Separate nullability from type substitution
^KT-51686 Verification Pending
2022-03-25 09:06:12 +00:00
sebastian.sellmair a08fdcf371 [Commonizer] Substitute type arguments when argument type is ClassOrTypeAlias type
^KT-51686 Verification Pending
2022-03-25 09:06:11 +00:00
sebastian.sellmair 4e16e506bb [Commonizer] Test: Be more lenient on missing abbreviated type in reference
After commonization a type might additionally reference a abbreviated
type which is not present in the reference module's metadata.

This was even considered 'OK' before this commit, however only
under a special condition which might be too strict.

Right now, this newly introduced test will only enter the
newly allowed branch. This shall be re-reviewed later.

KT-51686
2022-03-25 09:06:11 +00:00
sebastian.sellmair 00d1d777d5 [Commonizer] Implement tests covering KT-51686 2022-03-25 09:06:11 +00:00
Pavel Kirpichenkov 9162faaf39 [MPP] Fix incorrect reuse of type argument commonizer
If the same NullableSingleInvocationCommonizer is reused for any reason,
it will store next inputs alongside previous, which is totally not
expected

^KT-51528 Fixed
2022-03-10 17:54:19 +03:00
sebastian.sellmair 14046b81ff Replace transitiveClosure (commonizer-api) with closure (tooling-core) 2022-03-09 13:17:06 +00:00
Pavel Kirpichenkov 1e925b5937 [MPP] Allow commonization of platform types in leaf targets
Costs little right now and is more robust for potential future uses of
platform types in native libraries or cinterops.

KT-41509
2022-02-28 10:59:44 +03:00
Pavel Kirpichenkov 867390b889 [MPP] Move integer names used by commonizer to its module
KT-41509
2022-02-28 10:59:42 +03:00
Pavel Kirpichenkov f257297505 [MPP] Commonize to platform integers considering target's bit width
Commonized type should match the platform's `platform.posix.ssize_t`
type alias' width. The implementation hard-codes platform widths for
all the targets, this can be potentially changed to search for ssize_t
in dependencies and get width from its type.

Use real targets in platform int commonization tests.

KT-41509
2022-02-28 10:59:38 +03:00
Pavel Kirpichenkov 8f4d04dad2 [MPP] Add preliminary version of platform integer commonizer
Doesn't take target's size_t alias into account just yet

KT-41509
2022-02-28 10:59:36 +03:00
Pavel Kirpichenkov b8ee473107 [Commonizer] Improve error messages for tests 2022-02-28 10:59:34 +03:00
Pavel Kirpichenkov 6674c3f482 [MPP] Apply @UnsafeNumber to functions and properties
KT-51224
KT-51215
2022-02-17 13:17:13 +03:00
Pavel Kirpichenkov a220624769 [Commonizer] move commonizer setting keys to the commonizer-cli module
Get rid of `OptionAlias` as unnecessary; keys will be used directly
2022-01-28 12:22:50 +03:00