Make InitializersLowering a BodyLoweringPass and add a InitializersCleanupLowering

This commit is contained in:
Anton Bannykh
2019-12-22 23:56:35 +03:00
committed by Anton Bannykh
parent 600caaa636
commit 6e96e271ae
5 changed files with 99 additions and 34 deletions
@@ -208,6 +208,13 @@ private val initializersLoweringPhase = makeWasmModulePhase(
prerequisite = setOf(primaryConstructorLoweringPhase)
)
private val initializersCleanupLoweringPhase = makeWasmModulePhase(
::InitializersCleanupLowering,
name = "InitializersCleanupLowering",
description = "Remove non-static anonymous initializers and field init expressions",
prerequisite = setOf(initializersLoweringPhase)
)
private val excludeDeclarationsFromCodegenPhase = makeCustomWasmModulePhase(
{ context, module ->
excludeDeclarationsFromCodegen(context, module)
@@ -336,6 +343,7 @@ val wasmPhases = namedIrModulePhase<WasmBackendContext>(
propertiesLoweringPhase then
primaryConstructorLoweringPhase then
initializersLoweringPhase then
initializersCleanupLoweringPhase then
// Common prefix ends
builtInsLoweringPhase then