[K/N] Mark immutable temp variables as immutable
This optimizes 5000 enum entries enum compilation time from "I can't wait" to around 1 minute.
This commit is contained in:
committed by
Space Team
parent
f479a56f5e
commit
abbf11e8e1
+1
-2
@@ -128,13 +128,12 @@ internal class VarargInjectionLowering constructor(val context: KonanBackendCont
|
||||
it to irTemporary(
|
||||
(it as? IrSpreadElement)?.expression ?: it as IrExpression,
|
||||
"elem".synthesizedString,
|
||||
isMutable = true
|
||||
)
|
||||
}.toMap()
|
||||
val arraySize = calculateArraySize(arrayHandle, hasSpreadElement, scope, expression, vars)
|
||||
val array = arrayHandle.createArray(this, expression.varargElementType, arraySize)
|
||||
|
||||
val arrayTmpVariable = irTemporary(array, "array".synthesizedString, isMutable = true)
|
||||
val arrayTmpVariable = irTemporary(array, "array".synthesizedString)
|
||||
lateinit var indexTmpVariable: IrVariable
|
||||
if (hasSpreadElement)
|
||||
indexTmpVariable = irTemporary(kIntZero, "index".synthesizedString, isMutable = true)
|
||||
|
||||
Reference in New Issue
Block a user