Commit Graph

104613 Commits

Author SHA1 Message Date
Ivan Kylchik 98cc2c839f [JVM] Create base FastAnalyzer class for all Fast...Analyzer 2023-09-14 15:02:02 +00:00
Ivan Kylchik 7853256c02 [JVM] Drop some excess toArray calls on instructions 2023-09-14 15:02:02 +00:00
Ivan Kylchik d8e682ab30 [JVM] Drop insnsArray from Fast...Analyzer classes
We are using useless `toArray` can that we can avoid.
2023-09-14 15:02:02 +00:00
strangepleasures cf01d2970f [SLC] [KAPT] KT-61916 Fix generation of annotations in annotation arguments 2023-09-14 13:21:07 +00:00
Artem Kobzar 878452bd2b [K/JS] Implement file merging for clashed file during per-file compilation 2023-09-14 13:14:15 +00:00
Ilya Muradyan 337054ba92 Scripting: Remove deprecated MavenRepositoryCoordinates class 2023-09-14 12:14:32 +00:00
Ilya Muradyan f1f12bc192 Scripting: Reuse AetherSession if repositories didn't change
Repository system will be not reconstructed on subsequent calls
2023-09-14 12:14:32 +00:00
Ilya Muradyan b1347d7616 Scripting: Unify artifacts resolution for partial and non-partial cases 2023-09-14 12:14:32 +00:00
Ilya Muradyan 841cc8eb43 Scripting, KT-61727: Make it possible to resolve multiple artifacts at once
For MavenDependenciesResolver it improves performance drastically
depending on how strong transitive dependencies of the roots interfere

^KT-61727 Fixed
2023-09-14 12:14:32 +00:00
Kirill Rakhman 0d628c9e59 [FIR] Inline FirExpression.coneTypeSafe und use resolvedType
The call-sites don't actually need to handle unresolved expressions,
they only need safe-casts to ConeClassLikeType or
ConeIntegerLiteralType.

#KT-61367
2023-09-14 10:03:03 +00:00
Kirill Rakhman a4fff7c7c0 [FIR] Inline FirExpression.coneTypeUnsafe
#KT-61367
2023-09-14 10:03:03 +00:00
Kirill Rakhman 126f2c9440 [FIR] Skip published visibility computation for local functions
This fixes an exception caused by annotations being unresolved during
 status computation.

#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman f0112040fc [FIR AA] Unmute passing test 2023-09-14 10:03:02 +00:00
Kirill Rakhman aebb3bf0ee [FIR AA] Use resolvedType instead of coneTypeOrNull where applicable
#KT-61367 Fixed
2023-09-14 10:03:02 +00:00
Kirill Rakhman 6d8091f0ff [FIR] Add workaround for unresolved array literal type #KT-61843
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 462687ed66 [FIR] Don't resolve call in annotation arguments phase if receiver type isn't resolved
This prevents exceptions from being thrown during resolution of red code
because FirExpression.resolvedType is called but during annotation
arguments phase we don't have return types for implicitly typed
declarations.

#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 66b911c923 [FIR] Migrate compiler.fir to use resolvedType where applicable
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 1c6776b2b4 [FIR] Introduce extension FirExpression.isResolved that requires no opt-in
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman e0b5fa1de8 [FIR] Add opt-in for FirExpression.coneTypeOrNull in scripting
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman b9b99366e7 [FIR] Use resolvedType instead of coneTypeOrNull in java.deserialization
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman b1565d547c [FIR] Use resolvedType instead of coneTypeOrNull in FIR2IR
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman c3abe28049 [FIR] Use resolvedType instead of coneTypeOrNull in checkers
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman e8731f3f31 [FIR] Use resolvedType instead of coneTypeOrNull in tests
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 5d6affc38d [FIR] Update FIR utilities
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman a49fdeb05b [FIR] Update manual implementations of FirExpression
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 68bc2be4c9 [FIR] Regenerate FIR types
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 6ec419edb7 [FIR] Update FIR schema to add opt-in to FirExpression.coneTypeOrNull
#KT-61367
2023-09-14 10:03:01 +00:00
Dmitriy Dolovov b3cb8870e0 [IR][JS] Always drop expect declarations prior IR serialization
^KT-61136
2023-09-14 09:13:39 +00:00
Ivan Kylchik ede6eb0b34 [IR] Print exception's class in error message from interpreter 2023-09-14 08:47:06 +00:00
Ivan Kylchik 2df5b48474 [IR] Report error from IR interpreter on field recursive initialization
#KT-59890
#KT-61802 Fixed
2023-09-14 08:47:06 +00:00
Dmitriy Dolovov 98b3bdb175 [K1] Rename analysis flag expectActualLinker
Rename analysis flag `expectActualLinker` to `skipExpectedActualDeclarationChecker`
to better reflect its semantics. This flag isn't used on IDE plugin side, so no
additional changes in `intellij` repo are needed.

^KT-61136
2023-09-14 07:32:18 +00:00
Nikolay Krasko 1af7649ee9 Use maven wrapper for reproducible build 2023-09-13 22:25:29 +00:00
Nikolay Krasko 83a2158744 Remove unused allowed jcenter dependencies 2023-09-13 22:25:29 +00:00
Dmitrii Gridin 7d42bfa859 [LL FIR] LLFirResolveTarget: mark class as internal
^KT-61296
2023-09-13 20:26:50 +00:00
Dmitrii Gridin 31b36ee766 [LL FIR] introduce lazyResolveRecursively API
FirFile after KT-56683 has its own phases and resolution logic,
so we should have a separate API for lazy resolution for FirFile and for
the entire file

^KT-61296 Fixed
2023-09-13 20:26:50 +00:00
Dmitrii Gridin b77ae5d275 [LL FIR] rework LLFirResolveTarget
* Move visiting logic to LLFirTargetResolver to
avoid code duplication
* Introduce more common LLFirWholeElementResolveTarget

^KT-61296
2023-09-13 20:26:50 +00:00
Dmitrii Gridin aeeb64b9ef [LL FIR] LLFirResolveTarget: more accurate toString
^KT-61296
2023-09-13 20:26:49 +00:00
Dmitrii Gridin 6893c44a06 [LL FIR] merge LLFirResolveTargetWithDedicatedElement into LLFirResolveTarget
^KT-61296
2023-09-13 20:26:49 +00:00
Dmitrii Gridin fd25531268 [LL FIR] LLFirResolveTargetWithDedicatedElement: implement common toStringForTarget
^KT-61296
2023-09-13 20:26:49 +00:00
Dmitrii Gridin 3432e8d1f9 [LL FIR] LLFirResolveTarget: move util to a separate file
^KT-61296
2023-09-13 20:26:49 +00:00
Timofey Solonin 53584cdd49 Don't emit CAST_NEVER_SUCCEEDS when casting to a forward declaration type
^KT-58929
2023-09-13 17:49:12 +00:00
Timofey Solonin 28f90b3ea8 Add CAST_NEVER_SUCCEEDS diagnostic to forwardDeclarations.kt
Add safe as casts to forwardDeclarations.kt

^KT-58929
2023-09-13 17:49:12 +00:00
Vladimir Sukharev f5bd7cee05 [K/N] Adjust filecheck tests for atomic intrinsics to -opt mode
^KT-60514 Fixed


Merge-request: KT-MR-12179
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 17:46:22 +00:00
Alexander Shabalin c637a228eb [K/N] Fix filecheck kt53621 tests on linux arm64.
For aarch64-unknown-linux-gnu clang generates i1 to represent bool.
On our other targets it generates as zeroext i1 instead.
2023-09-13 16:55:09 +00:00
Roman Golyshev 7b50506aea KT-61889 [AA] Migrate KtFirReferenceShortener to ContextCollector
This should make reference shortener considerably faster, since it won't
need to perform redundant extra resolve of the file.

`ContextCollector` more accurately collects the scopes for the scripts,
so some script tests are also fixed.

It should fix the following bugs:

^KTIJ-26714 Fixed
^KTIJ-26727 Fixed

This is also an important part of fixing the following bugs:
- KTIJ-26715
- KTIJ-26734

But those bugs also rely on KT-61890, because completion uses scopes
and snows incorrect elements from them
2023-09-13 16:43:20 +00:00
Dmitrii Gridin ce900063c0 [LL FIR] reduce number of in-block modifications
The idea of optimization is simple – delay in-block modification
until the end of a write action.

Q: Why the end of write action?
A: We have to publish the result of modification somewhere during
write action to be sure that the next read action will see the
updated result. We can't publish the result somewhere later
because we can't guarantee that the modification will be visible
to all customers.

In the case of out-of-block modification, we still have to publish
the result immediately because it is hard to evaluate the consequences
of the opposite decision yet.

If an out-of-block modification happens, we can drop all previous
in-block modifications from the queue because they don't make sense
due to invalidation of the entire KtModule.

A corner case is the analysis under write action. The delay means that
there is no longer any guarantee that all PSI changes will be reflected
into FIR tree immediately. So now we can guaranty only that at
the start of `analyze` block you will have the up-to-date FIR tree.

^KT-60611 Fixed
2023-09-13 16:23:27 +00:00
Alexander.Likhachev 431f4a8bd3 [Build] Remove junit from versions.properties
Now all the JUnit dependencies except the ones provided by `kotlin-test` are moved to the version catalog
#KTI-1349 Fixed
2023-09-13 15:32:15 +00:00
Sergej Jaskiewicz 14e23a7d84 [K/N] Cache FqNames computed from ClassIds in KonanMangler 2023-09-13 14:25:13 +00:00
Sergej Jaskiewicz 904f8706ee [K/N] Don't use reflection in irText tests for obtaining manglers
See KT-61248
2023-09-13 14:25:12 +00:00
Sergej Jaskiewicz 9eba17d631 [K/N] Move Native-specific mangle constants to more suitable places
They shouldn't be mixed with target-independent constants.
2023-09-13 14:25:12 +00:00