[FIR] mark empty file annotation container as resolved

To avoid redundant lazy resolve

^KT-56551
This commit is contained in:
Dmitrii Gridin
2023-05-15 19:50:16 +02:00
committed by Space Team
parent 622f9fb13c
commit 33140b7fcf
108 changed files with 1381 additions and 1372 deletions
@@ -120,11 +120,12 @@ class DeclarationsConverter(
this.sourceFile = sourceFile
this.sourceFileLinesMapping = linesMapping
this.packageDirective = packageDirective ?: buildPackageDirective { packageFqName = context.packageFqName }
annotationsContainer = fileAnnotationContainer
?: buildFileAnnotationsContainer {
moduleData = baseModuleData
containingFileSymbol = fileSymbol
}
annotationsContainer = fileAnnotationContainer ?: buildFileAnnotationsContainer {
moduleData = baseModuleData
containingFileSymbol = fileSymbol
resolvePhase = FirResolvePhase.BODY_RESOLVE
}
imports += importList
declarations += firDeclarationList
}
@@ -329,6 +330,10 @@ class DeclarationsConverter(
ANNOTATION_ENTRY -> container += convertAnnotationEntry(node)
}
}
annotations.ifEmpty {
resolvePhase = FirResolvePhase.BODY_RESOLVE
}
}
}
@@ -1049,6 +1049,10 @@ open class RawFirBuilder(
for (annotationEntry in file.annotationEntries) {
annotations += annotationEntry.convert<FirAnnotation>()
}
annotations.ifEmpty {
resolvePhase = FirResolvePhase.BODY_RESOLVE
}
}
for (importDirective in file.importDirectives) {