[JVM_IR, IR] Remove more needless temporary variables.
Avoid using a separate origin for temporary variables introduced for for loops. That doesn't add anything and gives one more case for optimizations to deal with. Extend the JVM specific optimizations to remove temporary variables to deal with more cases encountered in for loops lowering.
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ FILE fqName:<root> fileName:/for.kt
|
||||
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||
$this: GET_VAR 'val tmp0_iterator: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> [val] declared in <root>.testDestructuring' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_IMPLICIT_VARIABLE name:tmp1_loop_parameter type:kotlin.Pair<kotlin.Int, kotlin.String> [val]
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp1_loop_parameter type:kotlin.Pair<kotlin.Int, kotlin.String> [val]
|
||||
CALL 'public abstract fun next (): T of kotlin.collections.Iterator declared in kotlin.collections.Iterator' type=kotlin.Pair<kotlin.Int, kotlin.String> origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp0_iterator: kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> [val] declared in <root>.testDestructuring' type=kotlin.collections.Iterator<kotlin.Pair<kotlin.Int, kotlin.String>> origin=null
|
||||
VAR name:i type:kotlin.Int [val]
|
||||
|
||||
Reference in New Issue
Block a user