SIL: Add instructions to convert metatypes to object references.

Add objc_metatype_to_object and objc_existential_metatype_to_object to convert metatypes to AnyObject, and objc_protocol to get a reference to an @objc protocol descriptor as a Protocol class instance.

Swift SVN r18824
This commit is contained in:
Joe Groff
2014-06-12 05:34:03 +00:00
parent d49a718da3
commit 1f1c00cf9e
16 changed files with 288 additions and 2 deletions

View File

@@ -72,6 +72,7 @@ static bool isTransitiveEscapeInst(SILInstruction *Inst) {
case ValueKind::LoadInst:
case ValueKind::LoadWeakInst:
case ValueKind::MetatypeInst:
case ValueKind::ObjCProtocolInst:
case ValueKind::SILGlobalAddrInst:
case ValueKind::StoreInst:
case ValueKind::StoreWeakInst:
@@ -111,6 +112,8 @@ static bool isTransitiveEscapeInst(SILInstruction *Inst) {
case ValueKind::InitEnumDataAddrInst:
case ValueKind::InitExistentialInst:
case ValueKind::InitExistentialRefInst:
case ValueKind::ObjCExistentialMetatypeToObjectInst:
case ValueKind::ObjCMetatypeToObjectInst:
case ValueKind::ObjCToThickMetatypeInst:
case ValueKind::UncheckedRefCastInst:
case ValueKind::UncheckedAddrCastInst: