IR: optimize transformation of declarations/statements lists in-place

Also, inherit IrDeclarationBase from IrElementBase to be able to use a
cast to IrElementBase, which is faster than a cast to IrElement or
IrDeclaration.
This commit is contained in:
Alexander Udalov
2020-08-03 21:38:28 +02:00
parent 4f0585950e
commit fb8e39a621
9 changed files with 29 additions and 18 deletions
@@ -579,7 +579,7 @@ internal class IterableLoopHeader(
loopVariable: IrVariable?,
loopVariableComponents: Map<Int, IrVariable>,
builder: DeclarationIrBuilder
) =
): List<IrStatement> =
with(builder) {
// loopVariable = iteratorVar.next()
val iteratorClass = headerInfo.iteratorVariable.type.getClass()!!