[IR] create IrScript, infrastructure for it and update visitors

This commit is contained in:
Vitaliy.Tikhonov
2019-08-30 14:18:21 +03:00
committed by romanart
parent f13e05de7d
commit 14510c1da3
15 changed files with 142 additions and 8 deletions
@@ -53,6 +53,12 @@ class PropertiesLowering(
return declaration
}
override fun visitScript(declaration: IrScript): IrStatement {
declaration.transformChildrenVoid(this)
declaration.transformDeclarationsFlat { lowerProperty(it, ClassKind.CLASS) }
return declaration
}
private fun lowerProperty(declaration: IrDeclaration, kind: ClassKind): List<IrDeclaration>? =
if (declaration is IrProperty)
if (skipExternalProperties && declaration.isEffectivelyExternal()) listOf(declaration) else {