Record the protocols and superclass for generic parameters.

This allows us to use getProtocols() rather than getInherited()
wherever we're dealing with generic parameters and associated types.


Swift SVN r6683
This commit is contained in:
Doug Gregor
2013-07-29 14:27:25 +00:00
parent 69d3392191
commit 3d0c2e2612
9 changed files with 118 additions and 66 deletions

View File

@@ -716,11 +716,13 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext,
TypeID underlyingTypeID;
bool isGeneric;
bool isImplicit;
TypeID superclassTypeID;
ArrayRef<uint64_t> inheritedIDs;
decls_block::TypeAliasLayout::readRecord(scratch, nameID, contextID,
underlyingTypeID,
isGeneric, isImplicit,
superclassTypeID,
inheritedIDs);
auto inherited =
@@ -754,8 +756,10 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext,
if (isImplicit)
alias->setImplicit();
if (isGeneric)
if (isGeneric) {
alias->setGenericParameter();
alias->setSuperclass(getType(superclassTypeID));
}
CanType canBaseTy = underlyingType.getType()->getCanonicalType();