[IR] Remapped some forgotten types during IR copying

This commit is contained in:
Igor Chevdar
2019-12-16 18:56:22 +03:00
parent f099277210
commit 776736a25a
@@ -680,7 +680,7 @@ open class DeepCopyIrTreeWithSymbols(
throw AssertionError("Outer loop was not transformed: ${irLoop.render()}") throw AssertionError("Outer loop was not transformed: ${irLoop.render()}")
override fun visitWhileLoop(loop: IrWhileLoop): IrWhileLoop = override fun visitWhileLoop(loop: IrWhileLoop): IrWhileLoop =
IrWhileLoopImpl(loop.startOffset, loop.endOffset, loop.type, mapStatementOrigin(loop.origin)).also { newLoop -> IrWhileLoopImpl(loop.startOffset, loop.endOffset, loop.type.remapType(), mapStatementOrigin(loop.origin)).also { newLoop ->
transformedLoops[loop] = newLoop transformedLoops[loop] = newLoop
newLoop.label = loop.label newLoop.label = loop.label
newLoop.condition = loop.condition.transform() newLoop.condition = loop.condition.transform()
@@ -688,7 +688,7 @@ open class DeepCopyIrTreeWithSymbols(
}.copyAttributes(loop) }.copyAttributes(loop)
override fun visitDoWhileLoop(loop: IrDoWhileLoop): IrDoWhileLoop = override fun visitDoWhileLoop(loop: IrDoWhileLoop): IrDoWhileLoop =
IrDoWhileLoopImpl(loop.startOffset, loop.endOffset, loop.type, mapStatementOrigin(loop.origin)).also { newLoop -> IrDoWhileLoopImpl(loop.startOffset, loop.endOffset, loop.type.remapType(), mapStatementOrigin(loop.origin)).also { newLoop ->
transformedLoops[loop] = newLoop transformedLoops[loop] = newLoop
newLoop.label = loop.label newLoop.label = loop.label
newLoop.condition = loop.condition.transform() newLoop.condition = loop.condition.transform()
@@ -698,21 +698,21 @@ open class DeepCopyIrTreeWithSymbols(
override fun visitBreak(jump: IrBreak): IrBreak = override fun visitBreak(jump: IrBreak): IrBreak =
IrBreakImpl( IrBreakImpl(
jump.startOffset, jump.endOffset, jump.startOffset, jump.endOffset,
jump.type, jump.type.remapType(),
getTransformedLoop(jump.loop) getTransformedLoop(jump.loop)
).apply { label = jump.label }.copyAttributes(jump) ).apply { label = jump.label }.copyAttributes(jump)
override fun visitContinue(jump: IrContinue): IrContinue = override fun visitContinue(jump: IrContinue): IrContinue =
IrContinueImpl( IrContinueImpl(
jump.startOffset, jump.endOffset, jump.startOffset, jump.endOffset,
jump.type, jump.type.remapType(),
getTransformedLoop(jump.loop) getTransformedLoop(jump.loop)
).apply { label = jump.label }.copyAttributes(jump) ).apply { label = jump.label }.copyAttributes(jump)
override fun visitTry(aTry: IrTry): IrTry = override fun visitTry(aTry: IrTry): IrTry =
IrTryImpl( IrTryImpl(
aTry.startOffset, aTry.endOffset, aTry.startOffset, aTry.endOffset,
aTry.type, aTry.type.remapType(),
aTry.tryResult.transform(), aTry.tryResult.transform(),
aTry.catches.map { it.transform() }, aTry.catches.map { it.transform() },
aTry.finallyExpression?.transform() aTry.finallyExpression?.transform()