Commit Graph

19 Commits

Author SHA1 Message Date
Pavel Kunyavskiy e6f4d6e6fa [Tests] Use stable order for ir/kotlinLike dumps
^KT-65406
2024-02-16 10:19:38 +00:00
vladislav.grechko 9aa8fb80e7 Set correct IR origins for inc/dec operations
NB: in order to produce correct IR origins, the source element kinds for
some FIR elements has been changed. As a side effect, mapping PSI to FIR
slightly changed: namely, for `a[b]++`, `a[b]` used to be mapped on
`set` call or callable reference, but now it is mapped on `get` call.

^KT-61891: Fixed
^KT-64387: Fixed
2024-01-30 14:26:10 +00:00
Vladimir Sukharev 9b9ddb760a [FIR2IR] Coerce last operator in a loop to Unit
One of many fixes for https://youtrack.jetbrains.com/issue/KT-59781/K2-investigate-implicit-cast-generation-in-fir2ir-vs-psi2ir

Merge-request: KT-MR-12629
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-10-19 09:53:46 +00:00
Vladimir Sukharev bae8b283c7 [IR] Normalize temp var names in Kotlin-like dump
^KT-61983 Fixed
2023-10-11 07:49:35 +00:00
Vladimir Sukharev 9a2eff6487 [FIR2IR] Don't replace while loop and when branch body blocks with single expression. Skip some empty blocks.
https://youtrack.jetbrains.com/issue/KT-60264/K2-while-loop-body-block-sometimes-replaced-with-single-expression

Merge-request: KT-MR-12035
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-18 15:27:19 +00:00
Mikhail Glukhikh 7d5e2f85cc FIR2IR: don't generate unnecessary 'return throw'
#KT-60245 Fixed
2023-08-22 11:20:19 +00:00
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
Dmitriy Novozhilov 6bb7fc05df [IR] Split implementation of DataClassMembersGenerator to IR based and descriptor based 2023-07-05 14:57:55 +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
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
Ivan Kylchik 63b340651d Add possibility to interpret and fold IrStringConcatenation expression 2023-03-24 15:55:06 +00:00
Mikhail Glukhikh 0ecfcf4380 FIR2IR: make anonymous object constructor public to match K1 behavior 2023-03-16 18:07:36 +00:00
Kirill Rakhman 3b9724d20e [FIR] Desugar increment/decrement in body resolve phase
The expression needs to be resolved first to determine if there is a
receiver that needs to be extracted to a temporary variable. Also, the
special case for prefix increment/decrement on local variable without
delegates requires resolution to check if the variable is local.

^KT-56771 Fixed
^KT-56659 Fixed
2023-03-02 10:19:57 +00:00
Kirill Rakhman 9a328ec75b [FIR2IR] Apply implicit casts to blocks 2023-03-02 10:19:51 +00:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Mikhail Glukhikh febf336d23 IrConstTransformer: transform constants also inside call children 2021-12-13 16:24:59 +03:00
Jinseong Jeon 7898d167f3 FIR2IR: wrap do-while loop in IrBlock
"so that variables declared in loop body are not visible outside of the
loop" (from commit d096f1d)
2021-04-01 20:07:47 +03:00
Mikhail Glukhikh ebfc431733 FIR body resolve context: fix accessor scope handling 2021-03-17 12:13:23 +03:00