Make ArchetypeType::NestedType its own proper type

with more explicit/semantic conversions in and out.

Using a PointerUnion with overlapping pointer types
is both error-prone and pretty close to illegible.

Swift SVN r24707
This commit is contained in:
John McCall
2015-01-24 13:05:38 +00:00
parent 0ac649d87b
commit 9e26ecf2af
13 changed files with 91 additions and 63 deletions

View File

@@ -2337,9 +2337,8 @@ void Serializer::writeType(Type ty) {
SmallVector<bool, 4> areArchetypes;
for (auto next : archetypeTy->getNestedTypes()) {
nestedTypeNames.push_back(addIdentifierRef(next.first));
nestedTypes.push_back(
addTypeRef(ArchetypeType::getNestedTypeValue(next.second)));
areArchetypes.push_back(next.second.is<ArchetypeType*>());
nestedTypes.push_back(addTypeRef(next.second.getValue()));
areArchetypes.push_back(!next.second.isConcreteType());
}
abbrCode = DeclTypeAbbrCodes[ArchetypeNestedTypeNamesLayout::Code];