Commit Graph

68 Commits

Author SHA1 Message Date
Kevin Most 4f26ac9a04 Fix "Koltin" typos throughout codebase (#3383)
* Fix "Koltin" typos throughout codebase

* Update K2MetadataKlibSerializer.kt
2020-05-20 15:12:32 +03:00
Ilya Matveev 5287ffb4a5 [Native] Don't use konan.home to determine a path to the K/N dist
A fix for KT-37550 requires us to stop using system properties when
the compiler is started from Gradle. This patch stops reading the
konan.home property to determine a path to the compiler and requires
this path to be explicitly specified in a constructor of the
Distribution class.

Issue #KT-37550
2020-05-19 18:57:39 +07:00
Konstantin Tskhovrebov 912fd556e5 Fix commonizer: merge klib manifest dependencies during commonization. 2020-05-15 18:27:13 +03:00
Dmitriy Dolovov ac1e96500a [Commonizer] Added README.md 2020-05-14 17:35:16 +07:00
Alexander Udalov ea413cefb4 Remove TypeOfChecker for JVM frontend
This is needed to support typeOf with non-reified type parameters.

 #KT-30279
2020-05-13 10:04:26 +02:00
Dmitriy Dolovov e92adf3d4e [Commonizer] Don't preserve annotations on types
This may lead to leakage of specific annotation classes to common module

^KMM-53
2020-05-08 23:52:24 +07:00
Dmitriy Dolovov 5bb5d7f892 [Commonizer] Limited annotation commonization. Tests
^KMM-238
^KMM-53
2020-05-08 23:52:17 +07:00
Dmitriy Dolovov 600daaa320 [Commonizer] Reformat tests 2020-05-08 23:52:10 +07:00
Dmitriy Dolovov 413e6552ef [Commonizer] Simplify creation of individual commonizers 2020-05-08 23:52:04 +07:00
Dmitriy Dolovov 735387b685 [Commonizer] Limited annotation commonization (@Deprecated for functions)
^KMM-238
^KMM-53
2020-05-08 23:51:58 +07:00
Dmitriy Dolovov be04fbd5bb [Commonizer] More accurate verification of annotations in tests 2020-05-08 23:51:52 +07:00
Dmitriy Dolovov ae570e4acf [Commonizer] Don't filter out @Deprecated non-top-level functions
^KMM-238
2020-05-08 23:51:46 +07:00
Dmitriy Dolovov b1bef8485d [Commonizer] Capitalize messages to be printed at console 2020-04-29 12:11:50 +07:00
Dmitriy Dolovov 0f6dbed03b [Commonizer] Don't fail when one of targets is not supported at the host
^KMM-214
2020-04-29 12:11:44 +07:00
Nikolay Krasko 4230a17427 Revert "Force bootstrap stdlib in modules that used in composite build"
This reverts commit ad76562c
2020-04-27 15:58:38 +03:00
Nikolay Krasko ad76562cbc Force bootstrap stdlib in modules that used in composite build 2020-04-27 15:36:49 +03:00
Denis Zharkov 45481b214a Use kotlin.Throws in NativeThrowsChecker
KT-35468
2020-04-26 23:08:45 +03:00
Dmitriy Dolovov a6064ecda6 [Commonizer] Generate correct TA types for callable descriptors
Issue #KMM-217
2020-04-17 23:08:01 +07:00
LepilkinaElena 4f9364f997 Native specific frontend checker for @ThreadLocal (#3293) 2020-04-16 15:23:06 +03:00
Dmitriy Dolovov 101442ad14 KLIB: Store native targets in manifest 2020-04-10 19:33:27 +07:00
Alexey Tsvetkov 1c38466a22 Pass LookupTracker to deserialized scopes in JS KLIB compiler
Before this change, deserialized scopes were not tracking lookups properly,
because lookup tracker was not passed from compiler configuration correctly.
Because of that, lookups from dependencies were not tracked,
so multi-module IC was not working (chages were passed between modules,
but affected source files were not invalidated).
2020-04-10 05:35:45 +03:00
Ilya Matveev ba6ca67e4f [Commonizer] Support short library names 2020-04-09 13:07:43 +07:00
Dmitriy Dolovov a2e2213d31 Keep KonanTarget.predefinedTargets as Map<String, KonanTarget> 2020-04-01 23:10:47 +07:00
Dmitriy Dolovov 5411b85cb9 Minor. Rename isKonanStdlib() into isNativeStdlib() 2020-04-01 11:47:10 +07:00
Dmitriy Dolovov 31a1f8ff4b Include :native:kotlin-native-utils into kotlin-compiler.jar 2020-04-01 11:46:55 +07:00
Ilya Matveev 172a45a637 Gradle, native: Fix building platform libraries for MIPS
The sysroot for linux_mips doesn't contain one of platform
libs available for Linux (zlib). So we need to put def-files
to the K/N distribution on a per-target basis instead of putting
a single set of def-files for all targets of the same OS.

Corresponding change in the K/N repository:
https://github.com/JetBrains/kotlin-native/pull/4023

This patch take this change into account at the Gradle plugin side.
2020-03-30 17:31:12 +07:00
Alexander Udalov 9e014e462b Do not use CommonPlatforms directly in CommonResolverForModuleFactory
This allows to get rid of dependency of this code on CommonPlatforms,
which depends on all platforms (JVM, JS, Native), and eventually move it
to 'frontend'.
2020-03-28 21:30:03 +01:00
Dmitriy Dolovov c23a11a6fc Refactoring: Clean-up usage of KlibMetadataFactories 2020-03-27 13:12:01 +07:00
Dmitriy Dolovov 36988cf15c Refactoring: Keep predefined K/N targets inside of KonanTarget.Companion 2020-03-27 13:11:46 +07:00
Dmitriy Dolovov 7a19558d54 Refactoring: Put KonanTarget & related classes into separate .kt files 2020-03-27 13:11:35 +07:00
Ilya Matveev 27f5c577c9 Gradle, native: Generate platform libraries at the user side
Since 1.4, a regular K/N distribution will not contain prebuilt
platform libraries, so the libraries must be generated at the
user side.

This patch adds support for such generation to the MPP Gradle
plugin. The generation itself is performed by separate utility
provided by the K/N compiler distribution. The plugin checks
existence of platform libraries for required targets and starts
this utility if some some of these libraries are missing. Building
caches for platform libraries is also performed at this step.

The patch also adds some project properties allowing a user to
workaround potential problems. User will be able to:
  - Use a special distribution with prebuilt platform libraries.
  - Force building platform libraries in the good old sourcecode mode
    in case of some issues with the new metadata mode.

Kotlin/Native counterpart: https://github.com/JetBrains/kotlin-native/pull/3829.

Issue #KT-32931 Fixed
2020-03-24 18:54:11 +07:00
Sergey Bogolepov e919e7b79a [Gradle][Native][Cache] Don't skip metadata-based interop libraries
`resolveSingleFileKlib` by default doesn't support klibs with
non-default ir providers. In case of cache generation for native interop
libraries we need to override this behavior because they have
ir_provider=kotlin.native.cinterop.
2020-03-12 18:11:47 +07:00
Dmitriy Dolovov ed96b81a42 [Commonzer] Fix ISE during commonization, improve interner performance
Issue #MMPP-191
2020-03-06 21:44:58 +07:00
LepilkinaElena 61f5523805 Added Native-specific checker for properties of top level singletons (#3172) 2020-03-06 14:58:09 +03:00
Dmitry Savvinov b8b1dd753c Add builtins_platform property to klib manifest 2020-03-05 17:27:38 +03:00
Kirill Shmakov 03c6f13831 Add fallback value in K/N version computation 2020-03-05 08:35:34 +03:00
LepilkinaElena b031706ea9 Added Native-specific frontend checker for @SharedImmutable (#3091) 2020-03-04 16:45:37 +03:00
Roman Artemev bb43a66716 [Metadata] Add platform dependent type transformer
- Fix forward declaration type construction
2020-02-26 14:55:54 +03:00
Roman Artemev 25a91a217e [KLIB] Fix package for NullFlexibleTypeDeserializer 2020-02-26 14:55:53 +03:00
Dmitriy Dolovov f2b940ffd4 [Commonizer] Apply interner to avoid duplicated CirValueParameterImpl objects 2020-02-18 22:03:55 +07:00
Dmitriy Dolovov 5663dfb772 [Commonizer] Apply interner to avoid duplicated CirSetter objects 2020-02-18 22:03:49 +07:00
Dmitriy Dolovov e54640ddad [Commonizer] Apply interner to avoid duplicated CirGetter objects 2020-02-18 22:03:41 +07:00
Dmitriy Dolovov 39125a75e7 [Commonizer] Apply interner to avoid duplicated CirAnnotation objects 2020-02-18 22:03:35 +07:00
Dmitriy Dolovov c88ea2f2e6 [Commonizer] Apply interner to avoid duplicated CirSimpleType objects 2020-02-18 22:03:16 +07:00
Dmitriy Dolovov 84bc151cb3 Minor. Add toString() to CommonizedClassDescriptor.CommonizedClassTypeConstructor 2020-02-18 22:03:10 +07:00
Dmitriy Dolovov d0e9dc05b5 [Commonizer] Apply interner to avoid duplicated Name objects 2020-02-18 22:03:03 +07:00
Dmitriy Dolovov 47d091702b [Commonizer] Apply interner to avoid duplicated FqName objects 2020-02-18 22:02:57 +07:00
Dmitriy Dolovov adc5a55d65 [Commonizer] Apply interner to avoid duplicated String objects 2020-02-18 22:02:50 +07:00
Dmitriy Dolovov 667e96f971 [Commonizer] Don't keep references to descriptor objects when they are not needed anymore
This is necessary to reduce overall memory consumption.
2020-02-18 22:02:44 +07:00
Dmitriy Dolovov 9a8a1113db [Commonizer] Don't commonize deprecated functions
1. All functions marked with @Deprecated from Kotlin/Native platform libraries
have DeprecationLevel.ERROR, and therefore practically can not be used by
a developer in their code. So, it does not make sence to keep such
declarations in commonized libraries.

2. Commonization of such functions would also require commonization of
annotations with nested annotations as const values (ex:
@Deprecated(level = DeprecationLevel.ERROR), where both @Deprecated
and DeprecationLevel are annotation classes). This is not implemented yet.
2020-02-18 22:02:38 +07:00