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
This commit is contained in:
vladislav.grechko
2023-12-28 17:12:17 +01:00
committed by Space Team
parent 8b1d87848d
commit 9aa8fb80e7
65 changed files with 463 additions and 972 deletions
@@ -103,7 +103,7 @@ FILE fqName:<root> fileName:/ifWithArrayOperation.kt
other: CONST Int type=kotlin.Int value=9
BLOCK type=kotlin.Unit origin=WHEN
VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Int [val]
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=GET_ARRAY_ELEMENT
$this: GET_VAR 'val array: kotlin.IntArray declared in <root>.topLevelMethod' type=kotlin.IntArray origin=null
index: CONST Int type=kotlin.Int value=0
WHEN type=kotlin.Unit origin=WHEN
@@ -125,7 +125,7 @@ FILE fqName:<root> fileName:/ifWithArrayOperation.kt
value: CONST Int type=kotlin.Int value=11
BLOCK type=kotlin.Unit origin=WHEN
VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val]
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=GET_ARRAY_ELEMENT
$this: GET_VAR 'val array: kotlin.IntArray declared in <root>.topLevelMethod' type=kotlin.IntArray origin=null
index: CONST Int type=kotlin.Int value=0
WHEN type=kotlin.Unit origin=WHEN
@@ -147,7 +147,7 @@ FILE fqName:<root> fileName:/ifWithArrayOperation.kt
value: CONST Int type=kotlin.Int value=13
BLOCK type=kotlin.Unit origin=WHEN
VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Int [val]
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=GET_ARRAY_ELEMENT
$this: GET_VAR 'val array: kotlin.IntArray declared in <root>.topLevelMethod' type=kotlin.IntArray origin=null
index: CONST Int type=kotlin.Int value=0
WHEN type=kotlin.Unit origin=WHEN
@@ -187,7 +187,7 @@ FILE fqName:<root> fileName:/ifWithArrayOperation.kt
other: CONST Int type=kotlin.Int value=15
BLOCK type=kotlin.Unit origin=WHEN
VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:kotlin.Int [val]
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null
CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=GET_ARRAY_ELEMENT
$this: GET_VAR 'val array: kotlin.IntArray declared in <root>.topLevelMethod' type=kotlin.IntArray origin=null
index: CONST Int type=kotlin.Int value=0
WHEN type=kotlin.Unit origin=WHEN