Add more runtime, avoid codegen for interfaces. (#47)
* Add more runtime, avoid codegen for interfaces. * backend: fix bug in RTTIGenerator kotlin.Nothing has no supertypes * runtime: enable kotlin.Nothing
This commit is contained in:
+6
@@ -2,6 +2,7 @@ package org.jetbrains.kotlin.backend.konan.llvm
|
||||
|
||||
import kotlin_native.interop.*
|
||||
import llvm.*
|
||||
import org.jetbrains.kotlin.backend.konan.isInterface
|
||||
import org.jetbrains.kotlin.backend.konan.isIntrinsic
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
@@ -204,6 +205,11 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
|
||||
return
|
||||
}
|
||||
|
||||
if (declaration.descriptor.isInterface) {
|
||||
// Do not generate any code for interfaces.
|
||||
return
|
||||
}
|
||||
|
||||
super.visitClass(declaration)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ internal class RTTIGenerator(override val context: Context) : ContextUtils {
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
val superVtableEntries = if (KotlinBuiltIns.isAny(classDesc)) {
|
||||
val superVtableEntries = if (KotlinBuiltIns.isSpecialClassWithNoSupertypes(classDesc)) {
|
||||
emptyList()
|
||||
} else {
|
||||
getVtableEntries(classDesc.getSuperClassOrAny())
|
||||
|
||||
Reference in New Issue
Block a user