mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Optimize TypeAliasType representation
This commit is contained in:
@@ -5480,17 +5480,21 @@ public:
|
||||
|
||||
void visitTypeAliasType(const TypeAliasType *alias) {
|
||||
using namespace decls_block;
|
||||
|
||||
const TypeAliasDecl *typeAlias = alias->getDecl();
|
||||
auto underlyingType = typeAlias->getUnderlyingType();
|
||||
SmallVector<TypeID, 8> genericArgIDs;
|
||||
|
||||
for (auto next : alias->getDirectGenericArgs())
|
||||
genericArgIDs.push_back(S.addTypeRef(next));
|
||||
|
||||
unsigned abbrCode = S.DeclTypeAbbrCodes[TypeAliasTypeLayout::Code];
|
||||
TypeAliasTypeLayout::emitRecord(
|
||||
S.Out, S.ScratchRecord, abbrCode,
|
||||
S.addDeclRef(typeAlias, /*allowTypeAliasXRef*/true),
|
||||
S.addTypeRef(alias->getParent()),
|
||||
S.addTypeRef(underlyingType),
|
||||
S.addTypeRef(typeAlias->getUnderlyingType()),
|
||||
S.addTypeRef(alias->getSinglyDesugaredType()),
|
||||
S.addSubstitutionMapRef(alias->getSubstitutionMap()));
|
||||
S.addTypeRef(alias->getParent()),
|
||||
genericArgIDs);
|
||||
}
|
||||
|
||||
template <typename Layout>
|
||||
|
||||
Reference in New Issue
Block a user