[Runtime] Eliminate the now-unused "NonuniqueDirectType" type reference kind.

Now that we use nominal type descriptors for everything that we can within
protocol conformance records, eliminate the unused
"NonuniqueDirectType" case and all of the code that supports it. Leave
this value explicitly reserved for the future.
This commit is contained in:
Doug Gregor
2018-01-04 13:21:58 -08:00
parent e0255467cb
commit cc3e3701b2
5 changed files with 23 additions and 88 deletions

View File

@@ -48,13 +48,8 @@ template<> void ProtocolConformanceRecord::dump() const {
};
switch (auto kind = getTypeKind()) {
case TypeMetadataRecordKind::NonuniqueDirectType:
printf("direct type nonunique ");
if (const auto *ntd = getDirectType()->getNominalTypeDescriptor()) {
printf("%s", ntd->Name.get());
} else {
printf("<structural type>");
}
case TypeMetadataRecordKind::Reserved:
printf("unknown (reserved)");
break;
case TypeMetadataRecordKind::IndirectObjCClass:
printf("indirect Objective-C class %s",
@@ -94,12 +89,8 @@ template<> void ProtocolConformanceRecord::dump() const {
template <>
const Metadata *ProtocolConformanceRecord::getCanonicalTypeMetadata() const {
switch (getTypeKind()) {
case TypeMetadataRecordKind::NonuniqueDirectType: {
// Ask the runtime for the unique metadata record we've canonized.
const ForeignTypeMetadata *FMD =
static_cast<const ForeignTypeMetadata *>(getDirectType());
return swift_getForeignTypeMetadata(const_cast<ForeignTypeMetadata *>(FMD));
}
case TypeMetadataRecordKind::Reserved:
return nullptr;
case TypeMetadataRecordKind::IndirectObjCClass:
// The class may be ObjC, in which case we need to instantiate its Swift
// metadata. The class additionally may be weak-linked, so we have to check