Merge pull request #12321 from DougGregor/assoc-type-overrides

Track "overrides" of associated types
This commit is contained in:
Doug Gregor
2017-10-09 12:59:21 -07:00
committed by GitHub
19 changed files with 366 additions and 98 deletions

View File

@@ -2720,6 +2720,10 @@ void Serializer::writeDecl(const Decl *D) {
verifyAttrSerializable(assocType);
auto contextID = addDeclContextRef(assocType->getDeclContext());
SmallVector<DeclID, 4> overriddenAssocTypeIDs;
for (auto overridden : assocType->getOverriddenDecls()) {
overriddenAssocTypeIDs.push_back(addDeclRef(overridden));
}
unsigned abbrCode = DeclTypeAbbrCodes[AssociatedTypeDeclLayout::Code];
AssociatedTypeDeclLayout::emitRecord(
@@ -2727,7 +2731,8 @@ void Serializer::writeDecl(const Decl *D) {
addDeclBaseNameRef(assocType->getName()),
contextID,
addTypeRef(assocType->getDefaultDefinitionType()),
assocType->isImplicit());
assocType->isImplicit(),
overriddenAssocTypeIDs);
break;
}