Don't introduce additional variables for simple array assignment.

This commit is contained in:
Dmitry Petrov
2016-08-25 09:09:10 +03:00
committed by Dmitry Petrov
parent abb106c885
commit 54e6bbd007
17 changed files with 61 additions and 54 deletions
+10 -16
View File
@@ -6,11 +6,10 @@ IrFile /arrayAssignment.kt
CALL .intArrayOf type=kotlin.IntArray operator=null
elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray
DUMMY vararg type=kotlin.Int
BLOCK type=kotlin.Unit hasResult=false operator=EQ
CALL .set type=kotlin.Unit operator=EQ
$this: GET_VAR x type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='1'
value: CONST Int type=kotlin.Int value='0'
CALL .set type=kotlin.Unit operator=EQ
$this: GET_VAR x type=kotlin.IntArray operator=null
index: CONST Int type=kotlin.Int value='1'
value: CONST Int type=kotlin.Int value='0'
IrFunction public fun foo(): kotlin.Int
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
@@ -19,14 +18,9 @@ IrFile /arrayAssignment.kt
IrFunction public fun test2(): kotlin.Unit
IrExpressionBody
BLOCK type=<no-type> hasResult=false operator=null
BLOCK type=kotlin.Unit hasResult=false operator=EQ
VAR val tmp0_array: kotlin.IntArray
CALL .intArrayOf type=kotlin.IntArray operator=null
elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray
DUMMY vararg type=kotlin.Int
VAR val tmp1_index0: kotlin.Int
CALL .foo type=kotlin.Int operator=null
CALL .set type=kotlin.Unit operator=EQ
$this: GET_VAR tmp0_array type=kotlin.IntArray operator=null
index: GET_VAR tmp1_index0 type=kotlin.Int operator=null
value: CONST Int type=kotlin.Int value='1'
CALL .set type=kotlin.Unit operator=EQ
$this: CALL .intArrayOf type=kotlin.IntArray operator=null
elements: TYPE_OP operator=IMPLICIT_CAST typeOperand=kotlin.IntArray
DUMMY vararg type=kotlin.Int
index: CALL .foo type=kotlin.Int operator=null
value: CONST Int type=kotlin.Int value='1'