Merge pull request #16237 from davezarzycki/metaprogram_ref_storage_types

[AST] NFC: Enable reference storage type meta-programming
This commit is contained in:
John McCall
2018-07-05 14:45:38 -04:00
committed by GitHub
96 changed files with 3699 additions and 4049 deletions

View File

@@ -3520,9 +3520,9 @@ static uint8_t
getRawStableReferenceOwnership(swift::ReferenceOwnership ownership) {
switch (ownership) {
SIMPLE_CASE(ReferenceOwnership, Strong)
SIMPLE_CASE(ReferenceOwnership, Weak)
SIMPLE_CASE(ReferenceOwnership, Unowned)
SIMPLE_CASE(ReferenceOwnership, Unmanaged)
#define REF_STORAGE(Name, ...) \
SIMPLE_CASE(ReferenceOwnership, Name)
#include "swift/AST/ReferenceStorage.def"
}
llvm_unreachable("bad ownership kind");
}
@@ -3928,9 +3928,10 @@ void Serializer::writeType(Type ty) {
break;
}
case TypeKind::UnownedStorage:
case TypeKind::UnmanagedStorage:
case TypeKind::WeakStorage: {
#define REF_STORAGE(Name, ...) \
case TypeKind::Name##Storage:
#include "swift/AST/ReferenceStorage.def"
{
auto refTy = cast<ReferenceStorageType>(ty.getPointer());
unsigned abbrCode = DeclTypeAbbrCodes[ReferenceStorageTypeLayout::Code];