JVM_IR KT-46189 lower tailrec functions after local declarations

This commit is contained in:
Dmitry Petrov
2021-04-20 19:02:49 +03:00
committed by TeamCityServer
parent 645014092c
commit f519150c08
11 changed files with 156 additions and 6 deletions
@@ -266,7 +266,8 @@ private val syntheticAccessorPhase = makeIrFilePhase(
private val tailrecPhase = makeIrFilePhase(
::JvmTailrecLowering,
name = "Tailrec",
description = "Handle tailrec calls"
description = "Handle tailrec calls",
prerequisite = setOf(localDeclarationsPhase)
)
private val kotlinNothingValueExceptionPhase = makeIrFilePhase<CommonBackendContext>(
@@ -342,17 +343,13 @@ private val jvmFilePhases = listOf(
propertiesPhase,
remapObjectFieldAccesses,
anonymousObjectSuperConstructorPhase,
tailrecPhase,
makePatchParentsPhase(1),
jvmStandardLibraryBuiltInsPhase,
rangeContainsLoweringPhase,
forLoopsPhase,
collectionStubMethodLowering,
jvmInlineClassPhase,
makePatchParentsPhase(2),
makePatchParentsPhase(1),
enumWhenPhase,
singletonReferencesPhase,
@@ -362,6 +359,10 @@ private val jvmFilePhases = listOf(
returnableBlocksPhase,
sharedVariablesPhase,
localDeclarationsPhase,
tailrecPhase,
makePatchParentsPhase(2),
jvmLocalClassExtractionPhase,
staticCallableReferencePhase,