Commit Graph

91822 Commits

Author SHA1 Message Date
Ilya Chernikov 3ad0e2aff5 Fix lambda detection in fir2ir for LT case 2022-03-30 08:30:16 +00:00
Ilya Chernikov cf22400701 Introduce LT file abstraction in tests parallel to KtFile
allows to create a valid LT-based file with synthetic path important
for dumps comparisons in tests
2022-03-30 08:30:09 +00:00
Ilya Chernikov 20c50c6484 [minor] Pass minimally valid offsets on non-PSI ir file entry creation
allows to use e.g. `dumpTreesFromLineNumber` in tests on such files
without assertions
2022-03-30 08:30:02 +00:00
Ilya Chernikov 4b92d50775 FIR: Implement and use component to map lighttree-based sources to files 2022-03-30 08:29:54 +00:00
Ilya Chernikov 12d49c2cd8 FIR: new cli pipeline with LightTree support 2022-03-30 08:29:47 +00:00
Pavel Kunyavskiy 7ba4d9e1f0 Rework nullability in IR 2022-03-30 06:27:59 +00:00
Ilya Gorbunov 000165b12b Fix incorrect conversion of Long to String in base 36 in JS KT-48924 2022-03-30 06:13:51 +00:00
simon.ogorodnik 03bb482322 KT-45553. Hide declaration from star import if imported with alias 2022-03-29 23:38:42 +00:00
Svyatoslav Scherbina 8bb178e4a7 Native: ignore delegatedProperty/provideDelegate/kt39588.kt box test
It performs unchecked cast from `String` to `List<Any>`, which
legitimately fails when global optimizations are enabled.

^KT-48749 Declined
2022-03-29 13:27:44 +00:00
Dmitriy Novozhilov f24a8db6b8 Advance bootstrap to 1.7.0-dev-3025 2022-03-29 12:57:16 +00:00
Sergey Bogolepov 027c51653d [K/N] Fix -Ptest_compile_only for iosArm64 target
We don't need to configure Xcode or disable some tests when running
tests in compile-only mode.
2022-03-29 12:25:22 +00:00
Dmitriy Dolovov 0bc6885b2c [Native][tests] W/A: Generate test suites for included KLIB with tests
Relates to KT-51375
2022-03-29 14:55:57 +03:00
Sergey Bogolepov f635e450df [K/N] Add trivial test for RemoveRedundantSafepoints phase 2022-03-29 11:52:26 +00:00
Sergey Bogolepov f90a56c131 [K/N] Introduce RemoveRedundantSafepointsPass
Since we do not inline Kotlin_mm_* functions on watchos_arm32 and
ios_arm32 targets, there are a lot of unnecessary subsequent safepoints.
To reduce binary size and avoid unnecessary safepoints we apply a simple
optimization: remove all calls to Kotlin_mm_safePointFunctionPrologue in
a basic block except the first one.

^KT-51737 fixed.
2022-03-29 11:52:25 +00:00
Hung Nguyen bd8f49c5d6 KT-45777: Count cache misses when loading classpath snapshot
to get more insights into the build performance of that step.

^KT-45777 In Progress
2022-03-29 11:36:41 +00:00
Hung Nguyen f23e66a6e2 KT-45777: Replace EmptyICReporter with DoNothingICReporter
to be more consistent (every *Reporter has a DoNothing*Reporter).

^KT-45777 In Progress
2022-03-29 11:36:41 +00:00
Hung Nguyen d70dbf3146 KT-45777: Add debug log messages for classpath snapshot feature
Also clean up classpath snapshot shrinking a bit to make it clearer.

^KT-45777 In Progress
2022-03-29 11:36:40 +00:00
Hung Nguyen 1d1c6d5e0b KT-45777: Change classpath-snapshot directory location
Incremental states for Kotlin compilation are stored inside the
`<project>/build/kotlin/<task-name>` directory. Previously, that
directory was @LocalState, so we had to keep the `classpath-snapshot`
@OutputDirectory outside it.

Now, that directory has been made a parent containing @OutputDirectory's
@LocalState's, so we can safely move the `classpath-snapshot` directory
to it.

Test: Existing tests should pass (location change has no functional impact)

^KT-45777 In Progress
2022-03-29 11:36:39 +00:00
Artem Kobzar ba37851490 fix: external declarations in implicit export. 2022-03-29 10:07:25 +00:00
Sergey Bogolepov 30006b5143 [K/N] Add CMakeLists.txt to simplify work with libllvmext
Also moved functions that have nothing to do with code coverage
into a separate file.
2022-03-29 09:42:46 +00:00
Sergey Bogolepov 7dc48b3837 [K/N] Rename llvmCoverageMappingC to libllvmext
This subproject covers much wider scope now than code coverage,
so it makes sense to rename it to reflex that.
2022-03-29 09:42:45 +00:00
Sergey Bogolepov d7386dc315 [K/N] enable RuntimeLinkageStrategy.LinkAndOptimize for debug by default 2022-03-29 09:40:03 +00:00
Sergey Bogolepov 3723e2af52 [K/N] Allow to optimize runtime bitcode separately
Since runtime is split into several LLVM modules there is no LTO
optimizations between them during debug compilation because the latter
performs almost no optimizations to preserve debug info.
Of course, it affects runtime performance of debug binaries. To improve
it, we can link and aggressively optimize runtime modules and then link
optimized module into unoptimized Kotlin LLVM module.
This commit also introduces `linkRuntime` binary option that forces the
way we link runtime modules.
2022-03-29 09:40:02 +00:00
Sergej Jaskiewicz e0dcb0975a [JS IR] Enable line number tests for JS IR 2022-03-28 21:47:43 +00:00
Sergej Jaskiewicz dc9652e9ce [JS] Migrate the line number tests to the new testing infrastructure 2022-03-28 21:47:42 +00:00
Dmitriy Novozhilov 60eff871dc [FE] Make message of SAFE_CALL_WILL_CHANGE_NULLABILITY warning more clear
^KT-46860
2022-03-28 12:37:26 +00:00
Dmitriy Novozhilov 078acb1bfe [FE] Fix positioning strategy for SAFE_CALL_WILL_CHANGE_NULLABILITY warning
^KT-46860
2022-03-28 12:37:25 +00:00
Dmitriy Novozhilov 565c61a702 [FE 1.0] Fix false-negative INVALID_IF_AS_EXPRESSION_WARNING and NO_ELSE_IN_WHEN_WARNING
^KT-51711 Fixed
2022-03-28 12:37:24 +00:00
Ilya Goncharov c67c1a69b9 rra/ilgonmic/reducing-size
[JS IR] Fix review remarks

- Fix translation mode from flags calculation
- comment why not top level could be safely inlined

[JS IR] Add test on exportness of internal val

Revert "[Gradle, JS] Disable minimizing names in production by default"

This reverts commit 700ff8634a73f155a2f0eaf963778216d6877075.

[JS IR] Adopt reserved names

Revert "[JS IR] Reserve interop names"

This reverts commit 63f30becaf1a45750ff85aea3753aae9a85985f4.

Revert "[JS IR] Clear minimized namer states"

This reverts commit ef7f19fa8a928021e8bdfbee7fbb5285fc74b7ab.

[JS IR] Clear minimized namer states

[JS IR] Reserve interop names

[JS IR] Separate arguments for users

[JS IR] Minimized member names in tests

[Gradle, JS] Disable minimizing names in production by default

[JS IR] Fix extra helps

[JS IR] Move mangling of signatures to linking namer

[JS IR] Add key and minimized name generator

[JS IR] cross module dependencies minimized

[JS IR] Minimize names

[JS IR] Cross module by index

[JS IR] Fix warning

[JS IR] Fix inlining accessors

[JS IR] Bridges for property accessors

[JS IR] Special case of jsFunctionSignature with property accessors

[JS IR] Inline property accessor for non top level properties

[JS IR] Reduce crossModule size

Merge-request: KT-MR-5785
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51735 fixed
^KT-50504 fixed
2022-03-28 10:39:15 +00:00
Svyatoslav Scherbina cf581738c3 Native: improve ClassCastException message for local classes
Previously it was like "null cannot be cast to MyObject" or
"MyObject cannot be cast to null", because `KClass.qualifiedName` is
`null` for local classes (including anonymous ones).

Use `KClass.toString()` instead, for both object actual dynamic type
and cast target type. This string representation is generally more
meaningful for such cases, and contains useful details for local
classes.
2022-03-28 08:21:55 +00:00
Anton Lakotka 5c612078e5 [Gradle] Fix compileCommonMainKotlinMetadata task circular dependency
It's getRefinesMetadataPaths should not include its own metadata Paths
So it should use `refinesClosure` instead.

Was introduced by refactoring changes in:
1a5fc84080
2022-03-28 07:00:30 +00:00
Rustam 6117eace9d Remove redundant MetaSerializable test (#4772)
This test is a leftover from the original implementation of #4583 which was updated. This test is redundant now.
2022-03-27 15:32:25 +03:00
Udi Cohen c9d2f40b95 Rename params show/dumpProcessorTimings to show/dumpProcessorStats
^KT-51132 Fixed
2022-03-25 18:54:02 +00:00
Udi Cohen eb3b9f148d Support dumping stats for number of generated sources by annotation processors
^KT-51132 In Progress
2022-03-25 18:54:02 +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
Rustam e09f30f442 kotlinx.serialization: Support @MetaSerializable (#4583) 2022-03-25 19:07:42 +03: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
Anton Lakotka f5c05c1a52 [Gradle][KPM] Add kotlinToolingMetadataOfMainModule for tests 2022-03-25 00:04:30 +01:00
Anton Lakotka 1aac53d544 [Gradle] Add BuildKotlinToolingMetadataTest for KPM 2022-03-25 00:04:30 +01:00
Anton Lakotka 2e327f1367 [Kotlin] Add multi-module test for tooling metadata
^KT-49704
2022-03-25 00:04:30 +01:00
Anton Lakotka 7af5a93767 [Gradle][KPM] Create BuiltKotlinMetadata task per KPM Module
Use main module for tests

KT-49704
2022-03-25 00:04:29 +01:00
Anton Lakotka b579bf20cf [Gradle] Fix code review comments
KT-49704
2022-03-25 00:04:29 +01:00
Anton Lakotka a2a414ace4 [Gradle] Include kotlin-tooling-metadata in KPM module publication
KT-49704
2022-03-25 00:04:29 +01:00
Anton Lakotka ac8e7606a2 [Gradle] Map KPM model to Build Tooling Metadata v1.1.0
Update buildKotlinToolingMetadata gradle task

KT-49704
2022-03-25 00:04:25 +01:00
Anton Lakotka 2dc774c1fe Build Tooling Metadata 1.1.0: Add isKPMEnabled flag
Build Tooling Metadata now can carry information whether project
built with Kotlin Project Model or not.

KT-49704
2022-03-25 00:03:04 +01:00
Yahor Berdnikau 5f1977083d Restore "Rename 'classpath' input into 'libraries'"
This reverts commit 47a9fb725e.
2022-03-24 19:02:58 +01:00
Yahor Berdnikau 0d18703c25 Restore "Simplify scripting configurations setup"
This reverts commit 46d3f96f0b.
2022-03-24 19:02:58 +01:00