mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Drop ProtocolDecl's "inherited protocols" list.
The list of directly inherited protocols of a ProtocolDecl is already encoded in the requirement signature, as conformance constraints where the subject is Self. Gather the list from there rather than separately computing/storing the list of "inherited protocols".
This commit is contained in:
@@ -3000,14 +3000,12 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
|
||||
bool isImplicit, isClassBounded, isObjC;
|
||||
GenericEnvironmentID genericEnvID;
|
||||
uint8_t rawAccessLevel;
|
||||
unsigned numProtocols;
|
||||
ArrayRef<uint64_t> rawProtocolAndInheritedIDs;
|
||||
ArrayRef<uint64_t> rawInheritedIDs;
|
||||
|
||||
decls_block::ProtocolLayout::readRecord(scratch, nameID, contextID,
|
||||
isImplicit, isClassBounded, isObjC,
|
||||
genericEnvID, rawAccessLevel,
|
||||
numProtocols,
|
||||
rawProtocolAndInheritedIDs);
|
||||
rawInheritedIDs);
|
||||
|
||||
auto DC = getDeclContext(contextID);
|
||||
if (declOrOffset.isComplete())
|
||||
@@ -3030,14 +3028,7 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
|
||||
assert(genericParams && "protocol with no generic parameters?");
|
||||
proto->setGenericParams(genericParams);
|
||||
|
||||
auto protocols = ctx.Allocate<ProtocolDecl *>(numProtocols);
|
||||
for_each(protocols, rawProtocolAndInheritedIDs.slice(0, numProtocols),
|
||||
[this](ProtocolDecl *&p, uint64_t rawID) {
|
||||
p = cast<ProtocolDecl>(getDecl(rawID));
|
||||
});
|
||||
proto->setInheritedProtocols(protocols);
|
||||
|
||||
handleInherited(proto, rawProtocolAndInheritedIDs.slice(numProtocols));
|
||||
handleInherited(proto, rawInheritedIDs);
|
||||
|
||||
configureGenericEnvironment(proto, genericEnvID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user