[IR] Move Ir utils from Kotlin/Native

This commit is contained in:
Roman Artemev
2019-04-08 14:49:10 +03:00
committed by romanart
parent cf9cce8a9b
commit bcc8f3e073
2 changed files with 115 additions and 8 deletions
@@ -253,12 +253,4 @@ object JsIrBuilder {
fun buildString(type: IrType, s: String) = IrConstImpl.string(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type, s)
fun buildTry(type: IrType) = IrTryImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, type)
fun buildCatch(ex: IrVariable, block: IrBlockImpl) = IrCatchImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, ex, block)
}
fun IrClass.simpleFunctions(): List<IrSimpleFunction> = this.declarations.flatMap {
when (it) {
is IrSimpleFunction -> listOf(it)
is IrProperty -> listOfNotNull(it.getter, it.setter)
else -> emptyList()
}
}