JVM_IR: do not copy bodies when creating static functions

This commit is contained in:
Georgy Bronnikov
2019-09-17 16:33:46 +03:00
parent 4920d71d70
commit be002fc417
4 changed files with 8 additions and 9 deletions
@@ -504,8 +504,7 @@ fun createStaticFunctionWithReceivers(
oldFunction: IrFunction,
dispatchReceiverType: IrType? = oldFunction.dispatchReceiverParameter?.type,
origin: IrDeclarationOrigin = oldFunction.origin,
modality: Modality = Modality.FINAL,
copyBody: Boolean = true
modality: Modality = Modality.FINAL
): IrSimpleFunction {
val descriptor = WrappedSimpleFunctionDescriptor(Annotations.EMPTY, oldFunction.descriptor.source)
return IrFunctionImpl(
@@ -542,10 +541,6 @@ fun createStaticFunctionWithReceivers(
oldFunction.valueParameters.map { it.copyTo(this, index = it.index + offset) }
)
if (copyBody) {
copyBodyToStatic(oldFunction, this)
}
metadata = oldFunction.metadata
}
}
@@ -237,5 +237,5 @@ class InlineClassLowering(val context: BackendContext) {
}
private fun createStaticBodilessMethod(function: IrFunction): IrSimpleFunction =
createStaticFunctionWithReceivers(function.parent, function.name.toInlineClassImplementationName(), function, copyBody = false)
createStaticFunctionWithReceivers(function.parent, function.name.toInlineClassImplementationName(), function)
}