From 3ac7a59b97a9b351282323533b04c3f3a861d461 Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Wed, 27 May 2020 20:51:16 +0500 Subject: [PATCH] [IR] Moved up a lowering This concerns NothingValueExceptionLowering - it must be run before the suspend functions lowering (see codegen/coroutines/returnsNothing1 why) --- .../org/jetbrains/kotlin/backend/konan/KonanLoweringPhases.kt | 2 +- .../src/org/jetbrains/kotlin/backend/konan/ToplevelPhases.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 3c386215bca..99354dfcb2b 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 @@ -309,7 +309,7 @@ internal val coroutinesPhase = makeKonanFileLoweringPhase( ::NativeSuspendFunctionsLowering, name = "Coroutines", description = "Coroutines lowering", - prerequisite = setOf(localFunctionsPhase, finallyBlocksPhase) + prerequisite = setOf(localFunctionsPhase, finallyBlocksPhase, kotlinNothingValueExceptionPhase) ) internal val typeOperatorPhase = makeKonanFileLoweringPhase( 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 132ffda2508..652d56bf08f 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 @@ -351,11 +351,11 @@ internal val allLoweringsPhase = namedIrModulePhase( interopPhase then varargPhase then compileTimeEvaluatePhase then + kotlinNothingValueExceptionPhase then coroutinesPhase then typeOperatorPhase then bridgesPhase then autoboxPhase then - kotlinNothingValueExceptionPhase then returnsInsertionPhase ), actions = setOf(defaultDumper, ::moduleValidationCallback)