Commit Graph

106819 Commits

Author SHA1 Message Date
Dmitrii Gridin 5bd1a97632 [FIR] LT builder: extract convertAnnotationList from convertModifierList
To simplify the logic around `convertModifierList` as a combination of
annotations and modifiers doesn't work well

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin c5cba4c053 [FIR] builder: provide containingDeclarationSymbol
We cannot use only non-local declarations as anchors due to the same
resolution logic between member declarations of local classes, so we
have to support such cases as well

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin be4bc81b1b [FIR] FirFileSymbol: add stable toString
It will be used in tests in the next commit

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 6eca9fe3a9 [FIR] tree: introduce containingDeclarationSymbol for annotation calls
This symbol will be used during resolution to avoid transformation
of annotations in the wrong context in the case of FIR node sharing.
The symbol should be some containing declaration symbol to be able
to answer the question "Are we own this annotation?" during resolution

^KT-63042
2023-12-07 12:26:39 +00:00
Dmitrii Gridin 1d5ab8c24f [FIR] builder: more tests for annotations
^KT-63042
2023-12-07 12:26:39 +00:00
Xin Wang 11749d7c89 [Codegen][JVM]: Mark line number before invoking intrinsics
Fixes #KT-61768
2023-12-07 11:54:12 +00:00
Nikita Nazarov 0898dd1e7f [FIR] Don't check Java annotations for cycles
^KT-64083 fixed
2023-12-07 08:56:56 +00:00
Yan Zhulanow 1726a94c87 [Pill] Update module structure 2023-12-07 08:53:35 +00:00
Yan Zhulanow 7129bcc2b1 [Pill] Support production-on-test dependencies 2023-12-07 08:53:35 +00:00
Yan Zhulanow a7f6029076 [Pill] Delete obsolete run configurations 2023-12-07 08:53:35 +00:00
Yan Zhulanow d9a33b53ce [Pill] Update Kotlin source set fetching 2023-12-07 08:53:35 +00:00
Yan Zhulanow e4da639e1c [Pill] Remove 'jps-compatible' plugin from the root Kotlin project
'excludedDirs' definition is not needed anymore, so the plugin usage
is not really useful.
2023-12-07 08:53:35 +00:00
Yan Zhulanow d4153c1458 [Pill] Remove 'excludedDirs' usage from Pill extension
As it was the last usage of the Pill extension, it is going to be
removed in subsequent commits.
2023-12-07 08:53:35 +00:00
Yan Zhulanow e87ef36ef8 [Pill] Remove variant support from Pill, always import BASE modules
Pill variant configurations in build.gradle(.kts) files will be removed
in subsequent commits.
2023-12-07 08:53:35 +00:00
Yan Zhulanow 1fb8fb2324 [Pill] Do not import modules with the 'FULL' variant
The 'FULL' variant proved to be hardly useful for everyday work.
This change is the first step of removing the variant support from Pill.
2023-12-07 08:53:35 +00:00
Yan Zhulanow 63379b2c03 [Pill] Only add the 'jvmJar' artifact for the main source set 2023-12-07 08:53:34 +00:00
Yan Zhulanow 4e8a5eec7f [Pill] Support KMP 'jvmJar' task convention 2023-12-07 08:53:34 +00:00
Yan Zhulanow a508a650a5 [Pill] Include embedded dependencies together with the module itself 2023-12-07 08:53:34 +00:00
Yan Zhulanow a703fc0f17 [Pill] Remove obsolete IDE plugin artifact creation 2023-12-07 08:53:34 +00:00
Yan Zhulanow 680db7c317 [Pill] Allow kotlin_dom_api_compat artifact 2023-12-07 08:53:34 +00:00
Anton Lakotka 73b290a948 [Gradle] suppress DependencySources configurations in tests
PreHmppDependenciesDeprecationIT test checks that all configurations are
resolved without any error. However, *DependencySources configurations
by nature can't be resolved all the time. As not all dependencies have
sources variants published.
2023-12-07 08:42:35 +00:00
Anton Lakotka daa97f7ec9 [Gradle] Fix testResolveAllConfigurations
It should exclude certain kotlin source set configurations, that
can't be resolved all the time for various reasons.

Particularly `dependencySources` since not all dependencies has
published source variants.
2023-12-07 08:42:35 +00:00
Anton Lakotka c979e4e7be [Gradle] Add dependencySourcesConfigurationName to DefaultKotlinSourceSet
Move logic that creates configuration to resolve Dependency Sources
to SourceSet factory from IDE resolver. Because when it is created
during IDE import it will be reported as a warning. Since all
configurations and tasks must be created before IDE import starts.

^KT-63226 Verification Pending
2023-12-07 08:42:35 +00:00
Anton Lakotka 1d4bca56b1 [Gradle] Set min version for source resolver test to Gradle 7.2
Earlier versions of gradle doesn't return capabilities in resolved
artifact view. Therefore, it is not possible to match artifact by
cooridnates + capabilities.

^KT-63226
2023-12-07 08:42:35 +00:00
Anton Lakotka e2dafa2580 [Gradle] Implement variant base source resolver for IDE
^KT-63226 In Progress
2023-12-07 08:42:35 +00:00
Anton Lakotka 7c9505d9b6 [Gradle] Sources resolver test for multiple capabilities
If dependency has more than one capability sources still can be
resolved.

^KT-63226 In Progress
2023-12-07 08:42:35 +00:00
Roman Golyshev f266a44356 KT-64080 [LL] Resolve super calls to BODY_RESOLVE for on-air resolve
^KT-64080 Fixed
2023-12-07 01:26:23 +01:00
Roman Golyshev 3c7dfc0e5b KT-64080 [LL] Use nullable receiver overload for isAncestor function
This simplifies the `bodyResolveRequired` a lot
2023-12-07 00:41:55 +01:00
Roman Golyshev a475a3031e KT-64080 [LL] Add on-air resolve tests for enum entry resolution 2023-12-07 00:41:53 +01:00
Timofey Solonin a03f0ef4ee Generate CMakeLists for convenient DevX in llvmDebugInfoC
^KT-63598
2023-12-06 18:56:28 +00:00
Nikita Bobko 0d67ae7b23 [TEST] Add regression test for KT-59805 ACTUAL_MISSING for constructor 2023-12-06 18:35:39 +00:00
Tomas Husak 5ccae2801d [FIR] KT-59368 regenerate tests 2023-12-06 17:34:05 +00:00
Tomas Husak d7eb67a436 [FIR] KT-59368 context receiver subtyping checker 2023-12-06 17:34:05 +00:00
Ivan Kochurkin 3d77d09260 [FIR] Fix false positive errors on Throws::class, Throws()
^KT-63794 Fixed
2023-12-06 16:39:51 +00:00
Ivan Kochurkin 8dcd4efbc1 [FIR] Get rid of not needed set allocation in getSingleVisibleClassifier 2023-12-06 16:39:51 +00:00
Troels Bjerre Lund 4f77434ea5 [K/N] Remove LLVM coverage
The -Xcoverage feature has not worked and has been disabled for a while.
This fix removes it, and all of its uses.


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


Merge-request: KOTLIN-MR-821
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-12-06 14:07:16 +00:00
Dmitrii Gridin e0c931f69d [LL FIR] rebind returnTarget for delegate accessors during psi2fir
It is safe to rebind returnTarget to the original declaration during
psi2fir as it doesn't affect the resolution. We already have the same
logic for regular functions/property accessors.
This change is crucial in the context of parallel implicit type
resolution because it affects CFG builder in a bad way in the case
of on-air resolution

^KT-56551
2023-12-06 12:59:55 +00:00
Dmitrii Gridin c59ea8bd2a [FIR] use delegate expression as source for FirWrappedDelegateExpressionBuilder
The previous implementation was not stable because `extractDelegateExpression`
has a source depending on extractDelegateExpression, and it led to
inconsistency in lazy and regular mode in the case of labeled expression
```kotlin
val a: String by l@ MyProperty()
```
In lazy mode the source is KtLabeledExpression, but in the regular one
is KtCallExpression

^KT-56551
2023-12-06 12:59:55 +00:00
Ivan Kylchik 1fcd277538 [FIR] Expand divisionByZero.kt test case
Added two new cases:
1. division where denominator is `val` property
with zero initializer;
2. division where denominator is `const val` property
with zero initializer.

Both such cases have different sets of diagnostics compared to K1.

#KT-59894 Fixed
2023-12-06 10:54:21 +00:00
Ivan Kylchik 5dbe81fd7f [FIR] Always expand a type before checking it in FirConstChecks
The issue appeared when we analyzed some typealias.
1. The typealias itself could be valid, but it could point
to an invalid type.
2. The typealias could point, for example, to an unsigned
type that must be handled in a special way

#KT-59894
2023-12-06 10:54:21 +00:00
Yahor Berdnikau ab1ce759a3 [Gradle] Fix deprecated buildDir usage in IdeBinaryDependencyResolver
^KT-62527 In Progress
2023-12-06 10:09:22 +00:00
Yahor Berdnikau 6df25ac1be [Gradle] Fix deprecated buildDir usage in IdeResolveDependenciesTask
^KT-62527 In Progress
2023-12-06 10:09:22 +00:00
Ilmir Usmanov 32e43998a0 IR: Restore method used by Anvil annotation processor
But make it hidden, so, the new method will be used instead
 #KT-62281
2023-12-06 09:52:07 +00:00
Kirill Rakhman 2391f00b75 [FIR2IR] Fix SAM conversion of adapted callable reference
#KT-63329 Fixed
2023-12-06 09:02:04 +00:00
Timofey Solonin c8b77fe18c Run lldb tests only on arm64 macOS and only in debug mode
^KT-63598
2023-12-06 08:39:06 +00:00
Marco Pennekamp 1901ed36ec [LL] Expand "Low Level FIR API Tests" run configuration to include tests from submodules
- LL API tests should include LL API JDK 11 tests and, if applicable, LL
  API native tests.
2023-12-05 21:31:32 +00:00
Marco Pennekamp ee7c67ba11 [LL] Add LL API module for JDK 11 tests to support Lincheck tests
- Lincheck is compiled with JDK 11 and the `low-level-api-fir` module is
  based on the JDK 8 toolchain, so we need to add a new module with a
  JDK 11 toolchain to support Lincheck tests. We cannot bump
  `low-level-api-fir` to JDK 11 because `low-level-api-fir-for-ide`
  requires it to be based on a JDK 8 toolchain.
- Using a Gradle test suite is unfortunately not an option, because
  `low-level-api-fir-for-ide` will think that the whole
  `low-level-api-fir` module is compiled with JDK 11 if just a single
  test suite has this toolchain.

^KT-62136
2023-12-05 21:31:32 +00:00
Sergej Jaskiewicz c0c6667876 [FIR generator] Make Readme.md up-to-date 2023-12-05 20:30:22 +00:00
Sergej Jaskiewicz 8d1907e2f5 [FIR/IR generator] Introduce the common entry point for tree generators
This reduces code duplication.
2023-12-05 20:30:22 +00:00
Sergej Jaskiewicz 858343695c [FIR generator] Remove unused constant 2023-12-05 20:30:22 +00:00