Restore order of lowerings
This commit is contained in:
@@ -115,10 +115,10 @@ val jvmPhases = namedIrFilePhase<JvmBackendContext>(
|
|||||||
makePatchParentsPhase(1) then
|
makePatchParentsPhase(1) then
|
||||||
|
|
||||||
enumWhenPhase then
|
enumWhenPhase then
|
||||||
|
singletonReferencesPhase then
|
||||||
localDeclarationsPhase then
|
localDeclarationsPhase then
|
||||||
singleAbstractMethodPhase then
|
singleAbstractMethodPhase then
|
||||||
addContinuationPhase then
|
addContinuationPhase then
|
||||||
singletonReferencesPhase then
|
|
||||||
callableReferencePhase then
|
callableReferencePhase then
|
||||||
functionNVarargInvokePhase then
|
functionNVarargInvokePhase then
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -169,6 +169,8 @@ private class AddContinuationLowering(private val context: JvmBackendContext) :
|
|||||||
invokeSuspend: IrFunction,
|
invokeSuspend: IrFunction,
|
||||||
invokeToOverride: IrSimpleFunctionSymbol
|
invokeToOverride: IrSimpleFunctionSymbol
|
||||||
) {
|
) {
|
||||||
|
val unitClass = context.irBuiltIns.unitClass
|
||||||
|
val unitField = context.declarationFactory.getFieldForObjectInstance(unitClass.owner)
|
||||||
addFunctionOverride(invokeToOverride.owner).also { function ->
|
addFunctionOverride(invokeToOverride.owner).also { function ->
|
||||||
function.body = context.createIrBuilder(function.symbol).irBlockBody {
|
function.body = context.createIrBuilder(function.symbol).irBlockBody {
|
||||||
+irReturn(irCall(invokeSuspend).also { invokeSuspendCall ->
|
+irReturn(irCall(invokeSuspend).also { invokeSuspendCall ->
|
||||||
@@ -178,7 +180,7 @@ private class AddContinuationLowering(private val context: JvmBackendContext) :
|
|||||||
it.putValueArgument(index, irGet(param))
|
it.putValueArgument(index, irGet(param))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invokeSuspendCall.putValueArgument(0, irUnit())
|
invokeSuspendCall.putValueArgument(0, irGetField(null, unitField))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user