[Native] Drop irSetVar from IrUtils2

We can reuse `irSet` function
This commit is contained in:
Ivan Kylchik
2023-08-15 14:46:56 +02:00
committed by Space Team
parent 9ab053a3a6
commit 962172f96d
3 changed files with 2 additions and 5 deletions
@@ -82,7 +82,7 @@ internal class CEnumByValueFunctionGenerator(
type = irBuiltIns.unitType,
condition = irEquals(entryValue, irGet(irValueParameter)),
thenPart = irReturn(irGet(entry)),
elsePart = irSetVar(
elsePart = irSet(
inductionVariable,
irCallOp(plusFun, irBuiltIns.intType,
irGet(inductionVariable),
@@ -159,7 +159,7 @@ internal class NativeSuspendFunctionsLowering(
val scope = liveLocals[suspensionPoint]!!
return irBlock(expression) {
scope.forEach {
+irSetVar(localsMap[it]
+irSet(localsMap[it]
?: it, irGetField(irGet(thisReceiver), localToPropertyMap[it.symbol]!!))
}
}
@@ -173,9 +173,6 @@ fun IrBuilderWithScope.irCallOp(
putValueArgument(0, argument)
}
fun IrBuilderWithScope.irSetVar(variable: IrVariable, value: IrExpression) =
irSet(variable.symbol, value)
fun IrBuilderWithScope.irCatch(type: IrType) =
IrCatchImpl(
startOffset, endOffset,