File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -433,16 +433,14 @@ const TypeInfo *TypeConverter::convertArchetypeType(ArchetypeType *archetype) {
433433 : IsNotABIAccessible;
434434 }
435435
436- auto &ASTContext = IGM.getSwiftModule ()->getASTContext ();
437- if (ASTContext.LangOpts .hasFeature (Feature::BitwiseCopyable)) {
438- // TODO: Should this conformance imply isAddressOnlyTrivial is true?
439- auto *proto = ASTContext.getProtocol (KnownProtocolKind::BitwiseCopyable);
440- // It's possible for the protocol not to exist if the stdlib is built
441- // no_asserts.
442- if (proto && IGM.getSwiftModule ()->lookupConformance (archetype, proto)) {
443- return BitwiseCopyableArchetypeTypeInfo::create (storageType,
444- abiAccessible);
445- }
436+ // TODO: Should this conformance imply isAddressOnlyTrivial is true?
437+ auto *bitwiseCopyableProtocol =
438+ IGM.getSwiftModule ()->getASTContext ().getProtocol (
439+ KnownProtocolKind::BitwiseCopyable);
440+ // The protocol won't be present in swiftinterfaces from older SDKs.
441+ if (bitwiseCopyableProtocol && IGM.getSwiftModule ()->lookupConformance (
442+ archetype, bitwiseCopyableProtocol)) {
443+ return BitwiseCopyableArchetypeTypeInfo::create (storageType, abiAccessible);
446444 }
447445
448446 return OpaqueArchetypeTypeInfo::create (storageType, abiAccessible);
You can’t perform that action at this time.
0 commit comments