backend: remove special handling for setter call because it is incorrect
Handle it as usual call.
This commit is contained in:
committed by
SvyatoslavScherbina
parent
2f9bde4482
commit
91aab11e01
-13
@@ -625,7 +625,6 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
|
||||
|
||||
private fun evaluateExpression(value: IrExpression): LLVMValueRef {
|
||||
when (value) {
|
||||
is IrSetterCallImpl -> return evaluateSetterCall (value)
|
||||
is IrTypeOperatorCall -> return evaluateTypeOperator (value)
|
||||
is IrCall -> return evaluateCall (value)
|
||||
is IrDelegatingConstructorCall ->
|
||||
@@ -1737,18 +1736,6 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
|
||||
return callDirect(descriptor, args, resultLifetime)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------//
|
||||
|
||||
private fun evaluateSetterCall(value: IrSetterCallImpl): LLVMValueRef {
|
||||
val descriptor = value.descriptor as FunctionDescriptor
|
||||
val args = mutableListOf<LLVMValueRef>()
|
||||
if (descriptor.dispatchReceiverParameter != null)
|
||||
args.add(evaluateExpression(value.dispatchReceiver!!)) //add this ptr
|
||||
args.add(evaluateExpression(value.getValueArgument(0)!!))
|
||||
return evaluateSimpleFunctionCall(
|
||||
descriptor, args, Lifetime.IRRELEVANT, value.superQualifier)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------//
|
||||
private fun resultLifetime(callee: IrMemberAccessExpression): Lifetime {
|
||||
return resultLifetimes.getOrElse(callee) { Lifetime.GLOBAL }
|
||||
|
||||
Reference in New Issue
Block a user