Commit Graph

40356 Commits

Author SHA1 Message Date
Dmitry Gridin d1eec4cc37 [light classes] move PsiElementWithOrigin to light-classes-base module
^KT-53097
2022-07-19 15:41:19 +00:00
Dmitry Gridin 521feb3267 [light classes] move KotlinAsJavaSupport to light-classes-base module
^KT-53097
2022-07-19 15:41:19 +00:00
Dmitry Gridin 871bf5edd1 [light classes] move KtFakeLightClass to light-classes-base module
^KT-53097
2022-07-19 15:41:18 +00:00
Dmitry Gridin a8dc871418 [light classes] move KtLightAbstractAnnotation to light-classes-base module
^KT-53097
2022-07-19 15:41:17 +00:00
Dmitry Gridin ed7299181c [light classes] move implUtils to light-classes-base module
^KT-53097
2022-07-19 15:41:17 +00:00
Dmitry Gridin 16e84b2c4d [light classes] move ImpreciseResolveResult to light-classes-base module
^KT-53097
2022-07-19 15:41:16 +00:00
Dmitry Gridin c7dbe901f5 [light classes] move KtLightElementBase to light-classes-base module
^KT-53097
2022-07-19 15:41:15 +00:00
Dmitry Gridin cd9bb800e5 [light classes] move KtLightClassForFacade to light-classes-base module
^KT-53097
2022-07-19 15:41:14 +00:00
Dmitry Gridin 8014f76eaa [light classes] move KtLightClass to light-classes-base module
^KT-53097
2022-07-19 15:41:13 +00:00
Dmitry Gridin db1cc9d807 [light classes] move KtLightElements to light-classes-base module
^KT-53097
2022-07-19 15:41:13 +00:00
Dmitry Gridin 14590310fa [light classes] introduce light-classes-base module
^KT-53097
2022-07-19 15:41:12 +00:00
Ilya Kirillov d04bd320f9 [LL FIR] ignore test failing due to ^KT-53242 2022-07-19 17:17:35 +02:00
Ilya Kirillov dbfeeae696 [fir] add more info to the error message in FirModuleData 2022-07-19 17:17:32 +02:00
Yahor Berdnikau 93a0cdbf97 Improve warnings and errors emitted by compiler in Gradle build
Make warnings and errors location clickable by using file URI scheme.
In most terminals and code editors (including IDEA) clicking on such uri
will open file at given line and offset.

^KT-51923 Fixed
2022-07-19 09:30:36 +00:00
Kristoffer Andersen 8d79fab109 Change BACKING_FIELD_REQUIRED from SetSlice 2022-07-18 23:50:35 +02:00
Kristoffer Andersen f0bc021b5e Change VARIABLE_REASSIGNMENT slice so it composes properly 2022-07-18 23:50:35 +02:00
Dmitriy Dolovov 532b9e2c5f [Native][IR] Partial linkage support for cached inline functions
- Support partial linkage for declarations from inline functions that are lazily deserialized from a KLIB with static cache
- Linker API: Split IrModuleDeserializer.deserializeIrSymbol() into deserializeIrSymbolOrFail() and tryDeserializeIrSymbol()
- Linker API: Refactor KotlinIrLinker.handleSignatureIdNotFoundInModuleWithDependencies() to deserializeOrReturnUnboundIrSymbolIfPartialLinkageEnabled()

^KT-52478
2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 7c40fd31e3 [IR] Optimize SymbolTable.allUnbound 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 6a227236f8 [IR] Fix location in logging warnings about unlinked symbols 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov f9d7f54838 [IR] Fix unlinked type for variables 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 2cf5d26edc [IR] JsIrLinker: Drop excessive maybeWrapWithBuiltInAndInit() function
^KT-52478
2022-07-18 17:29:50 +02:00
Dmitriy Dolovov ce04a24b26 [IR][tests] Removal of class used as variable type and constructor call 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov d5ded97ccb [IR][tests] Removal of inlined class case
^KT-52478
2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 7b5e33b6ca [IR][tests] Add tests for removal-of-typealias case 2022-07-18 17:29:49 +02:00
Dmitriy Dolovov 89a188d199 [IR][tests] Add tests for remove-inlined-callable member case 2022-07-18 17:29:49 +02:00
Dmitriy Dolovov 9c1c712057 [IR][tests] Add tests for removal-of-overridden open callable case 2022-07-18 17:29:49 +02:00
Pavel Mikhailovskii 846537b367 KT-45375 Lightweight lambdas; KT-52817 introduce @JvmSerializableLambda 2022-07-18 17:10:07 +02:00
Alexander Udalov bd0fe2f146 Remove dependency of compiler tests on fir2ir tests
Compiler tests use the old test infrastructure, but fir2ir tests use the
new one (tests-common-new). Removing this dependency means that now the
two big modules, `:compiler:compileTestKotlin` and
`:compiler:tests-common-new:compileTestKotlin` can be compiled in
parallel, which improves the total build time.
2022-07-18 13:13:01 +02:00
Pavel Mikhailovskii fd5800e8b5 KT-53090 Support -Xlambdas=indy for anonymous functions 2022-07-18 08:18:05 +00:00
Alexander Udalov b50d2ff20a Revert "JVM IR: Move direct invoke optimization into a separate pass"
This reverts commit f0760e0550.

The reason is that it leads to KT-53202.
2022-07-15 18:29:07 +02:00
Pavel Kirpichenkov 3051c36780 [MPP] add extension for non-HMPP common KLIBs
Add an analysis parameter that can be used to create a
package fragment provider for a common KLIB library
when composite analysis aka HMPP support in IDE is disabled.
Such KLIBs can appear since 1.6.20, when hierarchical
project structure was enabled by default. This means, that even
if HMPP is explicitly disabled in KGP via the Gradle property,
common code is still represented by KLIBs and not by
.kotlin_metadata as it used to be. IDE can't resolve
agains common KLIB dependencies without a corresponding
package fragment provider that can read KLIB libraries.

KT-53164
2022-07-15 12:37:50 +00:00
Hung Nguyen 5b6afef67d Rename ICReporter.report/reportVerbose to info/debug
to make it clear what severity levels they are mapped to.

^KT-52839 Fixed
2022-07-15 10:48:34 +00:00
Hung Nguyen e01c2bc651 Warn in Gradle log when incremental compilation fails
When incremental compilation fails, we currently log it at the `debug`
level (and fall back to non-incremental compilation). This commit will
change it to `warning` so that we can get more user reports, which will
allow us to fix the root cause.

Also make sure the warning includes a stack trace.

Additionally, let ReportSeverity.fromCode() return a non-null value
or throw an exception otherwise as that case is not expected.

^KT-52839 In Progress
2022-07-15 10:48:34 +00:00
Mikhail Glukhikh 623f832bfd FIR: fix private-to-this corner case with outer class type parameter
Related to KT-49875
2022-07-15 07:57:42 +00:00
Mikhail Glukhikh d16e5e5e50 FIR: Support checking PRIVATE_TO_THIS visibility #KT-49875 Fixed 2022-07-15 07:57:41 +00:00
Mikhail Glukhikh 83200f8774 FIR: Support inferring PRIVATE_TO_THIS visibility see KT-49875 2022-07-15 07:57:41 +00:00
Alexander Udalov 3b613b3745 Fix some tests related to direct invoke optimization
- Fix test data of light class tests
  (SymbolLightClassesForLibraryTestGenerated).
- Revert the changes in kt8666.kt because they fail on JS IR, and it
  seems that this test is mostly needed for JS anyway.
- Use 'invoke(' as the pattern in bytecode text tests because plain
  'invoke' is used when these tests are run on JDK 11, where indy string
  concatenation is enabled by default and therefore we reference
  `java/lang/invoke/StringConcatFactory`.
2022-07-15 02:29:01 +02:00
Steven Schäfer 8014712569 JVM IR: Check that we generate callable references in tests 2022-07-14 23:24:18 +02:00
Steven Schäfer 2acfb3a41f JVM IR: Avoid direct lambda invokes in inline tests 2022-07-14 23:24:18 +02:00
Steven Schäfer f0760e0550 JVM IR: Move direct invoke optimization into a separate pass
This also changes the transformation to inline the body of a directly
invoked lambda rather than producing a call to an anonymous local
function. The latter is unsupported in inline functions and problematic
from an ABI perspective, since it results in functions whose name
depends on the entire source code up to this point.
2022-07-14 23:24:18 +02:00
Steven Schäfer 7d59c7689c JVM IR: Avoid direct invokes in callable reference tests
Due to the direct invoke optimization, most callable reference tests
were not generating callable references/lambdas.
2022-07-14 23:24:18 +02:00
Steven Schäfer f0238766df JVM IR: Avoid patchDeclarationParents after inlining
The code in IrInlineUtils.kt already updates declaration parents.
2022-07-14 23:24:18 +02:00
Stanislav Erokhin a18ac2ac91 Restore JvmIrCodegenFactory constructor for compatibility with AS 221 2022-07-14 16:30:12 +00:00
Denis.Zharkov 9f84e7651b Add issue link to deprecation warning message
^KT-29168 Fixed
2022-07-14 13:04:35 +00:00
Alexander Likhachev 5cae57cf28 [IC] Flush incremental caches on close
#KT-53168 Fixed
2022-07-14 12:55:30 +00:00
Aleksei.Cherepanov 0950205a47 [IC] Add test for lookups flushing
#KT-53168
2022-07-14 12:55:29 +00:00
Pavel Mikhailovskii b26155dd9e KT-53007 Fix accessibility checks when calling a protected member via super@Outer 2022-07-14 13:09:42 +02:00
Yahor Berdnikau 603d043abc Move Kotlin/Native compiler arguments into :compiler:cli:cli-common
This allows to reference them in the Gradle plugins without enabling
kotlin-native part of the repository

^KT-53108 In Progress
2022-07-14 10:57:28 +00:00
Mikhail Glukhikh 13713323cf Make FirRenderer inherit FirRendererComponents instead of FirPrinter
#KT-53024 Fixed
2022-07-14 09:38:46 +00:00
Mikhail Glukhikh 7ce5100946 FirRenderer: slightly change/refactor declaration rendering 2022-07-14 09:38:45 +00:00