JVM_IR: do not handle Nothing in suspend tail call bridges

Else they wouldn't be tail call, would they?
This commit is contained in:
pyos
2020-05-07 14:48:07 +02:00
committed by Ilmir Usmanov
parent 0acaedef92
commit 8809abdbac
10 changed files with 74 additions and 10 deletions
@@ -19,11 +19,13 @@ import org.jetbrains.kotlin.ir.types.isNothing
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
class KotlinNothingValueExceptionLowering(val backendContext: CommonBackendContext) : BodyLoweringPass {
class KotlinNothingValueExceptionLowering(
val backendContext: CommonBackendContext, val skip: (IrDeclaration) -> Boolean = { false }
) : BodyLoweringPass {
override fun lower(irBody: IrBody, container: IrDeclaration) {
irBody.transformChildrenVoid(
Transformer((container as IrSymbolDeclaration<*>).symbol)
)
if (!skip(container)) {
irBody.transformChildrenVoid(Transformer((container as IrSymbolDeclaration<*>).symbol))
}
}
private inner class Transformer(val parent: IrSymbol) : IrElementTransformerVoid() {