[IR] Adopted FlattenStringConcatenation lowering

This commit is contained in:
Igor Chevdar
2020-08-26 10:52:50 +05:00
parent d36f05b85d
commit 257590971c
2 changed files with 10 additions and 2 deletions
@@ -166,6 +166,12 @@ internal val provisionalFunctionExpressionPhase = makeKonanModuleLoweringPhase(
description = "Transform IrFunctionExpression to a local function reference"
)
internal val flattenStringConcatenationPhase = makeKonanFileLoweringPhase(
::FlattenStringConcatenationLowering,
name = "FlattenStringConcatenationLowering",
description = "Flatten nested string concatenation expressions into a single IrStringConcatenation"
)
internal val stringConcatenationPhase = makeKonanFileLoweringPhase(
::StringConcatenationLowering,
name = "StringConcatenation",
@@ -359,5 +365,6 @@ internal val ifNullExpressionsFusionPhase = makeKonanFileLoweringPhase(
internal val foldConstantLoweringPhase = makeKonanFileOpPhase(
{ context, irFile -> FoldConstantLowering(context).lower(irFile) },
name = "FoldConstantLowering",
description = "Constant Folding"
description = "Constant Folding",
prerequisite = setOf(flattenStringConcatenationPhase)
)
@@ -359,11 +359,12 @@ internal val allLoweringsPhase = NamedCompilerPhase(
lower = listOf(
rangeContainsLoweringPhase,
forLoopsPhase,
flattenStringConcatenationPhase,
foldConstantLoweringPhase,
stringConcatenationPhase,
enumConstructorsPhase,
initializersPhase,
localFunctionsPhase,
foldConstantLoweringPhase,
tailrecPhase,
defaultParameterExtentPhase,
innerClassPhase,