mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Simplify serialized representation of archetype types.
We don't need to store the associated type declaration and name separately in the module file, either.
This commit is contained in:
@@ -2962,13 +2962,16 @@ void Serializer::writeType(Type ty) {
|
||||
for (auto proto : archetypeTy->getConformsTo())
|
||||
conformances.push_back(addDeclRef(proto));
|
||||
|
||||
DeclID assocTypeID = addDeclRef(archetypeTy->getAssocType());
|
||||
DeclID assocTypeOrNameID;
|
||||
if (archetypeTy->getParent())
|
||||
assocTypeOrNameID = addDeclRef(archetypeTy->getAssocType());
|
||||
else
|
||||
assocTypeOrNameID = addIdentifierRef(archetypeTy->getName());
|
||||
|
||||
unsigned abbrCode = DeclTypeAbbrCodes[ArchetypeTypeLayout::Code];
|
||||
ArchetypeTypeLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
addIdentifierRef(archetypeTy->getName()),
|
||||
parentID,
|
||||
assocTypeID,
|
||||
assocTypeOrNameID,
|
||||
addTypeRef(archetypeTy->getSuperclass()),
|
||||
conformances);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user