[FIR] introduce FirFileAnnotationsContainer

This commit is contained in:
Ilya Kirillov
2022-12-08 15:45:16 +01:00
committed by teamcity
parent 8fd892176a
commit 67adc3fb1a
11 changed files with 165 additions and 0 deletions
@@ -30,6 +30,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
val contextReceiver by element(Declaration)
val elementWithResolvePhase by element(Other)
val fileAnnotationsContainer by element(Other, elementWithResolvePhase, annotationContainer)
val declaration by sealedElement(Declaration, elementWithResolvePhase, annotationContainer)
val typeParameterRefsOwner by sealedElement(Declaration)
val typeParametersOwner by sealedElement(Declaration, typeParameterRefsOwner)
@@ -83,6 +83,10 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
shouldBeAbstractClass()
}
fileAnnotationsContainer.configure {
+field("containingFileSymbol", type("fir.symbols.impl", "FirFileSymbol"), argument = null)
}
declaration.configure {
+symbolWithPackage("fir.symbols", "FirBasedSymbol", "out FirDeclaration")
+field("moduleData", firModuleDataType)
@@ -113,6 +113,7 @@ fun SmartPrinter.printImplementation(implementation: Implementation) {
!element.type.contains("Reference")
&& !element.type.contains("ResolvedQualifier")
&& !element.type.endsWith("Ref")
&& !element.type.endsWith("AnnotationsContainer")
}?.let { symbolFields ->
println("init {")
for (symbolField in symbolFields) {