[FIR] DeprecationsProvider: make evaluation of deprecations on demand

This commit is contained in:
Arseniy Terekhov
2022-08-10 18:06:59 +03:00
committed by teamcity
parent 98ebad2d75
commit 25fc948d95
89 changed files with 517 additions and 326 deletions
@@ -423,6 +423,13 @@ object BuilderConfigurator : AbstractBuilderConfigurator<FirTreeBuilder>(FirTree
) {
default(it, "${declarationAttributesType.type}()")
}
configureFieldInAllLeafBuilders(
field = "deprecationsProvider"
) {
default(it, "UnresolvedDeprecationProvider")
useTypes(unresolvedDeprecationsProviderType)
}
}
private inline fun findImplementationsWithElementInParents(
@@ -88,7 +88,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
callableDeclaration.configure {
+field("returnTypeRef", typeRef, withReplace = true).withTransform()
+field("receiverTypeRef", typeRef, nullable = true, withReplace = true).withTransform()
+field("deprecation", deprecationsPerUseSiteType, nullable = true).withReplace().apply { isMutable = true }
+field("deprecationsProvider", deprecationsProviderType).withReplace().apply { isMutable = true }
+symbol("FirCallableSymbol", "out FirCallableDeclaration")
+field("containerSource", type(DeserializedContainerSource::class), nullable = true)
@@ -245,7 +245,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
classLikeDeclaration.configure {
+symbol("FirClassLikeSymbol", "out FirClassLikeDeclaration")
+field("deprecation", deprecationsPerUseSiteType, nullable = true).withReplace().apply { isMutable = true}
+field("deprecationsProvider", deprecationsProviderType).withReplace().apply { isMutable = true}
}
klass.configure {
@@ -94,7 +94,8 @@ val functionCallOrigin = type("fir.expressions", "FirFunctionCallOrigin")
val resolvedDeclarationStatusImplType = type("fir.declarations.impl", "FirResolvedDeclarationStatusImpl")
val deprecationsPerUseSiteType = type("fir.declarations", "DeprecationsPerUseSite")
val deprecationsProviderType = type("fir.declarations", "DeprecationsProvider")
val unresolvedDeprecationsProviderType = type("fir.declarations", "UnresolvedDeprecationProvider")
val emptyAnnotationArgumentMappingType = type("fir.expressions.impl", "FirEmptyAnnotationArgumentMapping")
val firPropertySymbolType = type("fir.symbols.impl", "FirPropertySymbol")