Introduce a "@box T" type for SIL.

Represents a heap allocation containing a value of type T, which we'll be able to use to represent the payloads of indirect enum cases, and also improve codegen of current boxes, which generates non-uniqued box metadata on every allocation, which is dumb. No codegen changes or IRGen support yet; that will come later.

This time, fix a paste-o that caused SILBlockStorageTypes to get replaced with SILBoxTypes during type substitution. Oops.

Swift SVN r29489
This commit is contained in:
Joe Groff
2015-06-18 15:21:52 +00:00
parent 7bf996152b
commit e57c470019
25 changed files with 168 additions and 4 deletions

View File

@@ -3788,6 +3788,14 @@ Type ModuleFile::getType(TypeID TID) {
->getCanonicalType());
break;
}
case decls_block::SIL_BOX_TYPE: {
TypeID boxID;
decls_block::SILBoxTypeLayout::readRecord(scratch, boxID);
typeOrOffset = SILBoxType::get(getType(boxID)->getCanonicalType());
break;
}
case decls_block::SIL_FUNCTION_TYPE: {
TypeID interfaceResultID;