[Native] Drop createArrayOfExpression from IrUtils2
We can reuse the same function from common `IrUtils`
This commit is contained in:
+1
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.backend.konan.lower
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
||||||
import org.jetbrains.kotlin.backend.common.getOrPut
|
import org.jetbrains.kotlin.backend.common.getOrPut
|
||||||
|
import org.jetbrains.kotlin.backend.common.ir.createArrayOfExpression
|
||||||
import org.jetbrains.kotlin.backend.common.lower.EnumWhenLowering
|
import org.jetbrains.kotlin.backend.common.lower.EnumWhenLowering
|
||||||
import org.jetbrains.kotlin.backend.common.lower.at
|
import org.jetbrains.kotlin.backend.common.lower.at
|
||||||
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
||||||
|
|||||||
-14
@@ -191,20 +191,6 @@ fun IrBuilderWithScope.irCatch(type: IrType) =
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
fun CommonBackendContext.createArrayOfExpression(
|
|
||||||
startOffset: Int, endOffset: Int,
|
|
||||||
arrayElementType: IrType,
|
|
||||||
arrayElements: List<IrExpression>
|
|
||||||
): IrExpression {
|
|
||||||
|
|
||||||
val arrayType = ir.symbols.array.typeWith(arrayElementType)
|
|
||||||
val arg0 = IrVarargImpl(startOffset, endOffset, arrayType, arrayElementType, arrayElements)
|
|
||||||
|
|
||||||
return irCall(startOffset, endOffset, ir.symbols.arrayOf.owner, listOf(arrayElementType)).apply {
|
|
||||||
putValueArgument(0, arg0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun createField(
|
fun createField(
|
||||||
startOffset: Int,
|
startOffset: Int,
|
||||||
endOffset: Int,
|
endOffset: Int,
|
||||||
|
|||||||
Reference in New Issue
Block a user