Preserve dictionary type sugar in the type system.

Another piece of <rdar://problem/17460972>.


Swift SVN r19253
This commit is contained in:
Doug Gregor
2014-06-26 21:12:19 +00:00
parent 4ac0f31852
commit 07a7059934
13 changed files with 149 additions and 5 deletions

View File

@@ -2308,6 +2308,16 @@ void Serializer::writeType(Type ty) {
break;
}
case TypeKind::Dictionary: {
auto dictTy = cast<DictionaryType>(ty.getPointer());
unsigned abbrCode = DeclTypeAbbrCodes[DictionaryTypeLayout::Code];
DictionaryTypeLayout::emitRecord(Out, ScratchRecord, abbrCode,
addTypeRef(dictTy->getKeyType()),
addTypeRef(dictTy->getValueType()));
break;
}
case TypeKind::Optional: {
auto sliceTy = cast<OptionalType>(ty.getPointer());
@@ -2483,6 +2493,7 @@ void Serializer::writeAllDeclsAndTypes() {
registerDeclTypeAbbr<SILBlockStorageTypeLayout>();
registerDeclTypeAbbr<SILFunctionTypeLayout>();
registerDeclTypeAbbr<ArraySliceTypeLayout>();
registerDeclTypeAbbr<DictionaryTypeLayout>();
registerDeclTypeAbbr<ReferenceStorageTypeLayout>();
registerDeclTypeAbbr<UnboundGenericTypeLayout>();
registerDeclTypeAbbr<OptionalTypeLayout>();