Commit Graph

93044 Commits

Author SHA1 Message Date
Yahor Berdnikau 236a0ca6f0 Move atomicfu plugin into common sourceset
This should fix missing classes in plugin variants artifacts

^KT-52777 Fixed
2022-06-15 10:01:18 +02:00
Dmitry Gridin bfe09de95f [light classes] LightClassBuilder: cleanup code
^KT-48773
2022-06-14 17:18:10 +00:00
Dmitry Gridin 8a75aef8f5 [light classes] add registry key to forbid access to backend
^KT-48773
2022-06-14 17:18:10 +00:00
Dmitry Gridin f42528e354 [light classes] support DefaultImpls in ulc
^KT-48773
2022-06-14 17:18:09 +00:00
bennyhuo 20a9314b0b Embed 'kotlin-util-io' to fix the missing kotlinx.metadata.internal.konan.file.File problem in the published library 'kotlinx-metadata-klib' 2022-06-14 18:16:55 +03:00
Roman Golyshev 581ae5fcb7 [FIR IDE] Add a special type of KtCall for generic type qualifiers
^KTIJ-21672 Fixed
2022-06-14 15:00:13 +00:00
Roman Golyshev fe06070d23 [FIR IDE] Make AbstractResolveCallTest.kt more strict 2022-06-14 15:00:13 +00:00
Roman Golyshev 4d6b424280 [FIR IDE] Properly handle generic types qualifiers
In code like `foo.Bar<Bazz>`, `Bar<Bazz>` is considered to be
`KtCallExpression` from the PSI point

^KT-52779 Fixed
2022-06-14 15:00:12 +00:00
Troels Bjerre Lund 90754d11c1 [K/N] Code cleanup from deprecation warnings
No functionality change; just quieting some warnings
2022-06-14 13:32:24 +00:00
Margarita Bobova 71e617a7f5 Add changelog for 1.7.0 2022-06-14 13:07:32 +02:00
Dmitriy Dolovov 34129d54e5 [Native][tests] Choose the appropriate cache mode for the target under test 2022-06-14 11:01:25 +00:00
Yahor Berdnikau c495c07b1a Drop convention usage on accessing Java SourceSet
This is only valid for Gradle 7.1+, so new plugin variant was added -
"gradle71". For Gradle <=7.0 old convention approach is still used.

^KT-47047 In Progress
2022-06-14 10:53:20 +00:00
Sergey.Shanshin f192c2a541 Use EnumSerializer for explicitly serializable enum instead of auto-generated
Resolves Kotlin/kotlinx.serialization#683 Kotlin/kotlinx.serialization#1372
2022-06-14 10:21:48 +00:00
Ilya Kirillov f8310a4763 [analysis api] enable AnalysisApiMissingLifetimeCheck by default 2022-06-14 11:12:06 +02:00
Pavel Kunyavskiy df950d010a [K/N] Fix lambda naming in debugger tests
^KT-51883
2022-06-14 08:03:37 +00:00
Alexander Korepanov 9e780afdca [JS IR] Rework incremental cache invalidation
Replace loading the whole world IR with loading only exported (reachable) IR.

 For that purpose the direct and inverse dependency graph is used.
 It is stored in a cache directory and the cache updater keeps it up to date.
 If after loading it is found that other files must be also implicitly rebuilt
 (see rebuilt reasons below), IR for that files also will be loaded.
 This algorithm repeats until the number of implicitly rebuilt files is not 0.

 More rebuilt reasons (dirty state) have been added:
  - added file: this is a new file;
  - modified ir: ir of the file has been updated;
  - updated exports: exports from the file have been added or removed
    (e.g. a function has been used from another file);
  - updated inline imports: imported inline function has been modified
    (transitively);
  - removed inverse depends: a dependent file has been removed;
  - removed direct depends: a dependency file has been removed;
  - removed file: this file has been removed.

 Incremental cache tests has been refactored:
  - The supporting of all rebuilt reasons (dirty states) has been added;
  - New file name format "*.$suffix.kt" for the test steps has been allowed,
    so the syntax highlight works now;
  - Explicit stdlib dependency usage has been removed.
2022-06-13 20:04:05 +00:00
Alexander Udalov f003f19e1d IR tree gen: restore IrWhileLoop children visit order 2022-06-13 18:58:05 +02:00
Alexander Udalov bf5ab49342 IR tree gen: restore strict cast in IrProperty.transformChildren 2022-06-13 18:58:05 +02:00
mcpiroman 529c03ab08 Switch to auto generated IR tree
Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2022-06-13 18:58:05 +02:00
Alexander Udalov c6608de879 Minor, move some files in ir.tree from 'src' to 'gen'
To help git understand that they are moved in the subsequent commit.
2022-06-13 18:58:05 +02:00
mcpiroman c11d01bebb Extract some common source generator logic from FIR tree generator 2022-06-13 18:58:05 +02:00
Jinseong Jeon 2eab61d75f FIR CLI: remove redundant cast and run 2022-06-13 18:41:17 +02:00
Jinseong Jeon d2663cfb94 FIR CLI: fix typos in contentRootToVirtualFile util 2022-06-13 18:41:17 +02:00
Artem Kobzar e790607af5 feat(KT-51123): save comments from js-function call inside arguments list. 2022-06-13 12:58:18 +00:00
Alexander Udalov ec9d929532 Remove dependency of fir2ir:jvm-backend on backend.jvm.entrypoint
Extract JvmIrDeserializer(Impl), similarly to the existing
JvmIrSerializer(Impl). Remove `allowErrorNodes` which is always false
anyway.
2022-06-13 12:35:51 +00:00
Artem Kobzar ef157b5b2e [K/JS] chore: rewrok klib generating with LazyIr. 2022-06-13 12:13:22 +00:00
sebastian.sellmair 9c67276201 [Gradle][MPP] Cache kotlinProjectStructureMetadata for multiplatform projects
GranularMetadataTransformation requires the metadata for dependency
projects, for every given source set multiple times. This lead
to the metadata being built extremely often, causing a significant
bottleneck during import.
2022-06-13 11:34:41 +00:00
sebastian.sellmair d8b4a88400 [Gradle][MPP] GradleKpmFragmentGranularMetadataResolver: Avoid re-processing dependencies 2022-06-13 11:34:39 +00:00
sebastian.sellmair 8b595cd804 [Gradle][MPP] GranularMetadataTransformation: Avoid re-processing dependencies
Do not process any dependency that was already processed previously.
When filling up the 'resolvedDependencyQueue' there is already
one filter present, checking that the resolved dependency was not
already visited.

However, this filter is insufficient, since the queue is just an
ArrayDeque and not a set. It happened that many dependencies
were enqueued multiple, multiple times.
2022-06-13 11:34:38 +00:00
sebastian.sellmair 8c904fdab2 [Gradle][MPP] reportSourceSetCommonizerDependencies: Fix parentsClosure 2022-06-13 11:34:37 +00:00
sebastian.sellmair e6f04c84fa [Gradle][MPP] Increase test failure readability in reportSourceSetCommonizerDependencies 2022-06-13 11:34:36 +00:00
sebastian.sellmair 3c8a4c5896 [Gradle][MPP] Mark 'commonizeNativeDistribution' as UP-TO-DATE when cache hits
^KT-52632 Verification Pending
2022-06-13 11:34:35 +00:00
sebastian.sellmair 02601745a9 [Gradle] Simplify 'isHostSpecificKonanTargetsSet' implementation
The method is called pretty often during import and can return
faster and create less objects.
2022-06-13 11:34:34 +00:00
Mikhael Bogdanov 3d1bde470b Regenerate tests 2022-06-13 11:58:15 +02:00
pyos e18105e0dc JVM: remove default masks from parameters after inlining conditions 2022-06-13 11:58:15 +02:00
pyos a1f0c6208c Add a test from KT-51950 2022-06-13 11:58:15 +02:00
pyos 7bdc09301d JVM: add inline lambdas' captured parameters to constructor first
This makes the code a bit cleaner, but has no effect other than that.
2022-06-13 11:58:15 +02:00
pyos ae5acc0de1 JVM: do not remap regenerated constructor parameters to fields
^KT-51950 Fixed
2022-06-13 11:58:15 +02:00
pyos 64e8bc31e2 JVM: keep track of which regenerated field is for which parameter 2022-06-13 11:58:15 +02:00
pyos 60c27affbb JVM: inline (!) some DescriptorAsmUtils methods into the inliner
Easier to work with it that way
2022-06-13 11:58:15 +02:00
pyos 2f6c80f06f JVM: more correctly track inline lambdas in local slots
The analyzer can now handle the case where a parameter containing an
inline lambda is overwritten with something else. The local variable
remapper still can't handle that, and KT-51950 is caused by a deeper
underlying issue (the slot should't get overwritten in the first place),
but at least the problem is more visible now:

>java.lang.RuntimeException: Trying to access skipped parameter:
>  Lkotlin/jvm/functions/Function1; at 2
2022-06-13 11:58:14 +02:00
pyos 51dbc60722 JVM: use various Interpreter.new* methods in FastMethodAnalyzer
These allow e.g. specifying different values for parameters depending on
their indices.
2022-06-13 11:58:14 +02:00
Anton Lakotka de875f6349 [Gradle] Support configuration cache for buildKotlinToolingMetadata
^KT-52694 Verification Pending
2022-06-13 07:26:24 +00:00
Anton Lakotka d8bc17a53c [Gradle] Test buildKotlinToolingMetadata with configuration cache
^KT-52694
2022-06-13 07:26:24 +00:00
Pavel Mikhailovskii bcd8a28d4c KT-47823 IR.JVM Fix handling of for loop ranges with inline types and break/continue/return 2022-06-10 18:42:28 +00:00
Pavel Mikhailovskii ecb3cc193c KT-51883 Don't use "-" in generated unique lifted declaration names 2022-06-10 18:36:04 +00:00
Kristoffer Andersen fb9c5c13bd [IR] Have JVM codegen respect the GenerateClassFilter supplied to GenerationState
ClassCodegen bails before generating code if the filter supplied to
the GenerationState rejects it based on the containing file or class
declaration itself.
2022-06-10 19:10:34 +02:00
Zac Sweers 3896482e4f Fix wrong replacement name for Enum.declaringClass
Resolves https://youtrack.jetbrains.com/issue/KT-52718
2022-06-10 13:53:03 +00:00
Diego Gomez Olvera 9a430efbe7 [KT-52681] Remove unnecessary semicolon after Objective-C @end
Objective-c `@end` doesn't need a semicolon, however KMM exported header
file, for instance:
```
__attribute__((swift_name("KotlinIterator")))
@protocol MyProjectKotlinIterator
@required
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
- (id _Nullable)next __attribute__((swift_name("next()")));
@end;
```
This creates problems with some code checkers that will not expect it
there, so it seems best to remove it.
2022-06-10 15:46:27 +03:00
pyos 3840d09314 FIR: fix check for plugins that support K2 2022-06-10 09:47:35 +03:00