mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add a SIL-only '@block_storage T' type to represent on-stack storage for blocks.
Blocks need to be born on the stack, so we need a way to represent that on-stack storage. @block_storage T will represent the layout of a block that contains storage for a capture of type T. Swift SVN r16355
This commit is contained in:
@@ -2143,7 +2143,16 @@ void Serializer::writeType(Type ty) {
|
||||
writeRequirements(fnTy->getRequirements());
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case TypeKind::SILBlockStorage: {
|
||||
auto storageTy = cast<SILBlockStorageType>(ty.getPointer());
|
||||
|
||||
unsigned abbrCode = DeclTypeAbbrCodes[SILBlockStorageTypeLayout::Code];
|
||||
SILBlockStorageTypeLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
addTypeRef(storageTy->getCaptureType()));
|
||||
break;
|
||||
}
|
||||
|
||||
case TypeKind::SILFunction: {
|
||||
auto fnTy = cast<SILFunctionType>(ty.getPointer());
|
||||
|
||||
@@ -2331,6 +2340,7 @@ void Serializer::writeAllDeclsAndTypes() {
|
||||
registerDeclTypeAbbr<BoundGenericSubstitutionLayout>();
|
||||
registerDeclTypeAbbr<PolymorphicFunctionTypeLayout>();
|
||||
registerDeclTypeAbbr<GenericFunctionTypeLayout>();
|
||||
registerDeclTypeAbbr<SILBlockStorageTypeLayout>();
|
||||
registerDeclTypeAbbr<SILFunctionTypeLayout>();
|
||||
registerDeclTypeAbbr<ArraySliceTypeLayout>();
|
||||
registerDeclTypeAbbr<ArrayTypeLayout>();
|
||||
|
||||
Reference in New Issue
Block a user