mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Make requirement signature conformance loading lazy.
The previous commit needed this for the importer, so we might as well take advantage of it in deserialization as well. No expected change in behavior.
This commit is contained in:
@@ -654,16 +654,6 @@ NormalProtocolConformance *ModuleFile::readNormalConformance(
|
|||||||
dc->getAsNominalTypeOrNominalTypeExtensionContext()
|
dc->getAsNominalTypeOrNominalTypeExtensionContext()
|
||||||
->registerProtocolConformance(conformance);
|
->registerProtocolConformance(conformance);
|
||||||
|
|
||||||
// Read requirement signature conformances.
|
|
||||||
SmallVector<ProtocolConformanceRef, 4> reqConformances;
|
|
||||||
for (const auto &req : proto->getRequirementSignature()) {
|
|
||||||
if (req.getKind() == RequirementKind::Conformance) {
|
|
||||||
auto reqConformance = readConformance(DeclTypeCursor);
|
|
||||||
reqConformances.push_back(reqConformance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
conformance->setSignatureConformances(reqConformances);
|
|
||||||
|
|
||||||
// If the conformance is complete, we're done.
|
// If the conformance is complete, we're done.
|
||||||
if (conformance->isComplete())
|
if (conformance->isComplete())
|
||||||
return conformance;
|
return conformance;
|
||||||
@@ -4594,13 +4584,16 @@ void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
|
|||||||
typeCount,
|
typeCount,
|
||||||
rawIDs);
|
rawIDs);
|
||||||
|
|
||||||
// Skip requirement signature conformances.
|
// Read requirement signature conformances.
|
||||||
auto proto = conformance->getProtocol();
|
const ProtocolDecl *proto = conformance->getProtocol();
|
||||||
|
SmallVector<ProtocolConformanceRef, 4> reqConformances;
|
||||||
for (const auto &req : proto->getRequirementSignature()) {
|
for (const auto &req : proto->getRequirementSignature()) {
|
||||||
if (req.getKind() == RequirementKind::Conformance) {
|
if (req.getKind() == RequirementKind::Conformance) {
|
||||||
(void)readConformance(DeclTypeCursor);
|
auto reqConformance = readConformance(DeclTypeCursor);
|
||||||
|
reqConformances.push_back(reqConformance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
conformance->setSignatureConformances(reqConformances);
|
||||||
|
|
||||||
ArrayRef<uint64_t>::iterator rawIDIter = rawIDs.begin();
|
ArrayRef<uint64_t>::iterator rawIDIter = rawIDs.begin();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user