Don't recreate ir declarations to set body

This commit is contained in:
Mikhael Bogdanov
2018-05-03 11:01:10 +02:00
parent 35df7966cf
commit f0e4420259
@@ -161,20 +161,9 @@ open class DefaultArgumentStubGenerator constructor(val context: CommonBackendCo
irFunction.valueParameters.forEach {
it.defaultValue = null
}
return if (functionDescriptor is ClassConstructorDescriptor)
listOf(irFunction, IrConstructorImpl(
startOffset = irFunction.startOffset,
endOffset = irFunction.endOffset,
descriptor = descriptor as ClassConstructorDescriptor,
origin = DECLARATION_ORIGIN_FUNCTION_FOR_DEFAULT_PARAMETER,
body = body).apply { createParameterDeclarations() })
else
listOf(irFunction, IrFunctionImpl(
startOffset = irFunction.startOffset,
endOffset = irFunction.endOffset,
descriptor = descriptor,
origin = DECLARATION_ORIGIN_FUNCTION_FOR_DEFAULT_PARAMETER,
body = body).apply { createParameterDeclarations() })
newIrFunction.body = body
return listOf(irFunction, newIrFunction)
}
return listOf(irFunction)
}