backend: remove special handling for setter call because it is incorrect

Handle it as usual call.
This commit is contained in:
Svyatoslav Scherbina
2017-01-13 16:58:55 +07:00
committed by SvyatoslavScherbina
parent 2f9bde4482
commit 91aab11e01
@@ -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 }