Commit Graph

86457 Commits

Author SHA1 Message Date
Alexander Udalov 1c735948d1 IR: cleanup SymbolTable
Extract duplicated code, remove unused methods and unneeded OptIn.

Also, check original for descriptors only in case the symbol is not
computed yet. Checking it on every access is not needed.
2021-10-05 12:16:24 +02:00
Alexander Udalov eb28d662d4 IR: use HashMap instead of LinkedHashMap in SymbolTable
It's not important for these maps to be linked hash maps because they
are not iterated over.
2021-10-05 12:16:24 +02:00
Alexander Udalov 6e93006a94 JVM IR: slightly optimize keepTrackOfOverridesForPossiblyClashingFakeOverride
Collecting all outer classes into a hash set and looking up classifiers
in that set for each type of each fake override is noticeably slow.
Instead, check that function types reference any type parameter whose
container is a class; if the function is not local, it means such type
parameter belongs to one of the outer classes.

 #KT-42020
2021-10-05 12:16:24 +02:00
nataliya.valtman d3dc9b19b8 KT-48620: Avoid build scan listener creation without --scan property 2021-10-05 09:06:21 +00:00
Dmitriy Novozhilov a80445bf78 Add link to Kotlin Compiler Test Helper to ReadMe.md 2021-10-05 11:55:27 +03:00
Ilya Matveev 2a74f63954 [K/N][build] Fix compdb task after Gradle upgrade 2021-10-05 09:50:27 +03:00
Igor Chevdar 0cece79856 [K/N][IR][codegen] Use LazyIr for cached libraries
It's not that simple because we still need inline functions bodies
and classes fields which aren't present in Lazy IR. To overcome this,
save additional binary info for a cached library and then use it when needed
2021-10-05 10:47:52 +05:00
Igor Chevdar f865238062 [K/N][codegen] Bug fix in debug info generator 2021-10-05 10:47:33 +05:00
Igor Chevdar 3eb7d32b21 [K/N][codegen] Reworked fields building 2021-10-04 23:54:17 +05:00
Mark Punzalan 56cc40f639 FIR: Rename SAM constructor parameter name from "block" to "function".
This matches FE 1.0 (see
core/descriptors/src/org/jetbrains/kotlin/resolve/sam/samConstructorUtils.kt).
2021-10-04 19:38:44 +03:00
Mark Punzalan d16454b9af FIR: Set resolve phase to BODY_RESOLVE for SAM constructor value
parameters.

This was causing exceptions with analysis API trying to resolve the
synthetic FirValueParameter because it could not find a KtDeclaration
for it. Using BODY_RESOLVE should be safe; the SAM constructor function
is also on BODY_RESOLVE and the type of the value parameter is known.
2021-10-04 19:38:43 +03:00
Ivan Gavrilovic 32bf7f33a7 KT-49066: Use correct moduleName in the incremental compilation
When storing mapping from moduleName to module information, ensure
that values from kotlinOptions DSL objects are taken into
consideration.

Fixes #KT-49066
Test: KotlinAndroid70GradleIT.testCustomModuleName
2021-10-04 18:41:52 +03:00
Mikhail Zarechenskiy 472eceb13c Mark KtDestructuringDeclarationReference as multi reference entity
This change fixes tests related to components:
 - org.jetbrains.kotlin.idea.codeInsight.InsertImportOnPasteTestGenerated$Copy.testMultiDeclaration
 - org.jetbrains.kotlin.idea.codeInsight.InsertImportOnPasteTestGenerated$Cut.testMultiDeclaration

 Initially, it was marked as multi reference in https://github.com/JetBrains/intellij-community/blob/388ff78e61a7e0599c85b07766a03d956d7583da/plugins/kotlin/frontend-independent/src/org/jetbrains/kotlin/idea/references/KtDestructuringDeclarationReference.kt#L14

 But then this change was lost during commonization of this
implementation with FIR

 ^KTIJ-19815 Fixed
2021-10-04 18:17:18 +03:00
Igor Chevdar 232608e300 [box-tests] Added a test 2021-10-04 14:34:56 +00:00
Igor Chevdar 75d2757d3c [K/N][IR] Fix for https://youtrack.jetbrains.com/issue/KT-43210 2021-10-04 14:34:54 +00:00
Victor Petukhov 6ee1599efa Provide proxy for deprecated org.jetbrains.kotlin.resolve.calls.callUtil.getValueArgumentForExpression 2021-10-04 15:01:09 +03:00
Pavel Punegov ee65026866 [K/N][Test] Executor extension 2021-10-04 10:49:39 +00:00
Pavel Punegov 2c7a6d5f45 [K/N][Test] Add missing annotations required by Gradle 7 2021-10-04 10:49:39 +00:00
Svyatoslav Kuzmich 4dd4853c31 [Wasm] Use common StringConcatenationLowering 2021-10-04 08:51:43 +00:00
Elena Lepilkina 62dfd528e3 [K/N][perf] Added benchmarks for unsigned arrays for-loops 2021-10-04 06:12:22 +00:00
Igor Chevdar e64140af08 Added a test on unsigned arrays 2021-10-04 06:12:22 +00:00
Igor Chevdar acc1643fe4 [K/N][IR] Supported loop over unsigned array, indices, withIndex 2021-10-04 06:12:21 +00:00
Ivan Kochurkin 75b40e4b75 [FIR] Add INVISIBLE_SETTER 2021-10-03 17:10:06 +03:00
Ivan Kochurkin c97587cc53 [FIR] Fix containingClassForStaticMemberAttr initialization 2021-10-03 17:10:05 +03:00
Vladimir Dolzhenko b2afb602c5 Add InvalidModuleNotifier capability
Relates to #KT-48977
2021-10-02 14:29:25 +02:00
Sergey Bogolepov 48a26204a7 [K/N] Make xcrun failures a bit more useful 2021-10-02 09:16:53 +00:00
Sergey Bogolepov 6e2c35edf5 [K/N] Update list of optInCacheableTargets
Caches for iosArm64 and linuxX64 are promoted to stable since 1.6.0-M1.
2021-10-02 09:16:53 +00:00
Sergey Bogolepov 8dcca8dc8b [K/N] Remove obsolete dependencyPacker subproject
We have a proper LLVM distribution for users, so there is no need
for hacks anymore.
2021-10-02 09:16:52 +00:00
Svyatoslav Kuzmich fa3e75463e [Wasm] Support throwIAE and throwNoBranchMatchedException
Add a couple of test stubs
Unmute tests
2021-10-02 06:14:36 +00:00
Svyatoslav Kuzmich 6eb81517a0 [Wasm] Unmute passed Wasm tests 2021-10-02 06:14:35 +00:00
Svyatoslav Kuzmich c88cde2f8b [Wasm] DONT_TARGET_WASM_BACKEND => IGNORE_BACKEND in testdata 2021-10-02 06:14:35 +00:00
Alexander Likhachev 0eca8b9727 [Gradle] Optimize configuration time
#KT-48884 Fixed
2021-10-02 03:00:41 +00:00
Georgy Bronnikov 41e38d5a1a JVM_IR: move serialized IR to a separate annotation 2021-10-02 00:56:46 +03:00
Roman Artemev fcf44be785 [JS IR] Add test for KT-46225 2021-10-01 23:36:41 +03:00
Roman Artemev 0621b79505 Add test for KT-46225 2021-10-01 23:36:40 +03:00
Roman Artemev 38f21b7139 [JS IR] Add test to check proper type substitution 2021-10-01 23:02:24 +03:00
Roman Artemev d4ace2ffe8 [JS IR] Make sure TypeOperatorLowering is after Interop CR Lowering 2021-10-01 23:02:23 +03:00
Roman Artemev f3035ac78e [IR] Add descriptive error message instead of NPE 2021-10-01 23:02:22 +03:00
Roman Artemev 23cba59b90 [JS IR] Unmute fixed test 2021-10-01 23:02:22 +03:00
Roman Artemev fe4a25eba1 [JS IR] Use context-dependent names for lambdas
Partially fix KT-46525

Now the code like
```
fun foo(a: () -> Unit) {}
interface A {
    fun run()
}
fun main() {
    foo {
        println()
    }
    val a = object : A {
        override fun run() {
            TODO()
        }
    }
}
```

is being compiled into

```
  function foo(a) {
  }
  function A() {
  }
  A.$metadata$ = {
    simpleName: 'A',
    kind: 'interface',
    interfaces: []
  };
  function main() {
    foo(main$lambda());
    var a = new _no_name_provided_();
  }
  function main$lambda() {
    return function () {
      println();
    };
  }

  // TODO
  function _no_name_provided_() {
  }
  _no_name_provided_.$metadata$ = {
    kind: 'class',
    interfaces: [A]
  };
```
2021-10-01 23:02:21 +03:00
Roman Artemev 76e08356d8 [JS IR] Change logic of InteropCallableReferenceLowering a bit
Now it first transforms Lambda classes and after fixes the call sites
2021-10-01 23:02:12 +03:00
Roman Artemev 693a5740c1 [JS IR] Disable pir tests by default 2021-10-01 23:02:11 +03:00
Roman Artemev 7ec593b22a [JS IR] Inline lambda class into its interop wrapper 2021-10-01 23:02:10 +03:00
Roman Artemev a1b223e33d [JS IR] Set proper statement origin for bound receiver save 2021-10-01 23:02:09 +03:00
Victor Petukhov abd2507107 Don't discriminate generics during callable references resolution
^KT-49038 Fixed
2021-10-01 22:09:33 +03:00
Victor Petukhov 23f6c29efc Provide some additional proxies for external use of deprecate package org.jetbrains.kotlin.resolve.calls.callUtil
Provided API is `getCalleeExpressionIfAny` and `createLookupLocation`
2021-10-01 19:29:44 +03:00
Tianyu Geng 154ceaa89f FIR: Make default visitor only visit single parent 2021-10-01 18:57:35 +03:00
Tianyu Geng 263f6b1fd8 FIR: generate FirDefaultVisitor and FirDefaultVisitorVoid...
so they won't be outdated when FIR class tree is updated.
2021-10-01 18:57:34 +03:00
Jinseong Jeon 8f3b06ac06 RAW FIR: record annotations on destructuring declarations 2021-10-01 18:54:16 +03:00
Jinseong Jeon 464eecef03 FIR IDE: add more tests about annotation resolution 2021-10-01 18:54:14 +03:00