diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt index 25e2d1b53bb..c0417535021 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt @@ -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) ) \ No newline at end of file diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ToplevelPhases.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ToplevelPhases.kt index 79d0b992b96..36fe357b15b 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ToplevelPhases.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ToplevelPhases.kt @@ -359,11 +359,12 @@ internal val allLoweringsPhase = NamedCompilerPhase( lower = listOf( rangeContainsLoweringPhase, forLoopsPhase, + flattenStringConcatenationPhase, + foldConstantLoweringPhase, stringConcatenationPhase, enumConstructorsPhase, initializersPhase, localFunctionsPhase, - foldConstantLoweringPhase, tailrecPhase, defaultParameterExtentPhase, innerClassPhase,