[Native] Drop addChild from IrUtils2
We can reuse the same function from common `IrUtils`
This commit is contained in:
@@ -1066,12 +1066,15 @@ fun IrType.remapTypeParameters(
|
||||
else -> this
|
||||
}
|
||||
|
||||
/* Copied from K/N */
|
||||
fun IrDeclarationContainer.addChild(declaration: IrDeclaration) {
|
||||
this.declarations += declaration
|
||||
declaration.setDeclarationsParent(this)
|
||||
}
|
||||
|
||||
fun IrDeclarationContainer.addChildren(declarations: List<IrDeclaration>) {
|
||||
declarations.forEach { this.addChild(it) }
|
||||
}
|
||||
|
||||
fun <T : IrElement> T.setDeclarationsParent(parent: IrDeclarationParent): T {
|
||||
accept(SetDeclarationsParentVisitor, parent)
|
||||
return this
|
||||
|
||||
-9
@@ -97,15 +97,6 @@ inline fun <reified T> stub(name: String): T {
|
||||
} as T
|
||||
}
|
||||
|
||||
fun IrDeclarationContainer.addChildren(declarations: List<IrDeclaration>) {
|
||||
declarations.forEach { this.addChild(it) }
|
||||
}
|
||||
|
||||
fun IrDeclarationContainer.addChild(declaration: IrDeclaration) {
|
||||
this.declarations += declaration
|
||||
declaration.accept(SetDeclarationsParentVisitor, this)
|
||||
}
|
||||
|
||||
tailrec fun IrDeclaration.getContainingFile(): IrFile? {
|
||||
val parent = this.parent
|
||||
|
||||
|
||||
Reference in New Issue
Block a user