Move ForLoopsLowering before JvmStringConcatenationLowering.
ForLoopsLowering may produce IrStringConcatenations which should be eliminated before codegen.
This commit is contained in:
committed by
max-kammerer
parent
8a4185202f
commit
27642514b1
@@ -220,6 +220,7 @@ private val jvmFilePhases =
|
|||||||
jvmOverloadsAnnotationPhase then
|
jvmOverloadsAnnotationPhase then
|
||||||
jvmDefaultConstructorPhase then
|
jvmDefaultConstructorPhase then
|
||||||
|
|
||||||
|
forLoopsPhase then
|
||||||
flattenStringConcatenationPhase then
|
flattenStringConcatenationPhase then
|
||||||
foldConstantLoweringPhase then
|
foldConstantLoweringPhase then
|
||||||
computeStringTrimPhase then
|
computeStringTrimPhase then
|
||||||
@@ -237,7 +238,6 @@ private val jvmFilePhases =
|
|||||||
|
|
||||||
innerClassesPhase then
|
innerClassesPhase then
|
||||||
innerClassConstructorCallsPhase then
|
innerClassConstructorCallsPhase then
|
||||||
forLoopsPhase then
|
|
||||||
|
|
||||||
makePatchParentsPhase(2) then
|
makePatchParentsPhase(2) then
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -8,6 +8,8 @@ package org.jetbrains.kotlin.backend.jvm.lower
|
|||||||
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
||||||
import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
|
import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
|
||||||
import org.jetbrains.kotlin.backend.common.lower.FlattenStringConcatenationLowering
|
import org.jetbrains.kotlin.backend.common.lower.FlattenStringConcatenationLowering
|
||||||
|
import org.jetbrains.kotlin.backend.common.lower.flattenStringConcatenationPhase
|
||||||
|
import org.jetbrains.kotlin.backend.common.lower.loops.forLoopsPhase
|
||||||
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
||||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||||
import org.jetbrains.kotlin.backend.jvm.ir.JvmIrBuilder
|
import org.jetbrains.kotlin.backend.jvm.ir.JvmIrBuilder
|
||||||
@@ -30,7 +32,10 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
|
|||||||
internal val jvmStringConcatenationLowering = makeIrFilePhase(
|
internal val jvmStringConcatenationLowering = makeIrFilePhase(
|
||||||
::JvmStringConcatenationLowering,
|
::JvmStringConcatenationLowering,
|
||||||
name = "StringConcatenation",
|
name = "StringConcatenation",
|
||||||
description = "Replace IrStringConcatenation with string builders"
|
description = "Replace IrStringConcatenation with string builders",
|
||||||
|
// flattenStringConcatenationPhase consolidates string concatenation expressions.
|
||||||
|
// forLoopsPhase may produce IrStringConcatenations.
|
||||||
|
prerequisite = setOf(flattenStringConcatenationPhase, forLoopsPhase)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user