Generalize (Primary|Sequence)ArchetypeType to arbitrary interface types.

As another step toward eliminating NestedArchetypeType, generalize the
representation, construction, and serialization of primary and sequence
archetypes to interface types, rather than generic parameter types.
This commit is contained in:
Doug Gregor
2022-01-12 11:21:22 -08:00
parent 50fd5b5be6
commit ac4d26d711
7 changed files with 45 additions and 46 deletions

View File

@@ -4462,14 +4462,11 @@ public:
auto sig = archetypeTy->getGenericEnvironment()->getGenericSignature();
GenericSignatureID sigID = S.addGenericSignatureRef(sig);
auto interfaceType = archetypeTy->getInterfaceType()
->castTo<GenericTypeParamType>();
TypeID interfaceTypeID = S.addTypeRef(archetypeTy->getInterfaceType());
unsigned abbrCode = S.DeclTypeAbbrCodes[PrimaryArchetypeTypeLayout::Code];
PrimaryArchetypeTypeLayout::emitRecord(S.Out, S.ScratchRecord, abbrCode,
sigID,
interfaceType->getDepth(),
interfaceType->getIndex());
sigID, interfaceTypeID);
}
void visitOpenedArchetypeType(const OpenedArchetypeType *archetypeTy) {
@@ -4503,13 +4500,11 @@ public:
auto sig = archetypeTy->getGenericEnvironment()->getGenericSignature();
GenericSignatureID sigID = S.addGenericSignatureRef(sig);
auto interfaceType =
archetypeTy->getInterfaceType()->castTo<GenericTypeParamType>();
TypeID interfaceTypeID = S.addTypeRef(archetypeTy->getInterfaceType());
unsigned abbrCode = S.DeclTypeAbbrCodes[SequenceArchetypeTypeLayout::Code];
SequenceArchetypeTypeLayout::emitRecord(S.Out, S.ScratchRecord, abbrCode,
sigID, interfaceType->getDepth(),
interfaceType->getIndex());
sigID, interfaceTypeID);
}
void visitGenericTypeParamType(const GenericTypeParamType *genericParam) {