Commit Graph

462 Commits

Author SHA1 Message Date
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
Pavel Kirpichenkov b17737d7de [Commonizer] minor: rename type commonizer options
Call it `context` to make more distinguishable from the global settings
2022-01-28 12:22:50 +03:00
Pavel Kirpichenkov 2609175d58 [Commonizer] Introduce commonizer settings
Add settings for a more fine-grained control over commonizer features
that will be added in the future

Add setting and KGP flag for optimistic number commonization

KT-51011
2022-01-28 12:22:50 +03:00
Anton Lakotka 49ba3d239c [Commonizer] Enable Optimistic Number Commonization by default
Initially it was restricted to work with type aliases only KT-48455
see test `test property with aliased number return type`

This limitation should be lifted now in order to fix KT-48568

^KT-48568 Verification Pending
2022-01-10 08:46:54 +00:00
Ilya Kirillov 49e9c47071 Move DynamicTypeDeserializer.id from IR module to common module
So, it can be used from cls-psi-stub-builder module
2021-12-27 16:23:06 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Starlight220 e77f72071d migrate KmValueParameter.type (KmType? -> lateinit KmType) 2021-10-26 18:21:38 +02:00
Dmitriy Novozhilov 9baf10cfcc [Build] Remove forgotten comment from build config 2021-10-12 17:26:33 +03:00
Pavel Kirpichenkov 5e874bc3c5 [Commonizer] Check errors in code of commonization tests 2021-10-11 13:00:40 +00:00
Dmitriy Novozhilov e933c7b6d9 [Build] Remove testApi(intellijDep()) dependencies from all modules
Since IDEA moved most of it's jars to java 11 it's illegal to use them
  in our dependencies, so all modules which use `intellijDep()` should
  carefully specify which jars they use
2021-09-30 14:41:31 +03:00
sebastian.sellmair a279f682bb [Commonizer] Add additional documentation to ClassOrTypeAliasTypeCommonizer
^KT-48288
2021-09-22 06:45:12 +00:00
sebastian.sellmair 6d17e4da57 [Commonizer] Implement disabled tests for ^KT-48288
^KT-48288
^KT-48850
2021-09-22 06:45:11 +00:00
sebastian.sellmair 104d2b347b [Commonizer] Minor: CirType: Use copyInterned over createInterned
^KT-48288
2021-09-22 06:45:11 +00:00
sebastian.sellmair 3b67bcbf4d [Commonizer] ClassOrTypeAliasTypeCommonizer: Remove faulty argument substitution
Underlying types from CirTypeAliasType do not require
parent argument replacement.

^KT-48288
2021-09-22 06:45:11 +00:00
sebastian.sellmair 7bf62ab159 [Commonizer] Implement tests for 'crossed' type aliases
^KT-48288
2021-09-22 06:45:10 +00:00
sebastian.sellmair 1fca19258d [Commonizer] ParameterizedTypesCommonizationTest: Remove unnecessary symbols
^KT-48288
2021-09-22 06:45:10 +00:00
sebastian.sellmair fa2577dda8 [Commonizer] Improve performance of deserialization
^KT-48288
2021-09-22 06:45:09 +00:00
sebastian.sellmair 16bf5f3df3 [Commonizer] Improve performance of ClassOrTypeAliasTypeCommonizer
Performance is improved by reducing calls to 'backwardsTypeDistance'

^KT-48288
2021-09-22 06:45:09 +00:00
sebastian.sellmair 64d2ba4029 [Commonizer] Improve performance of 'backwardsTypeDistance'
This commit also introduces common sealed interfaces to represent
classifiers and types coming form dependencies or 'sources'

^KT-48288
2021-09-22 06:45:09 +00:00
sebastian.sellmair fadb91fa35 [Commonizer] Rename CirCommonClassifierId to AssociatedClassifierIds
^KT-48288
2021-09-22 06:45:08 +00:00
sebastian.sellmair de1ae970d7 [Commonizer] ClassOrTypeAliasTypeCommonizer: Improve comments
^KT-48288
2021-09-22 06:45:08 +00:00
sebastian.sellmair 7485d2529b [Commonizer] Implement simple BackwardsTypeSubstitutionCommonizationTest
^KT-48288
2021-09-22 06:45:07 +00:00
sebastian.sellmair 38c7337b19 [Commonizer] Add tests to ParameterizedTypesCommonizationTest
^KT-48288
2021-09-22 06:45:07 +00:00
sebastian.sellmair e1bc6c54d7 [Commonizer] Simplify CirClassOrTypeAliasType.withParentArguments()
^KT-48288
2021-09-22 06:45:07 +00:00
sebastian.sellmair 459e01a729 [Commonizer] CirConversions: Ensure consistent function names
^KT-48288
2021-09-22 06:45:06 +00:00
sebastian.sellmair 892512cb67 [Commonizer] Remove unused/old typeAliasUtils
^KT-48288
2021-09-22 06:45:06 +00:00
sebastian.sellmair ba997905d9 [Commonizer] Remove CirClassType.visibility
^KT-48288
2021-09-22 06:45:05 +00:00
sebastian.sellmair da1eb5d96e [Commonizer] Implement CirTypeDistance.penalty
^KT-48288
2021-09-22 06:45:05 +00:00
sebastian.sellmair d0cd7c81ea [Commonizer] Minor: Change signature of CirConversions functions
^KT-48288
2021-09-22 06:45:05 +00:00
sebastian.sellmair 75d7c830e7 [Commonizer] Minor: Improve naming of methods and types
^KT-48288
2021-09-22 06:45:04 +00:00
sebastian.sellmair 808ea11072 [Commonizer] Improve access performance for TargetDependent
^KT-48288
2021-09-22 06:45:04 +00:00
sebastian.sellmair cf0f061db5 [Commonizer] Implement two phased re-approximation
^KT-48288
2021-09-22 06:45:03 +00:00
sebastian.sellmair b68f14960a [Commonizer] Implement first ReApproximationCirNodeTransformer
^KT-48288
2021-09-22 06:45:03 +00:00
sebastian.sellmair d2627f0a76 [Commonizer] CirCommonClassifierIdResolver: Implement caching as composition
^KT-48288
2021-09-22 06:45:03 +00:00
sebastian.sellmair 97befd0520 [Commonizer] Consider negative type distances 'worse'
^KT-48288
2021-09-22 06:45:02 +00:00
sebastian.sellmair 24680144da [Commonizer] CirTypeDistance: Ensure consistent function signatures
^KT-48288
2021-09-22 06:45:02 +00:00
sebastian.sellmair 24ac122e88 [Commonizer] CirTypeDistance: Use property for 'unreachable'
^KT-48288
2021-09-22 06:45:01 +00:00
sebastian.sellmair 31445d1471 [Commonizer] ClassOrTypeAliasTypeCommonizer: Use typeDistance and type substitution
^KT-48288
2021-09-22 06:45:01 +00:00
sebastian.sellmair 4a6366ed9b [Commonizer] TargetDependent: Implement inline map functions 2021-09-22 06:45:01 +00:00
sebastian.sellmair b424800714 [Commonizer] Implement additional 'ParameterizedTypesCommonizationTest'
^KT-48288
2021-09-22 06:45:00 +00:00
sebastian.sellmair 4349f98954 [Commonizer] Fix CirConversions and substitute arguments
CirConversions did not cover some potential convertible types.
ClassOrTypeAliasTypeCommonizer did not apply type substitution
for parameterized types coming from a dependency

^KT-48288
2021-09-22 06:45:00 +00:00
sebastian.sellmair e2343094ec [Commonizer] Adapt CirUnderscoredTypeAliasSubstitutorTest
^KT-48288
2021-09-22 06:44:59 +00:00
sebastian.sellmair 9d2553bd18 [Commonizer] Adapt TypeCommonizerTest
^KT-48288
2021-09-22 06:44:59 +00:00