[serialization] Handle oneof and class types (but not decls).

This allows us to reference Bool.

Swift SVN r6030
This commit is contained in:
Jordan Rose
2013-07-06 00:19:40 +00:00
parent 637c4e8171
commit eb9a1feaf3
3 changed files with 17 additions and 43 deletions

View File

@@ -1019,12 +1019,12 @@ Type ModuleFile::getType(TypeID TID) {
break;
}
case decls_block::STRUCT_TYPE: {
DeclID structID;
case decls_block::NOMINAL_TYPE: {
DeclID declID;
TypeID parentID;
decls_block::StructTypeLayout::readRecord(scratch, structID, parentID);
typeOrOffset = StructType::get(cast<StructDecl>(getDecl(structID)),
getType(parentID), ctx);
decls_block::NominalTypeLayout::readRecord(scratch, declID, parentID);
typeOrOffset = NominalType::get(cast<NominalTypeDecl>(getDecl(declID)),
getType(parentID), ctx);
break;
}
@@ -1121,14 +1121,6 @@ Type ModuleFile::getType(TypeID TID) {
break;
}
case decls_block::PROTOCOL_TYPE: {
DeclID declID;
decls_block::ProtocolTypeLayout::readRecord(scratch, declID);
auto proto = cast<ProtocolDecl>(getDecl(declID));
typeOrOffset = proto->getDeclaredType();
break;
}
case decls_block::ARCHETYPE_TYPE: {
IdentifierID nameID;
bool isPrimary;