[IR] Add IR support for setting parameters.
Use it in the JVM_IR backend for default values code. The parameter local has to be overwritten for the inliner to work.
This commit is contained in:
committed by
Alexander Udalov
parent
db23460fd5
commit
9a93bb3f09
+2
-2
@@ -607,11 +607,11 @@ abstract class IrFileDeserializer(
|
||||
return IrSetFieldImpl(start, end, symbol, receiver, value, builtIns.unitType, origin, superQualifier)
|
||||
}
|
||||
|
||||
private fun deserializeSetVariable(proto: ProtoSetVariable, start: Int, end: Int): IrSetVariable {
|
||||
private fun deserializeSetVariable(proto: ProtoSetVariable, start: Int, end: Int): IrSetValue {
|
||||
val symbol = deserializeIrSymbolAndRemap(proto.symbol) as IrVariableSymbol
|
||||
val value = deserializeExpression(proto.value)
|
||||
val origin = if (proto.hasOriginName()) deserializeIrStatementOrigin(proto.originName) else null
|
||||
return IrSetVariableImpl(start, end, builtIns.unitType, symbol, value, origin)
|
||||
return IrSetValueImpl(start, end, builtIns.unitType, symbol, value, origin)
|
||||
}
|
||||
|
||||
private fun deserializeSpreadElement(proto: ProtoSpreadElement): IrSpreadElement {
|
||||
|
||||
+2
-2
@@ -673,7 +673,7 @@ open class IrFileSerializer(
|
||||
}
|
||||
.build()
|
||||
|
||||
private fun serializeSetVariable(expression: IrSetVariable): ProtoSetVariable =
|
||||
private fun serializeSetVariable(expression: IrSetValue): ProtoSetVariable =
|
||||
ProtoSetVariable.newBuilder()
|
||||
.setSymbol(serializeIrSymbol(expression.symbol))
|
||||
.setValue(serializeExpression(expression.value)).apply {
|
||||
@@ -933,7 +933,7 @@ open class IrFileSerializer(
|
||||
is IrPropertyReference -> operationProto.propertyReference = serializePropertyReference(expression)
|
||||
is IrReturn -> operationProto.`return` = serializeReturn(expression)
|
||||
is IrSetField -> operationProto.setField = serializeSetField(expression)
|
||||
is IrSetVariable -> operationProto.setVariable = serializeSetVariable(expression)
|
||||
is IrSetValue -> operationProto.setVariable = serializeSetVariable(expression)
|
||||
is IrStringConcatenation -> operationProto.stringConcat = serializeStringConcat(expression)
|
||||
is IrThrow -> operationProto.`throw` = serializeThrow(expression)
|
||||
is IrTry -> operationProto.`try` = serializeTry(expression)
|
||||
|
||||
Reference in New Issue
Block a user