Commit Graph

170 Commits

Author SHA1 Message Date
Vladimir Sukharev f9df4e1487 [K/N] Reorder hashCode, toString, equals in data classes to match K1 order
^KT-60247 Fixed

Merge-request: KT-MR-11080
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-07-18 00:06:48 +00:00
Sergej Jaskiewicz 5e63f7627f [klib] Test signature descriptions in irText tests
KT-59486
2023-07-14 20:26:45 +00:00
Dmitriy Novozhilov 6bb7fc05df [IR] Split implementation of DataClassMembersGenerator to IR based and descriptor based 2023-07-05 14:57:55 +00:00
Sergej Jaskiewicz addb048ce9 [FIR] Generate signatures for synthesized class delegation fields
This is to align the behavior with K1.

^KT-57754 Fixed

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2023-06-26 12:39:37 +00:00
Ivan Kylchik dd264cff50 [IR] Split const folding into necessary one and for optimizations only
In this commit we have a lot of change in test data. This was caused
by the way where we evaluate constants. We split constant evaluation
into two distinct parts: only necessary evaluations for `fir2ir`
(like const val and annotations) and optimizations for lowering.
Now we don't do all constant evaluation on `fir2ir`, but IR
dump is executed after this phase, so test data changed.

#KT-58923
2023-06-14 19:02:39 +00:00
Kirill Rakhman 67fc46a190 [FIR] Fix handling of type parameters in FIR mangling
#KT-57429 Fixed
2023-06-09 08:22:21 +00:00
Sergej Jaskiewicz fd76a34277 [IR] Don't print flags in declaration references in irText tests
This doesn't reduce the quality of tests, because the flags are still
printed for declarations themselves. We only omit them in references.

However, this makes the tests more compatible with non-JVM backends
(see KT-58605), because flags of referenced stdlib declarations may
differ among target platforms.
2023-05-30 17:26:30 +00:00
Sergej Jaskiewicz 02180e8685 Factor out duplicated mangling logic for functions into the base class
^KT-57777 Fixed
^KT-57818 Fixed
2023-05-26 10:55:24 +00:00
Sergej Jaskiewicz 5d3fe7547a [IR] Fix mangling generic properties from IR-based descriptors
For type parameters of generic properties,
`DeclarationDescriptor#getContainingDeclaration` must return
the property descriptor instead of the accessor function descriptor.

^KT-57436 Fixed
2023-05-24 09:58:39 +00:00
Sergej Jaskiewicz 56f977f70c [IR] Don't render facade classes in JVM fq-names in irText tests
This makes the tests more compatible with non-JVM backends
(see KT-58605)
2023-05-17 12:43:35 +00:00
Sergej Jaskiewicz 6e8283a6fe [IR] Dump IdSignatures and mangled names in irText tests
The reason #1 for this feature is that we want to test IdSignatures
generated for declarations. Currently, there is no (easy) way to ensure
that a change in the signature building logic doesn't cause any breaking
changes wrt klibs.

Now, most IdSignatures include hashed mangled names in them, so even if
we catch a regression where the included hash changes, there would be no
way of knowing immediately what caused it, unless we'd also have mangled
names in the expectations.

The reason #2 is to test the manglers themselves. Currently, there are
no tests for them. They heavily duplicate each other, this is already
causing issues (see KT-57427) that would be very hard to catch without
these tests.

^KT-58238 Fixed
2023-05-15 18:20:45 +00:00
Mikhail Glukhikh 1ba900be44 FIR2IR: change origin & operator flag in data classes making them closer to K1
Related to KT-54887
2023-05-15 08:16:24 +00:00
Sergej Jaskiewicz 89ff7bd0db [IR] Add body printing strategy to Kotlin-like dumper 2023-05-04 14:11:19 +00:00
Sergej Jaskiewicz 4b6975c3d0 [fir2ir] Set origins for componentN and copy methods of data classes
This aligns the behavior with psi2ir.
2023-04-06 14:45:47 +00:00
Ivan Kylchik 63b340651d Add possibility to interpret and fold IrStringConcatenation expression 2023-03-24 15:55:06 +00:00
Sergej Jaskiewicz 27ccef868a [test] Run irText tests against K1 frontend for JS 2023-03-22 15:18:17 +00:00
Dmitriy Novozhilov 88efa6bfb6 Update tests after switching to LV 1.9 2023-01-30 09:29:57 +00:00
Kirill Rakhman 69f2e8826a FIR: fix a bunch of issues after DiagnosticsReporter refactoring related to reporting diagnostic on null source 2023-01-11 08:30:36 +00:00
Steven Schäfer a7ba081d22 FIR: Fix interface delegation ABI
- Unifies the name of the `$$delegate_<n>` field between K1 and K2.
- Make the `$$delegate_<n>` field private
2022-12-02 21:54:18 +00:00
Pavel Mikhailovskii c3c09aa95a KT-4107 Data objects 2022-06-28 16:58:20 +02:00
Georgy Bronnikov 8fd29a9fec Fir2Ir: properly compute setter type parameter bounds 2022-05-19 12:02:44 +02:00
Alexander Korepanov 69295f2cf0 [JS IR] IC invalidation refactoring
- Huge refactoring for IC
  - Update hash combination logic
  - Introduce value class for IC hashes
  - Calc md5 directly by function IR
  - Split IC logic by classes
  - Move JsIrLinkerLoader into separate file
  - CacheUpdateStatus is a sealed class
  - Render TYPE_PARAMETER reified flag

^KT-51081 Fixed
^KT-51084 Fixed
2022-03-15 05:34:19 +00:00
Mikhail Glukhikh e591f79533 FIR2IR: fix origins for anonymous functions & lambdas 2021-12-09 13:26:41 +03:00
Mikhail Glukhikh 85240bdb06 FIR2IR: generate type arguments in delegation calls 2021-12-06 18:07:17 +03:00
Mikhail Glukhikh d6bc6bec59 FIR2IR: read extension function type attribute properly 2021-11-12 12:53:32 +03:00
Mads Ager e5bff514b6 FIR2IR: Fix line number differences in try block 2021-11-01 23:59:59 +03:00
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00
Alexander Udalov ffe0d9de70 Psi2ir: do not sort descriptors for fake override generation
Descriptors are already supposed to be sorted in scopes. The problem is
that rendering descriptors for sorting takes a lot of time (~1.5% of
total compilation time of intellij with JVM IR), and simple heuristics,
like comparing by names first, don't fully help with it.

 #KT-48233
2021-08-31 20:25:59 +02:00
Mikhael Bogdanov 8ab546ba51 [FIR]: Pass special origins for local functions (named and anonymous) 2021-08-18 09:58:27 +00:00
Mikhael Bogdanov a5e59e09ee Copy methods for lambdas to DefaultImpls without receiver transformation
#KT-48230 Fixed
2021-08-18 09:58:27 +00:00
Andrey Zinovyev d360932ebc [FIR] Fill overriddenSymbols for fake overridden IrProperty 2021-06-17 13:24:12 +03:00
Roman Artemev bbcd511c44 [TEST] fix irText testData
- support DELEGATED_MEMBER overrides
2021-06-16 21:16:48 +03:00
Mikhail Glukhikh a255f44d6e FIR2IR KT-46578 add overridden properties generation 2021-05-14 16:20:20 +03:00
Roman Artemev ab8f64a3ee [FIR] Mute failing tests 2021-03-12 18:47:34 +03:00
Alexander Udalov e3dc112c5f Add original KotlinType to rendered IrErrorType
Also improve an error message in `IrType.erasedUpperBound`, which seems
like a frequent first place where the JVM IR backend crashes in case an
error type has made it past psi2ir.

This will help in diagnosing problems such as KT-45016.
2021-03-09 21:07:53 +01:00
Denis.Zharkov 377a0aa237 FIR2IR: Adjust test data for updated overridden structure 2021-02-20 10:59:22 +03:00
Mikhail Glukhikh d4b0688690 FIR: introduce delegate field initializers
Before this commit we initialized delegate fields in primary constructor,
that could provoke NPE in case delegate is used in initializer of
some property backing field.
Now we initialize delegate fields directly instead.
2021-02-08 14:28:27 +03:00
Mikhail Glukhikh 4fd4f504d0 FIR: make componentX functions operator 2021-01-22 18:11:57 +03:00
Dmitriy Novozhilov 4752924b13 [TD] Update FQN's in testdata of IR text tests 2021-01-22 13:51:29 +03:00
Jinseong Jeon fe0c25693d FIR2IR: do not convert @ExtensionFunctionType twice 2020-12-18 12:17:21 +03:00
Zalim Bashorov 69f0f4ef19 [IR] update testdata: unify printing custom/non-standard modifiers 2020-11-26 00:15:21 +03:00
Zalim Bashorov 7df6575a18 [IR] update testdata: unify representation for error nodes 2020-11-26 00:15:16 +03:00
Zalim Bashorov c68040753d [IR] dumpKotlinLike: add testdata for FIR tests 2020-11-26 00:15:13 +03:00
Zalim Bashorov 2dbd784a6a [IR] update testdata: print else -> ... 2020-11-26 00:14:55 +03:00
Zalim Bashorov 64b42401a1 [IR] update testdata: print a parameter in catch 2020-11-26 00:14:34 +03:00
Zalim Bashorov 21da2b0350 [IR] update testdata: print whole string concatenation at one line 2020-11-26 00:14:30 +03:00
Zalim Bashorov a6b408978f [IR] update testdata: super and receiver for field accesses 2020-11-26 00:14:28 +03:00
Zalim Bashorov e56787c0b0 [IR] update testdata: IrInstanceInitializerCall 2020-11-26 00:14:25 +03:00
Zalim Bashorov ab8188b032 [IR] update testdata: removed extra indentation for function expressions 2020-11-26 00:14:23 +03:00
Zalim Bashorov 602f0ddbc8 [IR] update testdata after using maxBlankLines=1 for Printer 2020-11-26 00:14:20 +03:00