Explicitly referenced possible super types of forward declarations

This commit is contained in:
Igor Chevdar
2019-03-14 16:36:56 +03:00
committed by Ilya Matveev
parent 87c852fb1d
commit 6931220c82
2 changed files with 7 additions and 0 deletions
@@ -35,6 +35,7 @@ internal class InteropBuiltIns(builtIns: KonanBuiltIns) {
val cValuesRef = this.packageScope.getContributedClass("CValuesRef")
val cValues = this.packageScope.getContributedClass("CValues")
val cValue = this.packageScope.getContributedClass("CValue")
val cOpaque = this.packageScope.getContributedClass("COpaque")
val cValueWrite = this.packageScope.getContributedFunctions("write")
.single { it.extensionReceiverParameter?.type?.constructor?.declarationDescriptor == cValue }
val cValueRead = this.packageScope.getContributedFunctions("readValue")
@@ -206,6 +206,12 @@ internal class KonanSymbols(context: Context, val symbolTable: SymbolTable, val
val interopAllocObjCObject = symbolTable.referenceSimpleFunction(context.interopBuiltIns.allocObjCObject)
// These are possible supertypes of forward declarations - we need to reference them explicitly to force their deserialization.
// TODO: Do it lazily.
val interopCOpaque = symbolTable.referenceClass(context.interopBuiltIns.cOpaque)
val interopObjCObject = symbolTable.referenceClass(context.interopBuiltIns.objCObject)
val interopObjCObjectBase = symbolTable.referenceClass(context.interopBuiltIns.objCObjectBase)
val interopObjCRelease = interopFunction("objc_release")
val interopObjCRetain = interopFunction("objc_retain")