[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
|
else -> this
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copied from K/N */
|
|
||||||
fun IrDeclarationContainer.addChild(declaration: IrDeclaration) {
|
fun IrDeclarationContainer.addChild(declaration: IrDeclaration) {
|
||||||
this.declarations += declaration
|
this.declarations += declaration
|
||||||
declaration.setDeclarationsParent(this)
|
declaration.setDeclarationsParent(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun IrDeclarationContainer.addChildren(declarations: List<IrDeclaration>) {
|
||||||
|
declarations.forEach { this.addChild(it) }
|
||||||
|
}
|
||||||
|
|
||||||
fun <T : IrElement> T.setDeclarationsParent(parent: IrDeclarationParent): T {
|
fun <T : IrElement> T.setDeclarationsParent(parent: IrDeclarationParent): T {
|
||||||
accept(SetDeclarationsParentVisitor, parent)
|
accept(SetDeclarationsParentVisitor, parent)
|
||||||
return this
|
return this
|
||||||
|
|||||||
-9
@@ -97,15 +97,6 @@ inline fun <reified T> stub(name: String): T {
|
|||||||
} as 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? {
|
tailrec fun IrDeclaration.getContainingFile(): IrFile? {
|
||||||
val parent = this.parent
|
val parent = this.parent
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user