[K/N][IR][codegen] Made lazy init logic JVM-like

Now a file will be initialized only if a top level function has been called
rather than any function like was before the commit
This commit is contained in:
Igor Chevdar
2021-08-26 20:13:18 +05:00
parent e6be5e4266
commit ce44403d1b
6 changed files with 50 additions and 14 deletions
@@ -404,7 +404,7 @@ fun IrFunction.isMethodOfAny(): Boolean =
else -> false
}
fun IrClass.simpleFunctions() = declarations.flatMap {
fun IrDeclarationContainer.simpleFunctions() = declarations.flatMap {
when (it) {
is IrSimpleFunction -> listOf(it)
is IrProperty -> listOfNotNull(it.getter, it.setter)