IR: NullDescriptorsRemapper

This commit is contained in:
Georgy Bronnikov
2020-12-08 16:01:50 +03:00
parent 3683cd0f7b
commit e9f45e23f2
5 changed files with 34 additions and 131 deletions
@@ -5,8 +5,6 @@
package org.jetbrains.kotlin.backend.common.lower.inline
import org.jetbrains.kotlin.ir.util.DescriptorsToIrRemapper
import org.jetbrains.kotlin.ir.util.WrappedDescriptorPatcher
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent
import org.jetbrains.kotlin.ir.declarations.IrTypeParametersContainer
@@ -37,9 +35,6 @@ internal class DeepCopyIrTreeWithSymbolsForInliner(
// Copy IR.
val result = irElement.transform(copier, data = null)
// Bind newly created IR with wrapped descriptors.
result.acceptVoid(WrappedDescriptorPatcher)
result.patchDeclarationParents(parent)
return result
}
@@ -133,7 +128,7 @@ internal class DeepCopyIrTreeWithSymbolsForInliner(
}
}
private val symbolRemapper = SymbolRemapperImpl(DescriptorsToIrRemapper)
private val symbolRemapper = SymbolRemapperImpl(NullDescriptorsRemapper)
private val typeRemapper = InlinerTypeRemapper(symbolRemapper, typeArguments)
private val copier = object : DeepCopyIrTreeWithSymbols(symbolRemapper, typeRemapper, InlinerSymbolRenamer()) {
private fun IrType.remapTypeAndErase() = typeRemapper.remapTypeAndOptionallyErase(this, erase = true)