More of stdlib. (#183)

This commit is contained in:
Nikolay Igotti
2017-01-24 15:27:08 +03:00
committed by GitHub
parent 7226a47edf
commit afeb1b2d55
26 changed files with 4613 additions and 169 deletions
@@ -37,5 +37,5 @@ val PropertyDescriptor.backingField: PropertyDescriptor?
}
fun DeclarationDescriptor.deepPrint() {
this!!.accept(DeepPrintVisitor(PrintVisitor()), 0)
this.accept(DeepPrintVisitor(PrintVisitor()), 0)
}
@@ -1334,6 +1334,8 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid
private fun genInstanceOf(obj: LLVMValueRef, type: KotlinType): LLVMValueRef {
val dstDescriptor = TypeUtils.getClassDescriptor(type) // Get class descriptor for dst type.
// Reified parameters are not yet supported.
assert(dstDescriptor != null)
val dstTypeInfo = codegen.typeInfoValue(dstDescriptor!!) // Get TypeInfo for dst type.
val srcObjInfoPtr = codegen.bitcast(codegen.kObjHeaderPtr, obj) // Cast src to ObjInfoPtr.
val args = listOf(srcObjInfoPtr, dstTypeInfo) // Create arg list.