[FIR] Add FirAbstractElement as base type for all fir node implementations

This commit is contained in:
Dmitriy Novozhilov
2019-10-16 18:28:31 +03:00
parent f19a878948
commit f8f2d8b9a1
95 changed files with 210 additions and 96 deletions
@@ -169,7 +169,8 @@ fun Implementation.generateCode(generationPath: String) {
fun Implementation.collectImports(): List<String> {
return element.collectImportsInternal(
listOf(element.fullQualifiedName) + usedTypes.mapNotNull { it.fullQualifiedName } + parents.mapNotNull { it.fullQualifiedName },
listOf(element.fullQualifiedName) + usedTypes.mapNotNull { it.fullQualifiedName } + parents.mapNotNull { it.fullQualifiedName }
+ listOfNotNull(pureAbstractElementType.fullQualifiedName?.takeIf { kind != Implementation.Kind.Interface }),
isImpl = true
)
}
@@ -272,7 +273,11 @@ fun PrintWriter.printImplementation(implementation: Implementation) {
print(")")
}
print(" : ${element.typeWithArguments}")
print(" : ")
if (!isInterface) {
print("${pureAbstractElementType.type}(), ")
}
print(element.typeWithArguments)
parents.forEach {
print(", ${it.typeWithArguments}")
}
@@ -59,4 +59,6 @@ val compositeTransformResultType = type("fir.visitors", "CompositeTransformResul
val abstractFirBasedSymbolType = type("fir.symbols", "AbstractFirBasedSymbol")
val backingFieldSymbolType = type("fir.symbols.impl", "FirBackingFieldSymbol")
val delegateFieldSymbolType = type("fir.symbols.impl", "FirDelegateFieldSymbol")
val classSymbolType = type("fir.symbols.impl", "FirClassSymbol")
val classSymbolType = type("fir.symbols.impl", "FirClassSymbol")
val pureAbstractElementType = generatedType("FirPureAbstractElement")