From df6b4388a017d0ac54fab2e67d4e936a766ab8ce Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Tue, 4 Oct 2016 13:55:39 +0300 Subject: [PATCH] backend.native: add only overridable methods to vtable and lookup table --- .../jetbrains/kotlin/backend/native/llvm/RTTIGenerator.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/native/llvm/RTTIGenerator.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/native/llvm/RTTIGenerator.kt index a7ff4e1ee29..ea8976faf5f 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/native/llvm/RTTIGenerator.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/native/llvm/RTTIGenerator.kt @@ -104,13 +104,16 @@ internal class RTTIGenerator(override val context: Context) : ContextUtils { val contributedDescriptors = classDesc.unsubstitutedMemberScope.getContributedDescriptors() // (includes declarations from supers) - val methods = contributedDescriptors.filterIsInstance() + val functions = contributedDescriptors.filterIsInstance() val properties = contributedDescriptors.filterIsInstance() val getters = properties.mapNotNull { it.getter } val setters = properties.mapNotNull { it.setter } - return methods + getters + setters + val allMethods = functions + getters + setters + + // TODO: adding or removing 'open' modifier will break the binary compatibility + return allMethods.filter { it.modality != Modality.FINAL } } fun generate(classDesc: ClassDescriptor) {