[FIR] Introduce FirControlFlowGraphOwner node
This commit is contained in:
+8
-6
@@ -23,11 +23,13 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
||||
val declarationStatus = element("DeclarationStatus", Declaration)
|
||||
val resolvedDeclarationStatus = element("ResolvedDeclarationStatus", Declaration, declarationStatus)
|
||||
|
||||
val controlFlowGraphOwner = element("ControlFlowGraphOwner", Declaration)
|
||||
|
||||
val statement = element("Statement", Expression, annotationContainer)
|
||||
val expression = element("Expression", Expression, statement)
|
||||
val declaration = element("Declaration", Declaration)
|
||||
val annotatedDeclaration = element("AnnotatedDeclaration", Declaration, declaration, annotationContainer)
|
||||
val anonymousInitializer = element("AnonymousInitializer", Declaration, declaration, symbolOwner)
|
||||
val anonymousInitializer = element("AnonymousInitializer", Declaration, declaration, symbolOwner, controlFlowGraphOwner)
|
||||
val typedDeclaration = element("TypedDeclaration", Declaration, annotatedDeclaration)
|
||||
val callableDeclaration = element("CallableDeclaration", Declaration, typedDeclaration, symbolOwner)
|
||||
val typeParameterRef = element("TypeParameterRef", Declaration)
|
||||
@@ -38,17 +40,17 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
||||
val callableMemberDeclaration = element("CallableMemberDeclaration", Declaration, callableDeclaration, memberDeclaration)
|
||||
|
||||
val variable = element("Variable", Declaration, callableDeclaration, annotatedDeclaration, statement)
|
||||
val valueParameter = element("ValueParameter", Declaration, variable)
|
||||
val property = element("Property", Declaration, variable, typeParametersOwner, callableMemberDeclaration)
|
||||
val valueParameter = element("ValueParameter", Declaration, variable, controlFlowGraphOwner)
|
||||
val property = element("Property", Declaration, variable, typeParametersOwner, controlFlowGraphOwner, callableMemberDeclaration)
|
||||
val field = element("Field", Declaration, variable, typeParametersOwner, callableMemberDeclaration)
|
||||
val enumEntry = element("EnumEntry", Declaration, variable, callableMemberDeclaration)
|
||||
|
||||
val classLikeDeclaration = element("ClassLikeDeclaration", Declaration, annotatedDeclaration, statement, symbolOwner)
|
||||
val klass = element("Class", Declaration, classLikeDeclaration, statement, typeParameterRefsOwner)
|
||||
val regularClass = element("RegularClass", Declaration, memberDeclaration, typeParameterRefsOwner, klass)
|
||||
val regularClass = element("RegularClass", Declaration, memberDeclaration, typeParameterRefsOwner, controlFlowGraphOwner, klass)
|
||||
val typeAlias = element("TypeAlias", Declaration, classLikeDeclaration, memberDeclaration, typeParametersOwner)
|
||||
|
||||
val function = element("Function", Declaration, callableDeclaration, targetElement, typeParameterRefsOwner, statement)
|
||||
val function = element("Function", Declaration, callableDeclaration, targetElement, typeParameterRefsOwner, controlFlowGraphOwner, statement)
|
||||
|
||||
val contractDescriptionOwner = element("ContractDescriptionOwner", Declaration)
|
||||
val simpleFunction = element("SimpleFunction", Declaration, function, callableMemberDeclaration, contractDescriptionOwner, typeParametersOwner)
|
||||
@@ -57,7 +59,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
||||
val file = element("File", Declaration, annotatedDeclaration)
|
||||
|
||||
val anonymousFunction = element("AnonymousFunction", Declaration, function, expression, typeParametersOwner)
|
||||
val anonymousObject = element("AnonymousObject", Declaration, klass, expression)
|
||||
val anonymousObject = element("AnonymousObject", Declaration, klass, controlFlowGraphOwner, expression)
|
||||
|
||||
val diagnosticHolder = element("DiagnosticHolder", Diagnostics)
|
||||
|
||||
|
||||
+4
-6
@@ -70,6 +70,10 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
+field("diagnostic", coneDiagnosticType)
|
||||
}
|
||||
|
||||
controlFlowGraphOwner.configure {
|
||||
+controlFlowGraphReferenceField
|
||||
}
|
||||
|
||||
declaration.configure {
|
||||
+field("session", firSessionType)
|
||||
+field("resolvePhase", resolvePhaseType, withReplace = true).apply { isMutable = true }
|
||||
@@ -97,7 +101,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
function.configure {
|
||||
withArg("F", "FirFunction<F>")
|
||||
parentArg(callableDeclaration, "F", "F")
|
||||
+controlFlowGraphReferenceField
|
||||
+symbol("FirFunctionSymbol", "F")
|
||||
+fieldList(valueParameter, withReplace = true).withTransform()
|
||||
+body(nullable = true)
|
||||
@@ -243,13 +246,11 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
+field("companionObject", regularClass, nullable = true).withTransform()
|
||||
+booleanField("hasLazyNestedClassifiers")
|
||||
+superTypeRefs(withReplace = true)
|
||||
+controlFlowGraphReferenceField
|
||||
}
|
||||
|
||||
anonymousObject.configure {
|
||||
parentArg(klass, "F", anonymousObject)
|
||||
+symbol("FirAnonymousObjectSymbol")
|
||||
+controlFlowGraphReferenceField
|
||||
}
|
||||
|
||||
typeAlias.configure {
|
||||
@@ -298,7 +299,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
property.configure {
|
||||
parentArg(variable, "F", property)
|
||||
parentArg(callableMemberDeclaration, "F", property)
|
||||
+controlFlowGraphReferenceField
|
||||
+symbol("FirPropertySymbol")
|
||||
+field("backingFieldSymbol", backingFieldSymbolType)
|
||||
+booleanField("isLocal")
|
||||
@@ -351,7 +351,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
parentArg(variable, "F", valueParameter)
|
||||
+field("defaultValue", expression, nullable = true)
|
||||
generateBooleanFields("crossinline", "noinline", "vararg")
|
||||
+controlFlowGraphReferenceField
|
||||
}
|
||||
|
||||
variable.configure {
|
||||
@@ -388,7 +387,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
parentArg(symbolOwner, "E", anonymousInitializer)
|
||||
+body(nullable = true)
|
||||
+symbol(anonymousInitializerSymbolType.type)
|
||||
+controlFlowGraphReferenceField
|
||||
}
|
||||
|
||||
file.configure {
|
||||
|
||||
Reference in New Issue
Block a user