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
@@ -101,22 +101,22 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Int origin=null
BLOCK type=kotlin.Int origin=PREFIX_INCR
SET_VAR 'var i: kotlin.Int declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'var i: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=null
GET_VAR 'var i: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=null
CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR
$this: GET_VAR 'var i: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=PREFIX_INCR
GET_VAR 'var i: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=PREFIX_INCR
VAR name:j type:kotlin.Int [var]
CONST Int type=kotlin.Int value=0
BLOCK type=kotlin.Unit origin=null
DO_WHILE label=Inner origin=DO_WHILE_LOOP
body: COMPOSITE type=kotlin.Unit origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
BLOCK type=kotlin.Int origin=null
BLOCK type=kotlin.Int origin=PREFIX_INCR
SET_VAR 'var j: kotlin.Int declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'var j: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=null
GET_VAR 'var j: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=null
CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR
$this: GET_VAR 'var j: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=PREFIX_INCR
GET_VAR 'var j: kotlin.Int declared in <root>.test5' type=kotlin.Int origin=PREFIX_INCR
condition: WHEN type=kotlin.Boolean origin=IF
BRANCH
if: CALL 'public final fun greaterOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ