Commit Graph

99029 Commits

Author SHA1 Message Date
Vladimir Sukharev 93baad5f39 Add KotlinTestK2LibraryTest to new test infra
Merge-request: KT-MR-8766
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-11 13:58:08 +00:00
Svyatoslav Scherbina b19058caef K2/Native: support cinterop forward declarations
Support importing synthetic declarations from "magic" forward
declaration packages:
- cnames.structs
- objcnames.classes
- objcnames.protocols

So this is a rough equivalent to the forward declarations module
made of ForwardDeclarationsPackageFragmentDescriptor in K1.

Unlike K1 implementation, this K2 one doesn't allow importing
a declaration that wasn't actually forward-declared in a C/Objective-C
header available through a cinterop klib dependency.
2023-02-10 20:17:05 +00:00
Sebastian Sellmair 1936efed11 [MPP] NativeDistributionCommonizerLock: Support classpath isolation
^KT-56510 Verification Pending
2023-02-10 18:55:28 +00:00
Sebastian Sellmair ec67131d82 [MPP] Implement NativeDistributionCommonizerLockTest for isolated class loaders
KT-56510
2023-02-10 18:55:28 +00:00
Vladimir Sukharev 7bce6d21f0 Disable in K2 tests that fail for two-stage
Merge-request: KT-MR-8786
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-10 16:59:25 +00:00
Nikolay Lunyak a9343aeb7d [FIR] KT-55840: Ensure everything actually works
This inconsistency is present due to not using the `// WITH_STDLIB`
in the above tests. When K1 creates the enum, it tries to generate
`entries()`, and for that it tries to load `kotlin.enums.EnumEntries`,
but this is actually an unresolved reference. K1 silently swallows it,
and proceeds.

The reason K2 doesn't fail is that in order to generate `entries()` it
simply creates the necessary `ConeClassLikeType` with the desired
`classId` instead of loading the whole `ClassDescriptor`.

The reason we can still observe `$ENTRIES` and `$entries` in K1
is because they are generated during the JVM codegen, and it
only checks if the `EnumEntries` language feature is supported. It
doesn't check if the `entries` property has really existed in IR
(by this time it's expected to have already been lowered to the
`get-entries` function - that's why "has ... existed").

The reason why the codegen doesn't fail when working with
`kotlin.enums.EnumEntries` is because it creates its
own `IrClassSymbol`.

^KT-55840 Fixed

Merge-request: KT-MR-8727
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-02-10 16:57:51 +00:00
Stanislav Erokhin 57eae167cc Restore FunctionClassKind for compatibility with Android IDEA plugin 2023-02-10 16:01:05 +00:00
Stanislav Erokhin bec9ad0f6b Minor. Rename FunctionClassDescriptor#functionKind -> functionTypeKind
This commit is needed for the following commit.
There we will restore the compatibility API with Android IDEA plugin
2023-02-10 16:01:04 +00:00
Igor Chevdar a14f3c8cc2 [K/N] Fixed wrong initializer call extraction for interop-visible functions
#KT-56521 Fixed
2023-02-10 15:45:11 +00:00
Igor Chevdar 2281d9700d [K/N] Added a test for #KT-56521 2023-02-10 15:45:10 +00:00
Anna Kozlova a71a94add7 [LL] avoid dbl service registration 2023-02-10 13:20:02 +00:00
Pavel Kunyavskiy c400a75407 [K/N] Fix tests failing because of phase renaming 2023-02-10 12:58:22 +00:00
Dmitriy Novozhilov f3fd4b3e01 [FIR] Add stack of all FIR elements to CheckerContext
^KT-56472 Fixed
2023-02-10 12:30:14 +00:00
Dmitriy Novozhilov 41192b022d [FIR] Pass context to all relevant methods of FirDeclarationGenerationExtension
^KT-53470 Fixed
2023-02-10 12:30:14 +00:00
Dmitriy Novozhilov ea73cde5fb [Lombok] Make visibility of fields of @Value classes private by default (K2)
^KT-51092 Fixed
2023-02-10 12:30:13 +00:00
Dmitriy Novozhilov ff4c5c1d03 [FIR] Pass symbol of containing class to FirStatusTransformerExtension instead of fir node 2023-02-10 12:30:13 +00:00
Dmitriy Novozhilov 67c504e6f0 [FIR] Add replaceStatus method for FirMemberDeclaration 2023-02-10 12:30:12 +00:00
Dmitriy Novozhilov 0550f0d394 [Lombok] Make visibility of fields of @Value classes private by default (K1)
^KT-51092
2023-02-10 12:30:12 +00:00
Dmitriy Novozhilov a9248569a6 [FIR] Fix reporting of UNINITIALIZED_ENUM_ENTRY in init blocks
^KT-41126 Fixed
2023-02-10 12:30:12 +00:00
Ilya Goncharov c596c1ad73 [Gradle, JS] Make compilation binaries publiс 2023-02-10 11:43:24 +00:00
Pavel Kirpichenkov eb59f399de Minor: refactor source set constraints 2023-02-10 11:02:21 +00:00
Pavel Kirpichenkov 1b8c517e1e [MPP] Don't apply common parts of IDE import resolution for JVM+Android
- Don't resolve common parts of MPP libraries
- Filter out kotlin-stdlib-common

KT-56453
2023-02-10 11:02:21 +00:00
Vladimir Sukharev 6e434748d1 [K2/N] Run new stdlib tests also for K2.
Merge-request: KT-MR-8708
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-02-10 10:34:44 +00:00
Sergey Bogolepov f86d28449f [K/N] Make -Xprofile-phases print profile of LLVM passes 2023-02-10 10:20:30 +00:00
Sergey Bogolepov 637258e175 [K/N] Add LLVM C wrappers for -time-passes API. 2023-02-10 10:20:29 +00:00
Egor Kulikov 32c3b0cd58 [FIR] Use stubs for creating lazy bodies of backing field initializer
Ninth step for ^KT-52615

Merge-request: KT-MR-8756
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-02-10 10:02:39 +00:00
Alexander.Likhachev 93a1d61a30 [Gradle] Use variant factories provider in KotlinJvmTest and KotlinTest
Reverts 063dcea2e2
KT-55241 Related
2023-02-09 21:59:18 +01:00
Alexander.Likhachev 1565c800d9 [Gradle] Pass factories to VariantImplementationFactories as parameters
These changes are required to make the factories persistent to work properly with configuration cache
#KT-55241 Fixed
2023-02-09 21:59:17 +01:00
Dmitriy Novozhilov 393f880322 [FIR] Report error about ambiguous anonymous type approximation in type arguments of implicit return type of function
^KT-33917
^KT-56491 Fixed
2023-02-09 20:44:15 +00:00
Dmitriy Novozhilov 3c42521ce7 [FE 1.0] Report warning on leaking anonymous object type from private inline lambda
^KT-33917
^KT-56490 Fixed
2023-02-09 20:44:15 +00:00
Pavel Mikhailovskii 4c7f8ba196 KT-56457 Annotate Enum.entries with @NotNull 2023-02-09 20:13:56 +00:00
Jinseong Jeon 88b07f5287 SLC: keep annotations on type when converting to PsiType
^KT-55815 Fixed
2023-02-09 19:53:45 +01:00
Pavel Kunyavskiy 120ca08740 [K/N] Rework LLVM pipeline
Compiler was running LTO pipeline without preliminary running normal
optimisation pipeline. In some cases this lead to unacceptably long
compilation.

Also, this allows disabling LTO pipeline part, having still quite
good performance, but much better compilation time.

Co-authored-by: Johan Bay <jobay@google.com>

^KT-55868
2023-02-09 14:30:39 +00:00
Pavel Kirpichenkov 8d62e488fe [MPP] use commonizerNativeTargets in names of propagated cinterops
KTIJ-24573
2023-02-09 13:15:10 +00:00
Roman Golyshev ac8d5a0ea8 [Analysis API] KTIJ-24527 Properly handle typealiased functional types
Use expanded ConeTypes to get correct parameters and return types

Also, fix the order of rendering modifiers in `KtFunctionalTypeRenderer`

^KTIJ-24527 Fixed
2023-02-09 12:51:23 +00:00
Sebastian Sellmair b931868d41 [Gradle] GlobalProjectStructureMetadataStorage: Properly store PSM using the buildName...
...instead of the root projects name

^KT-56536 Verification Pending
2023-02-09 12:36:53 +00:00
Sebastian Sellmair 419b0e3e23 [Gradle] Implement MppCompositeBuildIT for builds with rootProject.name set
KT-56536
2023-02-09 12:36:53 +00:00
Denis.Zharkov aa8885ddfc K2: Get rid of last unhandled CheckerContext modification
Previously, it was necessary because otherwise reporting diagnostics
from a checker of FirFile level didn't work

Now, it has been fixed in the previous commit
2023-02-09 12:08:06 +00:00
Denis.Zharkov a71251d856 K2: Set correct containingFile in CheckerContext
Previously, it was working for all the checkers but the file-level
DeclarationChecker's because when execution comes to
DeclarationCheck::check for a file, `containingDeclarations` is empty
(it doesn't contain the file itself yet), thus some things that rely on
CheckerContext::containingFile don't work properly.

For example, SimpleDiagnosticsCollectorWithSuppress.report that
effectively doesn't collect diagnostics when the containingFile is null.
2023-02-09 12:08:06 +00:00
Denis.Zharkov 970d4f2949 K2: Extract PersistentCheckerContext::copy 2023-02-09 12:08:05 +00:00
Denis.Zharkov a311d6eea0 K2: Extract CheckerContextForProvider from CheckerContext
So, the idea is that CheckerContext should remain just read-only
while the one who runs the checkers might build/modify the context.

^KT-56460 Related
2023-02-09 12:08:05 +00:00
Sebastian Sellmair d24092e467 Demote LoggingStringTemplateAsArgument inspection to 'consideration' 2023-02-09 10:58:10 +00:00
Yahor Berdnikau 3c01ad6bc3 Exclude transitive :kotlin-build-common dependency
This dependency has non-relocated 'com.intellij' types which could
lead to build errors if build classpath will have it earlier in the list
then kotlin-compiler-embeddable.

^KT-56414 Fixed
2023-02-09 10:09:24 +00:00
Ilya Goncharov 40d75d531b [Gradle, JS] Wasm Karma support
^KT-56159 fixed
2023-02-09 09:47:05 +00:00
Sergey Bogolepov f7d3312ad5 [K/N] Finish refactoring TempFiles usages
1. Introduce CExportFiles class
This class aggregates all files that are created specifically for
C export. Adding more such classes for other output kinds should
help getting rid of OutputFiles class.

2. Remove NativeGenerationState.tempFiles
Making NativeGenerationState (and compiler phases in general)
unaware of files and their lifetime is necessary for making phases
simpler and easier to compose.
2023-02-09 08:20:34 +00:00
Sergey Bogolepov 4fbddf1786 [K/N] Pass NativeGenerationState components as parameters
tempFiles is finally moved to the driver.
2023-02-09 08:20:34 +00:00
Sergey Bogolepov b7b85177a7 [K/N] Refactor module splitting for backend
We want to extract tempFiles from NativeGenerationState.
To do so, we need to move creation of NativeGenerationState from
`splitIntoFragments` function and untie CacheLlvmModuleSpecification
from NativeGenerationState
2023-02-09 08:20:34 +00:00
Sergey Bogolepov eba1b4c388 [K/N] Untie DependenciesTracker from NativeGenerationState 2023-02-09 08:20:33 +00:00
Sergey Bogolepov 7402ef24bb [K/N] Remove obsolete TempFiles constructor parameter 2023-02-09 08:20:33 +00:00
Sergey Bogolepov 6a06be08cd [K/N] Extract pre-link from linker and a bit of refactoring
Finish extracting all usages of TempFiles to the driver.
2023-02-09 08:20:32 +00:00