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
@@ -17,9 +17,9 @@
package org.jetbrains.kotlin.ir.declarations
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.SourceManager
import org.jetbrains.kotlin.ir.expressions.IrCall
import org.jetbrains.kotlin.ir.symbols.IrExternalPackageFragmentSymbol
import org.jetbrains.kotlin.ir.symbols.IrFileSymbol
import org.jetbrains.kotlin.ir.symbols.IrPackageFragmentSymbol
@@ -42,7 +42,6 @@ interface IrFile : IrPackageFragment, IrAnnotationContainer, IrMetadataSourceOwn
override val symbol: IrFileSymbol
val fileEntry: SourceManager.FileEntry
val fileAnnotations: MutableList<AnnotationDescriptor>
override val metadata: MetadataSource.File?
@@ -17,7 +17,6 @@
package org.jetbrains.kotlin.ir.declarations.impl
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.ir.IrElementBase
import org.jetbrains.kotlin.ir.SourceManager
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
@@ -29,7 +28,6 @@ import org.jetbrains.kotlin.ir.symbols.impl.IrFileSymbolImpl
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.utils.SmartList
class IrFileImpl(
override val fileEntry: SourceManager.FileEntry,
@@ -42,14 +40,12 @@ class IrFileImpl(
constructor(
fileEntry: SourceManager.FileEntry,
symbol: IrFileSymbol
) :
this(fileEntry, symbol, symbol.descriptor.fqName)
) : this(fileEntry, symbol, symbol.descriptor.fqName)
constructor(
fileEntry: SourceManager.FileEntry,
packageFragmentDescriptor: PackageFragmentDescriptor
) :
this(fileEntry, IrFileSymbolImpl(packageFragmentDescriptor), packageFragmentDescriptor.fqName)
) : this(fileEntry, IrFileSymbolImpl(packageFragmentDescriptor), packageFragmentDescriptor.fqName)
init {
symbol.bind(this)
@@ -57,8 +53,6 @@ class IrFileImpl(
override val packageFragmentDescriptor: PackageFragmentDescriptor get() = symbol.descriptor
override val fileAnnotations: MutableList<AnnotationDescriptor> = SmartList()
override val declarations: MutableList<IrDeclaration> = ArrayList()
override val annotations: MutableList<IrCall> = ArrayList()
@@ -110,7 +110,6 @@ open class DeepCopyIrTreeWithSymbols(
symbolRenamer.getFileName(declaration.symbol)
).apply {
transformAnnotations(declaration)
fileAnnotations.addAll(declaration.fileAnnotations)
declaration.transformDeclarationsTo(this)
}
@@ -80,9 +80,6 @@ class DumpIrTreeVisitor(
override fun visitFile(declaration: IrFile, data: String) {
declaration.dumpLabeledElementWith(data) {
declaration.fileAnnotations.dumpItemsWith("fileAnnotations") {
ANNOTATIONS_RENDERER.renderAnnotation(it)
}
dumpAnnotations(declaration)
declaration.declarations.dumpElements()
}