mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add ReferenceStorageType.
The idea for now is that this is a SIL-only type used for representing the storage of a weak or unowned reference. Having it be its own type is pretty vital for reasonable behavior in SIL and IR-generation, and it's likely that this will surface into runtime metadata as well (hence the mangling). I've implemented a bunch of things that technically I don't think are necessary if this stays out of the typechecker, but it's easier to implement half-a-dozen "recurse into the child type" methods now that it would be to find them all later if we change our minds. Swift SVN r6091
This commit is contained in:
@@ -1080,6 +1080,16 @@ bool Serializer::writeType(Type ty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
case TypeKind::ReferenceStorage: {
|
||||
auto refTy = cast<ReferenceStorageType>(ty.getPointer());
|
||||
|
||||
unsigned abbrCode = DeclTypeAbbrCodes[ReferenceStorageTypeLayout::Code];
|
||||
ReferenceStorageTypeLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
unsigned(refTy->getOwnership()),
|
||||
addTypeRef(refTy->getReferentType()));
|
||||
return true;
|
||||
}
|
||||
|
||||
case TypeKind::Tuple: {
|
||||
auto tupleTy = cast<TupleType>(ty.getPointer());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user