Commit Graph

97918 Commits

Author SHA1 Message Date
Anton Lakotka 504ee1fbb1 [Gradle] Enhance LazyResolvedConfiguration API
* Add configurationName and provide `toString()` implementation for
  better debugging experience;
* Update `dependencyArtifacts` and `moduleArtifacts` API to work in the
  same way as original Gradle's counterparts
* Add helper extension functions `allResolvedDependencies`
  and `dependencyArtifactsOrNull` for better developer experience

^KT-49933
2023-01-20 20:15:18 +00:00
Anton Lakotka bf8ef74b37 [Gradle] Rename ResolvedDependencyGraph to LazyResolvedConfiguration
This give better understanding of the purpose of the class

^KT-49933
2023-01-20 20:15:18 +00:00
Anton Lakotka 396ed3642e [Gradle] Pass only parent's visible source sets instead of entire...
...GranularMetadataTransformation object

^KT-49933
2023-01-20 20:15:18 +00:00
Ilya Chernikov 7ec72b568d Fix assertion in light tree diagnostic reporter
happened then two diagnostics are reported on the same element.
#KT-55924 fixed
2023-01-20 17:57:15 +00:00
Pavel Kirpichenkov 3b9aac067a Mark API for direct access to declared project properties with opt-in
KT-55891
2023-01-20 17:42:52 +00:00
Pavel Kirpichenkov 26e160d4ce [MPP] Add a flag to disable warnings about deprecated HMPP properties
KT-55891
2023-01-20 17:42:52 +00:00
Pavel Kirpichenkov ec5f56584c [MPP] Report deprecation warnings for HMPP-related Gradle properties
KT-55891
2023-01-20 17:42:51 +00:00
Ilya Goncharov 4e13b7a202 [Gradle, JS] Add nullable custom fields
^KT-42395 fixed
2023-01-20 17:40:05 +00:00
Troels Bjerre Lund 7854b01473 [K/N] custom-alloc: handle finalizers
This commit adds finalizers to the custom allocator. Compared to the
existing solution:

* The finalizer queue is replaced by an AtomicStack<ExtraObjectData>.
* All objects with finalizers get meta objects attached. This was not
  previously the case for CleanerImpl, but is now needed to link objects
  together in the finalization queue.
* The finalizer queue is built during SweepExtraObjects, instead of
  during regular sweeping.
* Cleaners are executed by the finalizer thread, and no longer by a
  separate worker thread.

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

Merge-request: KOTLIN-MR-592
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-01-20 16:47:06 +00:00
Sergey Bogolepov 5bd405856f [IR] Pass input value to AbstractNamedCompilerPhase.runAfter
It is needed for the K/N dynamic compiler driver where phase input
might be required for actions performed after its execution.
2023-01-20 13:33:07 +00:00
Sergey Bogolepov c22285f824 [IR] Remove unused Ir.irModule property
It is required for the Native backend refactoring
where `Context` does not contain a reference for any
particular IrModuleFragment.
2023-01-20 13:33:06 +00:00
Sergey Bogolepov 3355f04fa1 [IR] Drop all usages of Ir.irModule 2023-01-20 13:33:06 +00:00
Yahor Berdnikau a90664574c Fix jvm target validation does not work for MPP JVM withJava target
Related KotlinCompile to JavaCompile wiring is happening on
KotlinJvmTarget initialization before 'withJava' configuration runs. At
that point linked JavaCompile task is null. Fix delays wiring to
execution phase when such task should be available.

^KT-55119 Fixed
2023-01-20 13:13:58 +00:00
Sergej Jaskiewicz 1f76d39e66 [IR] Make IrTypeArgument a sealed interface 2023-01-20 10:58:28 +00:00
Yahor Berdnikau c65b689fa0 Provide approximate stacktrace to freeCompilerArgs modification
Will help users to understand where exactly 'kotlinOptions
.freeCompilerArgs' were modified on execution phase.

^KT-55544 Fixed
2023-01-20 10:01:04 +00:00
Nikolay Lunyak ff96033e95 [FIR] KT-55666: Support labels to local functions
^KT-55666 Fixed
2023-01-20 08:09:08 +00:00
Ilya Goncharov f4cda71d9e [Gradle, JS] Add possibility to not add js compiler attribute on publish 2023-01-19 22:11:01 +00:00
Dmitrii Gridin 4fa338ccf4 [LC] skip some tests in IDE 2023-01-19 19:25:04 +00:00
Pavel Kunyavskiy 0560b2b068 [K/N] Don't generate initializer function when it is empty 2023-01-19 16:41:47 +00:00
Ilmir Usmanov 945cdc8884 Minor. Ignore tests in JS_IR_ES6, regenerate tests 2023-01-19 17:04:31 +01:00
Nikolay Krasko 7fa45e8af9 Add information to verification metadata about libraries used during publication to sonatype 2023-01-19 15:07:28 +00:00
Ilya Goncharov d7c31f79a8 Do not suppress NPM related tasks, but be aware about checking of them in task graph 2023-01-19 13:43:57 +00:00
Nikita Bobko 887547c445 Drop MetadataComparisonTest & drop build-tools -> util-klib dependency
Review: https://jetbrains.team/p/kt/reviews/8360

MetadataComparisonTest was the only one in build-tools module who
depended on util-klib, that's why we can drop build-tools -> util-klib
dependency

MetadataComparisonTest is no longer needed, that's why we can drop it.

The dependency drop is a one step forward in dropping
`kotlin.srcDir("../compiler/util-klib/src")` line in
`buildSrc/build.gradle.kts`. Adding source roots in `buildSrc` is hacky
and can lead to frustrations (e.g. KT-55874). That's why it's desirable
to drop buildSrc -> util-klib hacky dependency.

Unfortunatelly, I couldn't drop buildSrc -> util-klib dependency,
because:
1. buildSrc depends on kotlin-native/shared/src/library/kotlin +
   buildSrc depends on kotlin-native/tools/kotlin-native-gradle-plugin +
   maybe smth else
2. kotlin-native/shared/src/library/kotlin depends on util-klib +
   kotlin-native/tools/kotlin-native-gradle-plugin depends on util-klib +
   maybe smth else
2023-01-19 12:55:56 +00:00
Anna Kozlova 07525fef51 [AA] extract source psi from delegated wrapper when exists 2023-01-19 11:38:32 +00:00
hungvietnguyen f172c50f27 New IC: Ignore LookupSymbols that refer to file facades (#5069)
A LookupSymbol should only refer to either a class, a class member, or a
package member.

When a LookupSymbol refers to a file facade (e.g.,
LookupSymbol(name="FooKt", scope="com.example")), it is redundant as it
doesn't impact the IC analysis to find files to recompile.

Previously, the new IC (ClasspathChangesComputer) would fail when
detecting that IncrementalJvmCache reported these redundant
LookupSymbols. With this change, the new IC will just ignore them.

Note: A better approach would be to fix IncrementalJvmCache to not
report these LookupSymbols, but it will require some significant
cleanup/refactoring work, so we can consider it later.

Test: New KotlinOnlyClasspathChangesComputerTest.testRenameFileFacade
^KT-55021 Fixed
2023-01-19 12:21:29 +01:00
Leonid Startsev dc0cd61b6f Handle @Serializable classes that implement interfaces by delegation
by filtering out delegated properties that end up in irClass.properties() list

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/2157
2023-01-19 11:12:31 +00:00
Denis.Zharkov 490970e65e Adjust KotlinJavaPsiFacade::knownClassNamesInPackage for empty scope
The method must return an empty set in that case, instead of null
that would mean we can't compute it.

The problem was found when running FirLoadCompiledKotlinGenerated
2023-01-19 10:57:44 +00:00
Denis.Zharkov 9c988fd8d8 K2: Introduce FirCachingCompositeSymbolProvider
The main idea is pre-computing the sets of names that might be
met there, that helps to decrease the sizes of the backing maps
(by avoiding irrelevant keys)

Totally, this branch with previous commits speeds up MT Full Kotlin
approximately on 3 seconds (~5%)
2023-01-19 10:57:43 +00:00
Denis.Zharkov 6705d211a6 K2: Get rid of FirDependenciesSymbolProviderImpl
Its usages will be safely replaced
with FirCachingCompositeSymbolProvider

But here, in the commit plain FirCompositeSymbolProvider used temporary
2023-01-19 10:57:43 +00:00
Denis.Zharkov 9302fe3cb5 K2: Get rid of redundant FirDependenciesSymbolProvider class 2023-01-19 10:57:42 +00:00
Denis.Zharkov dab50daf56 K2: Add ability identify DI components by string key instead of KClass
It allows having several the same typed-component in the container
2023-01-19 10:57:42 +00:00
Denis.Zharkov 58c1b5dd1f K2: Optimize AbstractFirDeserializedSymbolProvider
Avoid filling caches with keys that are definitely empty
(if it's cheap to compute that), to decrease the size of backing maps.

The strategy is pre-computing the sets of names that might be met.
NB: the size of the sets is way fewer than a size of all queried names.
2023-01-19 10:57:42 +00:00
Dmitrii Gridin e2e87bd107 [FIR] CustomAnnotationTypeAttribute: drop redundant type specification
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:05 +00:00
Dmitrii Gridin a49b72b05e [AA] update testData
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:05 +00:00
Dmitrii Gridin 0420be603f [FIR] ScopeClassDeclaration: introduce new property to avoid container clash
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:04 +00:00
Dmitrii Gridin 6635ec33d9 [AA] KtTypeInfoProvider: update kdoc
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:04 +00:00
Dmitrii Gridin 7f24a38997 [FIR] FirTypeResolveTransformer: support lazy type annotations for all declarations
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:04 +00:00
Dmitrii Gridin 73cdaf5c3c [FIR] CustomAnnotationTypeAttribute: support type aliases
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:03 +00:00
Dmitrii Gridin 0e2967e520 [FIR] FirTypeResolveTransformer: avoid super call
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:03 +00:00
Dmitrii Gridin 09a77d261d [AA] KtTypeInfoProvider: introduce fullyExpandedType extension
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:03 +00:00
Dmitrii Gridin 8ce4c4eba9 [FIR] CustomAnnotationTypeAttribute: store fir symbol instead of declaration
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:02 +00:00
Dmitrii Gridin 9d42a5cb01 [FIR] provide containerDeclaration to CustomAnnotationTypeAttribute for lazy resolve
tested by FirIdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated.testTypeAnnotations

^KTIJ-23547 Fixed
^KTIJ-24141 Fixed
2023-01-19 10:53:02 +00:00
Dmitrii Gridin f32483000a [AA FIR] KtFirAnnotationListForDeclaration: avoid resolve on creation 2023-01-19 10:53:02 +00:00
Ilya Goncharov 843805d771 [Gradle, JS] Update detecting of platform and architecture
[Gradle, JS] Make hash codes compatible with previous kotlin

^KT-38015 fixed
^KT-48631 fixed
^KT-43305 fixed
2023-01-19 10:23:09 +00:00
Denis.Zharkov b1bb7dd25f K1: Fix regression with callable references as last statements in lambda
^KT-55729 Fixed
2023-01-19 10:00:02 +00:00
Denis.Zharkov a37e3def14 Add test for KT-55931 2023-01-19 10:00:02 +00:00
Ilmir Usmanov d18672bfb1 Wrap continuation with ContinuationImpl on callable references
in startCoroutineUninterceptedOrReturn. Otherwise, the coroutine will
not be interceptable later.

Add a test, which checks, that intercepted continuation is released.

 #KT-55869
2023-01-19 00:35:36 +00:00
Alexander Shabalin 9a2cb2609f [K/N] Extract LlvmLink out of CompileToBitcode ^KT-53776
Merge-request: KT-MR-8120
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-01-18 21:41:17 +00:00
Sergey Bogolepov 8e37a07af2 [K/N] Show warning when compiling for a deprecated target 2023-01-18 16:17:13 +00:00
Sergey Bogolepov 955479752e [K/N] Mention deprecation in -list-targets flag 2023-01-18 16:17:13 +00:00