Commit Graph

97621 Commits

Author SHA1 Message Date
Artem Kobzar 6a6308bef2 [K/JS] add miss StartProjection for the substitution inside lowerings ^KT-55852 Fixed 2023-01-13 13:28:42 +00:00
Mikhail Glukhikh 9542a8a07a Inherit LowLevelFirFrontendFacade from FirFrontendFacade to remove duplicates 2023-01-13 12:56:01 +00:00
Ivan Kochurkin c9a8f433fb [FIR2IR] Temporary fix of createIrEnumEntry
Check if a bound entry with the same signature is already exist
2023-01-13 12:56:01 +00:00
Mikhail Glukhikh ecc81098a6 Unbind FIR mangler from use-site session (by Simon Ogorodnik) 2023-01-13 12:56:01 +00:00
Mikhail Glukhikh 2237c964b5 ExpectActualCollector: pass parent isExpect through visitor to save perf 2023-01-13 12:56:00 +00:00
Mikhail Glukhikh a1f051acf1 Fir2IrLazyProperty: drop unnecessary accessor rebinding attempts 2023-01-13 12:56:00 +00:00
Mikhail Glukhikh 890e3d1c10 FIR2IR/MPP: use single SymbolTable during MPP compilation 2023-01-13 12:56:00 +00:00
Mikhail Glukhikh 33daca6809 FIR2IR: don't merge symbol tables as it's no more needed 2023-01-13 12:55:59 +00:00
Mikhail Glukhikh 6b7a5c9aa0 FIR2IR: don't create a new symbol table for conversion with dependents 2023-01-13 12:55:59 +00:00
Mikhail Glukhikh 52a3ba6aae FIR2IR: split local storage to separate class/callable storages 2023-01-13 12:55:58 +00:00
Ivan Kochurkin 31e2f0ba95 [FIR][Serialization] Set containingClassForStaticMemberAttr in generateConstructors 2023-01-13 12:55:58 +00:00
Ivan Kochurkin 8936220876 [IR] Implement IR actualizer and use it for K2 test and CLI scenario
Implement calculateExpectActualMap for Fir2IrComponents

^KT-51753 Fixed
2023-01-13 12:55:58 +00:00
Ivan Kochurkin 15ad9d134c [IR] Fix isProperExpect for IrTypeParameter 2023-01-13 12:55:57 +00:00
Ivan Kochurkin f17e1314f6 [FIR2IR] Implement tables merging in Fir2Ir classes and SymbolTable
- Pass dependent (usually common code) components to further FIR2IR converters
- Don't reinitialize builtin
2023-01-13 12:55:57 +00:00
Ivan Kochurkin 5d273ce839 [FIR & FIR2IR] Prepare test and CLI infrastructure to support MPP
- Move out getAnalyzerServices from FirFrontendFacade to TestSetupUtils
- Simplify DependencyListForCliModule. Now it takes BinaryModuleData as input
- FirOutArtifact contains several FirOutputArtifactPart
- Simplify FirFrontendFacade
2023-01-13 12:55:57 +00:00
Ivan Kochurkin 3029e47609 [FIR] Add BinaryModuleData 2023-01-13 12:55:56 +00:00
Ivan Kochurkin 80aafe5437 [FIR] FirModuleDescriptor: read platform from session.moduleData 2023-01-13 12:55:56 +00:00
Ivan Kochurkin 041f9c4700 [Testing] Simplify test functions 2023-01-13 12:55:56 +00:00
Ivan Kochurkin bcfdbaa6a6 [FIR] Use ModuleCompilerAnalyzedOutput instead of FirResult
Remove FirResult since it has the same semantics value
2023-01-13 12:55:55 +00:00
Kirill Rakhman 57dda3bf92 FIR: fix FirAnnotationChecker for FirProperty
This change is necessary for testTypeAliasExpansionRepeatedAnnotations
to work properly (otherwise we don't check a property at all). Before
current changes, the test worked thanks to accessors analysis which is
now OFF because of source kind check.
2023-01-13 12:54:18 +00:00
Kirill Rakhman 5a08d8da8d FIR: don't check annotations on returnTypeRefs that are not of real kind
This fixes an exception in FirAnnotationChecker where we tried to report
repeated annotations on implicit type refs that have no source.
2023-01-13 12:54:18 +00:00
Vladimir Sukharev c0961e91b8 [K2/N] KT-55598: Run special backend checks in K2/Native pipeline
Merge-request: KT-MR-8204
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-13 09:57:11 +00:00
Mads Ager 6b01886334 [K/N] Avoid string copying when setting up bridge debug info.
The name of the function was copied at least 4 times. This reduces
a 56 seconds codegen phase in a non-optimized build by 2 seconds.
2023-01-13 09:28:31 +00:00
Sebastian Sellmair ef1e4662f1 [Gradle] Remove unnecessary sourcesElementsPublishedConfiguration from external target API 2023-01-13 08:59:51 +00:00
Vladimir Sukharev 45de88abae [K/N][KT-39120] Build platform libraries with -fmodules
Merge-request: KT-MR-8175
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-13 07:33:42 +00:00
Alexander Udalov d85b23ebb9 Kapt+JVM_IR: do not attempt to transform error types in InsertImplicitCasts 2023-01-13 02:38:40 +01:00
Alexander Udalov 690fe7ac9a Kapt+JVM_IR: support error types in suspend functions
JVM IR generates the continuation parameter with the name `$completion`
instead of `continuation`.
2023-01-13 02:38:40 +01:00
Alexander Udalov 4f2551497d Kapt+JVM_IR: do not require KtFile for each generated class
In particular, JVM IR doesn't provide KtFile for a multifile facade in
JvmDeclarationOrigin (JVM backend provides KtFile of a random multifile
part). This led to multifile classes being completely ignored in the
JVM_IR version of kapt. Now they are generated correctly and the changed
test passes, but there's a _ir.txt expectation file because the order of
'foo' and 'bar' is different (which is not a problem).
2023-01-13 02:38:40 +01:00
Alexander Udalov 725c066c78 Kapt: dump declaration origins produced by backend
This will be useful in diagnosing behavior differences between JVM and
JVM_IR versions of kapt.
2023-01-13 02:38:40 +01:00
Alexander Udalov 6d0628900e Kapt+JVM_IR: support annotations with error types
This is a hack to implement KT-32596 in the JVM IR version of kapt.
Basically we allow psi2ir to generate annotations whose classifier is
error class, which happens when it's unresolved. Because there's no
physical IR for an error class, we create stub IR for it via
SyntheticDeclarationsGenerator in case we'll need it.

With this hack, annotations with unresolved classifiers magically
survive all the way until the codegen (with a minor change in
IrBasedDescriptors) where they are generated as
`@error.NonExistentClass`, which then gets corrected by the kapt's
"correct error types" mode as in all other cases of error types.
2023-01-13 02:38:40 +01:00
Alexander Udalov 4a91957ff0 Kapt+JVM_IR: fix "correct error types" mode for delegated properties
Use the property as PSI element origin for delegated property accessors
and field in JVM IR as it is done in the old JVM backend. Otherwise kapt
"correct error types" mode can't find the property type and thus cannot
succeed in "resolving" it, which led to java.lang.Object being used as a
fallback.

Note that in the unmuted test, .txt and _ir.txt dumps differ only in an
unrelated NotNull annotation on a delegate field.

See also KT-37586 for some related changes which fixed this problem
initially in kapt.
2023-01-13 02:38:40 +01:00
Alexander Udalov 549bfb2d9e Kapt+JVM_IR: generate annotation property initializers
#KT-55490 Fixed
2023-01-13 02:38:40 +01:00
Alexander Udalov 1a5aedd27a Kapt+JVM_IR: unignore some tests 2023-01-13 02:38:39 +01:00
Pavel Mikhailovskii 38a56ba8e8 KT-55308, KT-55769 Sort InnerClasses entries. Add DONT_SORT_DECLARATIONS directive 2023-01-13 01:07:10 +00:00
Hung Nguyen 63a0660cc3 IC: Close caches before falling back to non-incremental compile
Previously, we didn't close caches if incremental compilation failed.
The assumption was that we would fall back to non-incremental
compilation, where it shouldn't matter whether caches were closed or not
as non-incremental compilation should be able to recover from a
corrupted state of the caches.

However, this choice might have caused issues such as KT-55709 where
non-incremental compilation fails after fallback.

In this commit, we will now always close the caches before falling back,
just to be safe.

TODO:
  1. We'll need to verify whether not closing the caches was the actual
     cause of KT-55709, and that this commit fixes it.
  2. Even if this commit fixes the issue, we'll need to see why
     non-incremental compilation fails to recover from unclosed caches
     (it would remain unsafe if that was not addressed).

^KT-55709 In progress (see TODO #1 above)
2023-01-13 00:00:42 +01:00
Artem Kobzar 7156200953 [K/JS] serialize enum entries as a byte instead of int 2023-01-12 21:15:01 +00:00
Igor Chevdar df778b8a6e [K/N] Pass transitive dependencies for forked caching compilation 2023-01-12 19:59:37 +00:00
Pavel Mikhailovskii e2618ca9d3 Delete accidentally added code 2023-01-12 20:50:11 +01:00
Artem Daugel-Dauge 1216c39865 Supress Gradle warnings for some macos tests as a workaround for KT-55751
Merge-request: KT-MR-8277
Merged-by: Artem Daugel-Dauge <Artem.Daugel-Dauge@jetbrains.com>
2023-01-12 19:47:21 +00:00
Svyatoslav Scherbina ed9f5497fb Native: remove unused code 2023-01-12 17:52:11 +00:00
Svyatoslav Scherbina d096641ddb K2: fix cinterop signature computation in Native 2023-01-12 17:52:10 +00:00
Svyatoslav Scherbina b7c336217f K2: fix accept() impl for IrBasedPropertyAccessorDescriptor
Otherwise IdSignatureDescriptor computes wrong signatures for such
descriptors.
2023-01-12 17:52:10 +00:00
Dmitriy Novozhilov 1984a1615e [Serialization] Use new DSL for generating declarations 2023-01-12 17:45:41 +00:00
Dmitriy Novozhilov 5fedb2f72d [Parcelize] Use new DSL for generating declarations 2023-01-12 17:45:41 +00:00
Dmitriy Novozhilov 3744878b6d [FIR Plugin prototype] Use new DSL for generating declarations 2023-01-12 17:45:40 +00:00
Dmitriy Novozhilov 42db0b14f0 [FIR] Move all type construction utilities into one file 2023-01-12 17:45:40 +00:00
Dmitriy Novozhilov ce8489a8a5 [FIR] Add ability to create accessor to declaration attribute on symbol 2023-01-12 17:45:40 +00:00
Dmitriy Novozhilov 185e57e601 [FIR] Introduce builders API for generating declarations in compiler plugins
^KT-53096 Fixed
2023-01-12 17:45:39 +00:00
Dmitriy Novozhilov 6783621eb0 [FIR] Change API for generating nested classes from plugins
`FirDeclarationGenerationExtension.generateClassLikeDeclaration` was split
  into two functions: one for generating top level classes, and one for
  nested classes. Such change reduces verbosity and error-proness of
  this extension and also allows to smoothly run plugins on local classes

^KT-55248 Fixed
2023-01-12 17:45:39 +00:00
Dmitriy Novozhilov faa96ec7c0 [AA LC] Don't create light methods if value class is present in signature
^KT-55788

Test `parameter_jvmInline.kt` is removed because now members with value
  classes are not included in light classes and don't have PSI representation
2023-01-12 17:45:10 +00:00