IR: drop IrFile.fileAnnotations (it already has annotations anyway)

This commit is contained in:
Dmitry Petrov
2019-03-14 16:10:57 +03:00
parent b42aa39033
commit 110a15d395
8 changed files with 7 additions and 28 deletions
@@ -186,9 +186,6 @@ class RenderIrElementWithDescriptorsVisitor : IrElementVisitor<String, Nothing?>
internal fun IrDeclaration.name(): String =
descriptor.let { it.name.toString() }
internal fun IrDeclaration.renderDeclared(): String =
DECLARATION_RENDERER.render(this.descriptor)
internal fun DeclarationDescriptor.ref(): String =
if (this is ReceiverParameterDescriptor)
"<receiver: ${containingDeclaration.ref()}>"
@@ -198,8 +195,6 @@ class RenderIrElementWithDescriptorsVisitor : IrElementVisitor<String, Nothing?>
internal fun KotlinType.render(): String =
DECLARATION_RENDERER.renderType(this)
internal fun IrDeclaration.renderOrigin(): String =
if (origin != IrDeclarationOrigin.DEFINED) origin.toString() + " " else ""
}
}
@@ -220,11 +215,11 @@ class DumpIrTreeWithDescriptorsVisitor(out: Appendable) : IrElementVisitor<Unit,
override fun visitFile(declaration: IrFile, data: String) {
declaration.dumpLabeledElementWith(data) {
if (declaration.fileAnnotations.isNotEmpty()) {
printer.println("fileAnnotations:")
if (declaration.annotations.isNotEmpty()) {
printer.println("annotations:")
indented {
declaration.fileAnnotations.forEach {
printer.println(ANNOTATIONS_RENDERER.renderAnnotation(it))
declaration.annotations.forEach {
it.accept(this, "")
}
}
}