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 99354dfcb2b..4343f326198 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 @@ -341,4 +341,10 @@ internal val returnsInsertionPhase = makeKonanFileLoweringPhase( name = "ReturnsInsertion", description = "Returns insertion for Unit functions", prerequisite = setOf(autoboxPhase, coroutinesPhase, enumClassPhase) +) + +internal val ifNullExpressionsFusionPhase = makeKonanFileLoweringPhase( + ::IfNullExpressionsFusionLowering, + name = "IfNullExpressionsFusionLowering", + description = "Simplify '?.' and '?:' operator chains" ) \ 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 17ba1ed0b10..fbf300786e8 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 @@ -347,6 +347,7 @@ internal val allLoweringsPhase = namedIrModulePhase( innerClassPhase then dataClassesPhase then singleAbstractMethodPhase then + ifNullExpressionsFusionPhase then builtinOperatorPhase then finallyBlocksPhase then testProcessorPhase then