mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Store the conforming type within an abstract ProtocolConformanceRef
An "abstract" ProtocolConformanceRef is a conformance of a type parameter or archetype to a given protocol. Previously, we would only store the protocol requirement itself---but not track the actual conforming type, requiring clients of ProtocolConformanceRef to keep track of this information separately. Record the conforming type as part of an abstract ProtocolConformanceRef, so that clients will be able to recover it later. This is handled by a uniqued AbstractConformance structure, so that ProtocolConformanceRef itself stays one pointer. There remain a small number of places where we create an abstract ProtocolConformanceRef with a null type. We'll want to chip away at those and establish some stronger invariants on the abstract conformance in the future.
This commit is contained in:
@@ -1000,6 +1000,10 @@ bool ModuleFileSharedCore::readIndexBlock(llvm::BitstreamCursor &cursor) {
|
||||
assert(blobData.empty());
|
||||
allocateBuffer(Conformances, scratch);
|
||||
break;
|
||||
case index_block::ABSTRACT_CONFORMANCE_OFFSETS:
|
||||
assert(blobData.empty());
|
||||
allocateBuffer(AbstractConformances, scratch);
|
||||
break;
|
||||
case index_block::PACK_CONFORMANCE_OFFSETS:
|
||||
assert(blobData.empty());
|
||||
allocateBuffer(PackConformances, scratch);
|
||||
|
||||
Reference in New Issue
Block a user