[FIR] introduce FirElementWithResolvePhase class and make it a base class for FirDeclaration

This commit is contained in:
Ilya Kirillov
2022-12-08 15:22:47 +01:00
committed by teamcity
parent 1a76804862
commit 8fd892176a
76 changed files with 163 additions and 108 deletions
@@ -29,7 +29,8 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
val contextReceiver by element(Declaration)
val declaration by sealedElement(Declaration, annotationContainer)
val elementWithResolvePhase by element(Other)
val declaration by sealedElement(Declaration, elementWithResolvePhase, annotationContainer)
val typeParameterRefsOwner by sealedElement(Declaration)
val typeParametersOwner by sealedElement(Declaration, typeParameterRefsOwner)
val memberDeclaration by sealedElement(Declaration, declaration, typeParameterRefsOwner)
@@ -76,10 +76,16 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
+field("labelNameFromTypeRef", nameType, nullable = true)
}
elementWithResolvePhase.configure {
+field("resolvePhase", resolvePhaseType, withReplace = true).apply { isMutable = true; isVolatile = true }
+field("moduleData", firModuleDataType)
shouldBeAbstractClass()
}
declaration.configure {
+symbolWithPackage("fir.symbols", "FirBasedSymbol", "out FirDeclaration")
+field("moduleData", firModuleDataType)
+field("resolvePhase", resolvePhaseType, withReplace = true).apply { isMutable = true; isVolatile = true }
+field("origin", declarationOriginType)
+field("attributes", declarationAttributesType)
shouldBeAbstractClass()