IR: generate lambdas in place in Psi2Ir

even when arguments are to be rearranged.
Lambdas have no side effects, and storing them in temporary variables
prevents processing in the backend
(such as inserting continuation parameter in AddContinuationLowering).
This commit is contained in:
Georgy Bronnikov
2020-03-19 11:45:23 +03:00
parent 915e6107d1
commit 4742057b51
9 changed files with 84 additions and 5 deletions
@@ -34,9 +34,7 @@ FILE fqName:<root> fileName:/callWithReorderedArguments.kt
b: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
BLOCK type=kotlin.Unit origin=ARGUMENTS_REORDERING_FOR_CALL
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
CONST Int type=kotlin.Int value=1
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
CALL 'public final fun reordered2 (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
CALL 'public final fun foo (a: kotlin.Int, b: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
a: GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
b: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
a: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
b: CONST Int type=kotlin.Int value=1