Commit Graph

105289 Commits

Author SHA1 Message Date
Leonid Startsev dcfc20f1ff Do not attempt to get field initializer if it is not available.
This may happen on Native if the property is in another module.

#KT-62522 Fixed
Related to: KT-62523
2023-10-13 14:27:36 +00:00
Artem Daugel-Dauge 9c1fa93607 [Gradle] Fix CocoaPods-Xcode tests 2023-10-13 14:03:45 +00:00
Roman Efremov d09c3783fd [K2] Fix mistake in language feature name for
...`DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE`
diagnostic.

^KT-62036
2023-10-13 12:30:41 +00:00
Dmitrii Gridin b2c8d7e777 [FIR] do not treat external ide annotations as real one
Such annotations are supposed to affect only diagnostic warnings

^KT-62310 Fixed
2023-10-13 12:16:12 +00:00
Dmitrii Gridin 2cac922cd0 [FIR] add tests on external annotations
Tests are excluded in COMPILED_JAVA mode because in this
mode external annotations are not present at all

^KT-62310
2023-10-13 12:16:12 +00:00
Nikolay Lunyak e452113a7a [FIR] Fix missing INVISIBLE_REFERENCE on imports
^KT-59927 Fixed
2023-10-13 11:56:54 +00:00
Nikolay Lunyak 21cb5cf83a [FIR] Store the first file in data.state.classifierContainerFileMap
Note that this doesn't affect
multi-module configurations

^KT-59927
2023-10-13 11:56:54 +00:00
Nikolay Lunyak 41c3f98419 [FIR] Make resolution of classes in FirProvider more reasonable.
See the `privateInFile.fir.kt` test.
Type mismatches are simply confusing.

`inheritorOfExpectSealedClass.out`
reports unresolved reference probably
because now it resolves into the expect
declaration, rather than the actual one.
K1 doesn't report UNRESOLVED_REFERENCE
in this case. But this is red code
anyway. And this behavior still
depends on the order in which the compiler
receives both the declarations.

^KT-59927
^KT-62567
2023-10-13 11:56:54 +00:00
Nikolay Lunyak a9ceae9667 [FIR] Add the privateInFileInDifferentModule test
We only see the redeclaration
diagnostics on the declarations inside
the second file, because of
`FirRecorder::visitRegularClass`.
`data.state.classifierContainerFileMap`
references the last file, so
when checking the visibility of
the first `private class C { ... }`
(when collecting declarations that
conflict with the second `private class C`)
the provider returns the second file
instead of the first one, so the class
behaves as it is visible, and
`collectTopLevelConflict` returns in
this case.

As for why `INVISIBLE_*`s are reported
inside the first file: this is because
`data.state.classifierMap` stores the
last classifier it sees instead of
the first one.

^KT-62537
2023-10-13 11:56:54 +00:00
Ilya Kirillov ba37ad9b85 [build] remove obsolete -opt-in=kotlin.ExperimentalStdlibApi from :analysis:proejct-structure module 2023-10-13 11:49:55 +00:00
Ilya Kirillov e91e1a7729 [build] Remove non-needed IR modules from Kotlin plugin
^KT-62510
^KTIJ-27361
2023-10-13 11:49:55 +00:00
Ilya Kirillov 1ec6a29d1b [build] fix project names in sam-with-receiver-compiler-plugin-for-ide
They usually use one `:`
2023-10-13 11:49:55 +00:00
Ilya Kirillov 83db91d445 [build] do not build kotlin-stdlib-minimal-for-test-for-id as it's unused in the IDE 2023-10-13 11:49:55 +00:00
Ilya Kirillov b3226b9b78 [build] do not build kotlin-compiler-for-ide as it's unused in the IDE Plugin 2023-10-13 11:49:55 +00:00
Vladimir Sukharev 5acdc865b6 Properly handle multi-line diagnostics test directives 2023-10-13 10:14:21 +00:00
Sergej Jaskiewicz df0f86bf8d [FIR generator] Use a single list of parent TypeRefs for elements
(Instead of storing the list of parent elements + the map of parent
arguments)
2023-10-13 10:11:38 +00:00
Vyacheslav Gerasimov 5ee7aa7077 Build: Workaround KT-61766 with implicitDependencies 2023-10-13 09:15:03 +00:00
Vyacheslav Gerasimov 453da6af27 Minor: Fix comment in resolve-dependencies.gradle.kts 2023-10-13 09:15:03 +00:00
Ivan Kylchik 350ee4be1d [Native] Replace consequence line and column calls with a single one 2023-10-13 08:50:47 +00:00
Ivan Kylchik 1be98b8f08 [IR] Extract some common code into AbstractIrFileEntry 2023-10-13 08:50:47 +00:00
Ivan Kylchik 6039d39546 [IR] Add new method IrFileEntry.getLineAndColumnNumbers
Calling this method instead of sequence of `getLineNumber` and
`getLineNumber` is faster because we eliminate one exess
`getLineNumber` call.
2023-10-13 08:50:47 +00:00
Ivan Kylchik a30d0aeeb0 [JVM] Replace AbstractInsnNode.getType with new util function
This change speeds up backend by approximately 0.96%.
2023-10-13 08:50:47 +00:00
Ivan Kylchik 67460962c3 [JVM] Use HashSet instead of SmartSet in MaxStackFrameSizeAndLocalsCalculator
This change speeds up backend by approximately 0.25%.
2023-10-13 08:50:47 +00:00
Ivan Kylchik 05b364a5f1 [JVM] Simplify equals method in StrictBasicValue 2023-10-13 08:50:47 +00:00
Ivan Kylchik 84a47a2298 [IR] Drop SLRUCache usages from NaiveSourceBasedFileEntryImpl
Access to `SLRUCache` is a bottleneck when we call `getLineNumber`.
We are very rarely going to access the same offset. This change
speeds up backend by approximately 0.43%.
2023-10-13 08:50:47 +00:00
Ivan Kylchik 4a07454d8d [IR] Drop excess resolveFakeOverride from EVALUATION_MODE
This change doesn't affect semantic and speeds up
backend by approximately 0.06%.
2023-10-13 08:50:47 +00:00
Ivan Kylchik 3335db0aa8 [IR] Simplify unsigned check in EVALUATION_MODE
This way we are not creating useless intermediate lists. This change
speeds up backend by approximately 0.38%.
2023-10-13 08:50:47 +00:00
Ivan Kylchik f36f37bf47 [IR] Drop isNan fun from IrInterpreterCommonChecker
It is not used anymore after 858f432807
2023-10-13 08:50:47 +00:00
Ivan Kylchik 9135e9d13d [JVM_IR] Drop reversed call from writeLocalVariablesInTable
It is better to use simple for loop. This change speeds up
backend by approximately 0.07%.
2023-10-13 08:50:47 +00:00
Pavel Kunyavskiy 156c341eeb [K/N] Implement objc overridablity condition for IR
^KT-61511
2023-10-13 08:15:01 +00:00
Pavel Kunyavskiy 202f30f910 [K/N] Extract ObjcOverridabilityCondition to separate file
^Kt-61511
2023-10-13 08:15:00 +00:00
Sebastian Sellmair 4c15509776 [Gradle] Rename KotlinExtensionPoint to KotlinGradlePluginExtensionPoint
KT-61634
2023-10-12 18:24:17 +00:00
Sebastian Sellmair d471a5ed4a [Gradle] Migrate KotlinGradleProjectChecker to KotlinExtensionPoint
KT-61634
2023-10-12 18:24:17 +00:00
Sebastian Sellmair 30665c3e02 [Gradle] Implement KotlinExtensionPoint to allow extensible designs inside the KotlinGradlePlugin
KT-61634
2023-10-12 18:24:17 +00:00
Sebastian Sellmair e78331cd5c [Gradle] Implement generic 'StoredProperty' mechanism
This will allow extending objects of 'Project' or 'HasMutableExtras'
with generic, stored instances

KT-61634
2023-10-12 18:24:17 +00:00
Ilya Goncharov 1fd9706f47 [K2] KT-60080 Fix packageFqn for property accessor symbol
^KT-60080 fixed
2023-10-12 17:44:47 +00:00
Svyatoslav Scherbina a318cd455d Native: fix interop_concurrentRuntime test for mingw_x64
Our sysroot for mingw_x64 still requires -femulated-tls. For C++ code
as well. Without it the test fails with

    lld-link: error: undefined symbol: std::__once_call

^KT-46612
2023-10-12 17:16:18 +00:00
Svyatoslav Scherbina 080a404d9a Native: enable interop_concurrentRuntime test since it no longer fails
^KT-43180 Obsolete
2023-10-12 17:16:18 +00:00
Svyatoslav Scherbina 2db89b7e7a Native: improve description of supported MSVC versions in README 2023-10-12 17:06:56 +00:00
Marco Pennekamp a62ac940c4 [AA] Add abstraction for composable Kotlin providers
This further improves the `KotlinCompositeProvider` abstraction:

- Pulling the abstraction's interfaces outside the `impl` package allows
  us to write consolidated documentation on composable Kotlin providers.
- The addition of `KotlinComposableProvider` allows more specific bounds
  for the type parameters of `KotlinCompositeProvider` and
  `KotlinCompositeProviderFactory`. It also clarifies to Analysis API
  implementors which providers can be composed at all, as providers like
  `KotlinDeclarationProvider` extend this interface.
- `KotlinComposableProviderMerger` provides a unified interface for
  provider mergers.

^KT-61791
2023-10-12 16:10:32 +00:00
Marco Pennekamp c289da6cf3 [LL FIR] Use mergePackageProviders in LLFirCombinedKotlinSymbolProvider
^KT-61791
2023-10-12 16:10:32 +00:00
Marco Pennekamp b9e3d848a6 [AA] Add KotlinPackageProviderMerger
- In parallel to Kotlin declaration provider merging, we need a proper
  merging strategy for package providers as well, because resolve
  extensions may define additional package providers.
- Additionally, other non-scope-based package providers may be added in
  the future, and the merger preserves these out of the box.

^KT-61791
2023-10-12 16:10:32 +00:00
Marco Pennekamp c63dde4f7e [AA] Add abstraction for composite provider creation and merging
- Composite declaration providers and declaration provider mergers are
  extremely similar to the composite package providers and (newly to be
  implemented) package provider mergers. This commit extracts the common
  parts into a `KotlinCompositeProviderFactory`.

^KT-61791
2023-10-12 16:10:32 +00:00
Marco Pennekamp 0e6cc92958 [LL FIR] Optimize getPackage in combined Kotlin symbol providers
- `getPackage` can also benefit from a combined index access.
- Care has to be taken with allowed/disallowed `kotlin` packages. Since
  we're not delegating to individual symbol providers after the index
  access, `allowKotlinPackage` has to be taken into account in the
  combined symbol provider explicitly.

^KT-61791 fixed
2023-10-12 16:10:32 +00:00
Jaebaek Seo a6c432587f K2: Add extension point for additional KDoc resolution
Similar to K1 KDocLinkResolutionService used by Fe10KDocReference (to
support additional KDoc resolution), this commit adds K2 counterpart
AdditionalKDocResolutionProvider and uses it for KDocReferenceResolver.

^KT-62187
2023-10-12 15:17:31 +00:00
Ilya Kirillov 34ea0678ae [Analysis API Standalone] refactoring, use predefined paths to libraries in StandaloneSessionBuilderTest wher it's possible 2023-10-12 15:15:05 +00:00
Ilya Kirillov 4d38cc4548 [Analysis API Standalone] fix exception on invalid KLib from symbol provider
^KT-62244 fixed
2023-10-12 15:15:05 +00:00
Mikhail Glukhikh d005d1cd68 Add accidentally forgotten IrSourceRangesDumpHandler to IR text tests 2023-10-12 15:06:47 +00:00
strangepleasures 2319e11ff1 [KAPT] KT-62059 Disable incremental stub generation in K2 2023-10-12 13:37:23 +00:00
Igor Chevdar a8c6074c45 [IR] Use InlineFunctionResolver for inlinable function references
#KT-62313 Fixed
2023-10-12 13:34:13 +00:00