JVM_IR KT-49335 run RepeatedAnnotationLowering per module

Otherwise, we drop annotation constructors in AnnotationLowering,
which breaks RAL in case of annotation container declared in different
file.
This commit is contained in:
Dmitry Petrov
2021-10-21 17:55:46 +03:00
committed by TeamCityServer
parent a2b8493f47
commit d5f6674d2d
5 changed files with 53 additions and 3 deletions
@@ -324,7 +324,6 @@ private val jvmFilePhases = listOf(
inventNamesForLocalClassesPhase,
kCallableNamePropertyPhase,
repeatedAnnotationPhase,
annotationPhase,
annotationImplementationPhase,
polymorphicSignaturePhase,
@@ -437,6 +436,7 @@ private val jvmLoweringPhases = NamedCompilerPhase(
scriptsToClassesPhase then
fileClassPhase then
jvmStaticInObjectPhase then
repeatedAnnotationPhase then
performByIrFile(lower = jvmFilePhases) then
generateMultifileFacadesPhase then
resolveInlineCallsPhase then
@@ -6,7 +6,7 @@
package org.jetbrains.kotlin.backend.jvm.lower
import org.jetbrains.kotlin.backend.common.FileLoweringPass
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
import org.jetbrains.kotlin.backend.common.phaser.makeIrModulePhase
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
import org.jetbrains.kotlin.backend.jvm.codegen.AnnotationCodegen.Companion.annotationClass
import org.jetbrains.kotlin.builtins.StandardNames
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
import org.jetbrains.kotlin.ir.visitors.acceptVoid
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
internal val repeatedAnnotationPhase = makeIrFilePhase(
internal val repeatedAnnotationPhase = makeIrModulePhase(
::RepeatedAnnotationLowering,
name = "RepeatedAnnotation",
description = "Enclose repeated annotations in a container annotation, generating a container class if needed"