Commit Graph

98163 Commits

Author SHA1 Message Date
Sergey Bogolepov 362cff892b [K/N] Code cleanup 2023-01-26 14:32:49 +00:00
Sergey Bogolepov 0b4db4beca [K/N] Fix ALL phases value 2023-01-26 14:32:48 +00:00
Sergey Bogolepov 9f4e086ff9 [K/N] Fix filecheck tests 2023-01-26 14:32:48 +00:00
Sergey Bogolepov 851d84a865 [K/N] Enable proper LLVM IR dump and verify actions
Also introduce -Xsave-llvm-ir-directory argument
that should be used instead of -Xtemporary-files-dir
as a location for LLVM IR from phases.
Motivation for this change: it is simpler to implement
and unties LLVM actions from the awful TempFiles class.
2023-01-26 14:32:48 +00:00
Sergey Bogolepov 0febffedbd [K/N] Add LlvmIrHolder adapter interface for debugging purposes
Similar to KotlinBackendIrHolder and BackendContextHolder interfaces.
2023-01-26 14:32:47 +00:00
Sergey Bogolepov 60ff50dc51 [K/N] Enable IR validation and dumping for more phases 2023-01-26 14:32:47 +00:00
Sergey Bogolepov 10f9000d46 [K/N] Add utility adapter interfaces for flexible phase processing
In the new dynamic driver we have various contexts, inputs and outputs.
To make it possible to validate and dump IR uniformly, we need a couple
of adapter interfaces that will be accessed from phase actions.
2023-01-26 14:32:46 +00:00
Sergey Bogolepov c828ac6167 [K/N] Re-enable lowering prerequisites 2023-01-26 14:32:46 +00:00
Sergey Bogolepov 4c11f6ff30 [K/N] Normalize lowering names 2023-01-26 14:32:46 +00:00
Sergey Bogolepov 5d44f01a88 [K/N] Remove old ToplevelPhases.kt
It contains only commented CheckSamSuperTypes phase which is disabled
for quite some time. If we ever need this lowering again it could be
found in this commit.
2023-01-26 14:32:45 +00:00
Sergey Bogolepov d7e44dc46a [K/N] Port lowerings from old builders to the new ones 2023-01-26 14:32:45 +00:00
Sergey Bogolepov f9d0755f94 [K/N] Introduce more createFileLoweringPhase overloads
They simplify porting from the old builders
2023-01-26 14:32:45 +00:00
Sergey Bogolepov fafa2b1a67 [K/N] Support prerequisites in phase builders 2023-01-26 14:32:44 +00:00
Sergey Bogolepov 32a265a7eb [IR] Lift restrictions on phase prerequisites
Allow depending on phases of different "types".
2023-01-26 14:32:44 +00:00
Sergey Bogolepov 1ffef21ce5 [K/N] Untie WriteBitcodeFilePhase from NativeGenerationState 2023-01-26 14:32:44 +00:00
Sergey Bogolepov a7518fed73 [K/N] Remove obsolete file 2023-01-26 14:32:43 +00:00
Bogdan Mukvich e988ac20f0 Update dokka 1.8.0-dev with OOM fixes 2023-01-26 14:13:19 +00:00
Kirill Rakhman 583584be7e FIR: Resolve error expression in initializer of FirField
^KT-54775 Fixed
2023-01-26 14:12:48 +00:00
Pavel Punegov 156c2db855 [K/N][test] Fine tune the Maven downloading test
Only final builds (without build number) should be placed to Central.
Don't run the test for these builds while they are not published there.

Merge-request: KT-MR-8491
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-01-26 14:04:46 +00:00
Alexander Shabalin dd9b0f9fa5 [K/N] Fix custom allocator ^KT-55364
* Make CustomFinalizerProcessor mirror the existing FinalizerProcessor
* Fix Heap::PrepareForGC in custom allocator

Merge-request: KOTLIN-MR-616
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-01-26 14:03:30 +00:00
pyos f8f63f4573 FIR CFA: fix function locality check 2023-01-26 13:12:16 +00:00
pyos 1d9a1e979a FIR CFA: skip member function graphs when looking for member assignments
Shouldn't affect the result, since in member functions all properties
are assumed to be initialized so the CFG is not needed for reporting
VAL_REASSIGNMENT.
2023-01-26 13:12:16 +00:00
pyos f118c94110 FIR: refactor CanBeValChecker 2023-01-26 13:12:15 +00:00
pyos 86b6b184de FIR: move checkPropertyAccesses to FirPropertyInitializationAnalyzer 2023-01-26 13:12:15 +00:00
pyos 6040053961 FIR: remove unused code from LocalPropertyAndCapturedWriteCollector 2023-01-26 13:12:14 +00:00
pyos 99e51f6940 FIR: check assignments and references to members in constructors
I.e. emit VAL_REASSIGNMENT on repeated assignments to `this.something`,
UNINITIALIZED_VARIABLE on reads of it before any assignment if there is
no initializer, and CAPTURED_MEMBER_VAL_INITIALIZATION on assignments
inside non-called-in-place functions and named classes.

^KT-55528 Fixed
2023-01-26 13:12:13 +00:00
pyos 8f45acd71d FIR: remove deadness-related hacks from FirMemberPropertiesChecker
Pretty sure the changes I've made to class graph construction should've
made it so that deadness is propagated through to each member's graph
correctly.
2023-01-26 13:12:13 +00:00
pyos c42dd0848e FIR: only allow member val initialization through this@T
class C {
    val x: Int
    init {
      // valid ways to initialize:
      x = 1
      this@C.x = 1
      // invalid:
      someOtherC.x = 1
      run { /*this@run.*/x = 1 }
      val self = this
      self.x = 1
    }
  }
2023-01-26 13:12:12 +00:00
pyos 123b211fc4 FIR: simplify FirMemberPropertiesChecker
Now that there are correct control flow edges between constructors,
collecting the data is as simple as going over the entire initialization
graph.
2023-01-26 13:12:12 +00:00
pyos 166ddd9ea9 FIR CFA: make node unionness a runtime property
Class exit node should only unify data flow if it is an anonymous
object, in which case it only has one control flow input. Coversely,
any other class exit node has normal merge semantics for its control
flow inputs, but it won't have any data flow inputs.
2023-01-26 13:12:11 +00:00
pyos 9f17b5de97 FIR CFA: add edges according to constructor delegation 2023-01-26 13:12:11 +00:00
Igor Chevdar 29b7a8e435 [K/N] Supported ..< operator for BCE optimization 2023-01-26 12:54:19 +00:00
Nikolay Krasko f87c5cf166 Minor: add bash language to dependency verification block 2023-01-26 13:34:37 +01:00
Victor Turansky c2232dc789 Copy button for repositories 2023-01-26 13:34:36 +01:00
Alexander Udalov 4b0d878873 Change KaptFlag.USE_JVM_IR default value to true
According to the comment on `Kapt3GradleSubplugin.BooleanOption` and the
change in a7b1bade85.

 #KT-53135
2023-01-26 12:07:19 +00:00
Alexander Udalov 574b9b76cd Add test checking that JVM_IR is enabled/disabled in kapt
#KT-53135
2023-01-26 12:07:19 +00:00
Ilya Chernikov 62f2a09d70 FIR: fix use-site file in supertypes resolution
manifested in the IC tests by a seemingly redundant lookup,
although theoretically may lead to more severe issues.
Also fixes lookup recording ignoring logic, since the old
one may break with the new us-site file calculation.
#KT-55195 fixed
2023-01-26 11:56:21 +00:00
Ilya Chernikov dcbcc8b684 minor: restoring proper functioning of non-LT tests 2023-01-26 11:56:21 +00:00
Stanislav Ruban 7e0f69b8de Introduce tweaks and wording changes related to LV2.0-specific CLI warnings
Fix merge conflict related to renaming of one of the tests

Regenerate tests affected by previous commit

Fix merge conflict related to renaming of one of the tests

Improve wording of the `-Xuse-k2 -language-version 1.*` CLI warning

Improve wording of LV2.0-specific CLI warnings some more

Fix output of one of the tests for -Xuse-k2 deprecation

Tweak wording of LV2.0-specific CLI warnings

* make it clear in every warning that -Xuse-k2 is deprecated
* add a reminder to remove -Xuse-k2 for `-Xuse-k2 -language-version 2.0`
* add both possibly wanted fixes for `-Xuse-k2 -language-version 1.*`

Remove deprecated -Xuse-k2 flag from one of the tests

Merge-request: KT-MR-8449
Merged-by: Stanislav Ruban <Stanislav.Ruban@jetbrains.com>
2023-01-26 11:55:03 +00:00
Kirill Rakhman f6c189be7b FIR: Handle visibility of public setter of protected synthetic property like in K1
K1 allows writing access to a public setter of a protected synthetic
property only if the call is inside a subclass. K2 previously allowed
that unconditionally. This changes brings the behavior in line with K1.

^KT-56050 Fixed
2023-01-26 11:33:30 +00:00
Vladimir Sukharev 1990883bdc [K2/N] KT-55464, KT-56091 Fix various klib annotations, including critical ones
Merge-request: KT-MR-8457
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-26 11:15:15 +00:00
Mikhail Zarechenskiy 53967a1822 Update and simplify readme section about working with Intellij 2023-01-26 10:39:59 +00:00
Sebastian Sellmair d9957335d3 [Gradle] Don't fail when psm is missing from a given included build
This basically restores behaviour as before changes related to
the configuration cache support

See:
https://github.com/JetBrains/kotlin/blob/35dacd6add18e031902765fd1386f9f8aad7e738/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/KotlinProjectStructureMetadata.kt#L427

^KT-56198 Verification Pending
2023-01-26 10:25:20 +00:00
Sebastian Sellmair 6fae581ffb [Gradle][Minor] IdeaKotlinClasspath: Improve .toString() readability
KT-56198
2023-01-26 10:25:20 +00:00
Sebastian Sellmair 2bda0c0c57 [Gradle] Implement test covering KT-56198 (composite: mpp-jvm to jvm) 2023-01-26 10:25:19 +00:00
pyos 8aa50e9446 FIR CFA: add edges from maybe-throwing statements to catch/finally 2023-01-26 09:50:24 +00:00
Alexander Udalov ef208d9eac Throw if kotlinx-metadata-jvm version in jvm-abi-gen is too low 2023-01-25 23:24:05 +01:00
Sebastian Sellmair 85473068c9 [Gradle][Minor] Improve readability of SourceSetVisibilityProvider 2023-01-25 20:07:52 +00:00
Artem Daugel-Dauge b1b744b863 [Gradle] Provide granular Gradle warnings suppression for CocoaPodsIT
^KT-56162 Fixed
2023-01-25 18:45:23 +00:00
Marco Pennekamp 2922f85a98 [AA] KTIJ-23563 Add reference resolve tests for working cases
- Type arguments in invalid calls/property accesses are resolved
  correctly in many cases, for which this commit adds test cases.
2023-01-25 16:40:46 +00:00