Serialization: Remove mechanism for serializing references to in-memory Decl's AllArchetypes

I don't see any tests failing with this code removed; I guess
either the duplicate archetype issue no longer occurs, or does
not matter since we use interface types almost everywhere
when talking about Decls from other modules.
This commit is contained in:
Slava Pestov
2016-08-20 00:37:07 -07:00
parent 5568dac631
commit 8d9ad273ba
3 changed files with 5 additions and 63 deletions

View File

@@ -3816,19 +3816,9 @@ Type ModuleFile::getType(TypeID TID) {
auto nominal = cast<NominalTypeDecl>(getDecl(declID));
auto parentTy = getType(parentID);
// Check the first ID to decide if we are using indices to the Decl's
// Archetypes.
SmallVector<Type, 8> genericArgs;
if (rawArgumentIDs.size() > 1 && rawArgumentIDs[0] == INT32_MAX) {
for (unsigned i = 1; i < rawArgumentIDs.size(); i++) {
auto index = rawArgumentIDs[i];
genericArgs.push_back(nominal->getGenericParams()
->getAllArchetypes()[index]);
}
} else {
for (TypeID type : rawArgumentIDs)
genericArgs.push_back(getType(type));
}
for (TypeID type : rawArgumentIDs)
genericArgs.push_back(getType(type));
auto boundTy = BoundGenericType::get(nominal, parentTy, genericArgs);
typeOrOffset = boundTy;