From 89e5e106574f748af5642bf395ccff76733577b2 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 4 Jun 2020 18:39:19 +0300 Subject: [PATCH] [FIR2IR] Drop effectively unused FirMetadataSource.File.descriptors NB: only FileClassLowering uses this property to check whether facade is required, and IR-based check is enough in this lowering --- .../src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt | 2 +- .../src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt | 4 ++-- compiler/testData/codegen/box/sam/inlinedSamWrapper.kt | 1 - compiler/testData/codegen/box/sam/kt17091.kt | 1 - compiler/testData/codegen/box/sam/kt17091_2.kt | 1 - compiler/testData/codegen/box/sam/kt17091_3.kt | 1 - compiler/testData/codegen/box/sam/kt17091_4.kt | 1 - compiler/testData/codegen/box/sam/kt22906.kt | 1 - compiler/testData/codegen/box/sam/kt22906_2.kt | 1 - 9 files changed, 3 insertions(+), 10 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 7232c18097a..b706ab84480 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -87,7 +87,7 @@ class Fir2IrVisitor( it.accept(this@Fir2IrVisitor, data) as? IrConstructorCall } - (this as IrFileImpl).metadata = FirMetadataSource.File(file, components.session, declarations.map { it.descriptor }) + (this as IrFileImpl).metadata = FirMetadataSource.File(file, components.session) } } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt index e20ec5fe56b..be29e9a2186 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMetadataSource.kt @@ -18,8 +18,8 @@ interface FirMetadataSource : MetadataSource { val session: FirSession class File( - val file: FirFile, override val session: FirSession, descriptors: List - ) : MetadataSource.File(descriptors), FirMetadataSource + val file: FirFile, override val session: FirSession + ) : MetadataSource.File(emptyList()), FirMetadataSource class Class( val klass: FirClass<*>, descriptor: WrappedClassDescriptor diff --git a/compiler/testData/codegen/box/sam/inlinedSamWrapper.kt b/compiler/testData/codegen/box/sam/inlinedSamWrapper.kt index c36bb773116..6b88883410a 100644 --- a/compiler/testData/codegen/box/sam/inlinedSamWrapper.kt +++ b/compiler/testData/codegen/box/sam/inlinedSamWrapper.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: MyRunnable.java diff --git a/compiler/testData/codegen/box/sam/kt17091.kt b/compiler/testData/codegen/box/sam/kt17091.kt index b54c20f2c06..b6da586db2a 100644 --- a/compiler/testData/codegen/box/sam/kt17091.kt +++ b/compiler/testData/codegen/box/sam/kt17091.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: Foo.kt diff --git a/compiler/testData/codegen/box/sam/kt17091_2.kt b/compiler/testData/codegen/box/sam/kt17091_2.kt index 2084dd8ff68..a4fffc0cec0 100644 --- a/compiler/testData/codegen/box/sam/kt17091_2.kt +++ b/compiler/testData/codegen/box/sam/kt17091_2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: Foo.kt diff --git a/compiler/testData/codegen/box/sam/kt17091_3.kt b/compiler/testData/codegen/box/sam/kt17091_3.kt index 660692c2fa8..2282bfc5444 100644 --- a/compiler/testData/codegen/box/sam/kt17091_3.kt +++ b/compiler/testData/codegen/box/sam/kt17091_3.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: Foo.kt diff --git a/compiler/testData/codegen/box/sam/kt17091_4.kt b/compiler/testData/codegen/box/sam/kt17091_4.kt index 8cf3c7ad36b..e41aad8b0de 100644 --- a/compiler/testData/codegen/box/sam/kt17091_4.kt +++ b/compiler/testData/codegen/box/sam/kt17091_4.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: Foo.kt diff --git a/compiler/testData/codegen/box/sam/kt22906.kt b/compiler/testData/codegen/box/sam/kt22906.kt index 1d140b9838d..16f799c8a9e 100644 --- a/compiler/testData/codegen/box/sam/kt22906.kt +++ b/compiler/testData/codegen/box/sam/kt22906.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: kt22906_1.kt diff --git a/compiler/testData/codegen/box/sam/kt22906_2.kt b/compiler/testData/codegen/box/sam/kt22906_2.kt index e54448e85ef..1699464b814 100644 --- a/compiler/testData/codegen/box/sam/kt22906_2.kt +++ b/compiler/testData/codegen/box/sam/kt22906_2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: kt22906_1.kt