mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #31629 from compnerd/fall-into-the-gap
runtime: add and switch to `SWIFT_FALLTHROUGH` (NFC)
This commit is contained in:
@@ -894,7 +894,7 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
|
||||
maybeDeallocateSource(result);
|
||||
return result;
|
||||
}
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
|
||||
case MetadataKind::Enum:
|
||||
case MetadataKind::Optional:
|
||||
@@ -910,7 +910,7 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
|
||||
maybeDeallocateSource(success);
|
||||
return success;
|
||||
}
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
|
||||
default:
|
||||
return fallbackForNonClass();
|
||||
@@ -1127,7 +1127,7 @@ swift_dynamicCastMetatypeImpl(const Metadata *sourceType,
|
||||
// Get the actual class object.
|
||||
targetType = static_cast<const ObjCClassWrapperMetadata*>(targetType)
|
||||
->Class;
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
case MetadataKind::Class:
|
||||
// The source value must also be a class; otherwise the cast fails.
|
||||
switch (sourceType->getKind()) {
|
||||
@@ -1135,7 +1135,7 @@ swift_dynamicCastMetatypeImpl(const Metadata *sourceType,
|
||||
// Get the actual class object.
|
||||
sourceType = static_cast<const ObjCClassWrapperMetadata*>(sourceType)
|
||||
->Class;
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
case MetadataKind::Class: {
|
||||
// Check if the source is a subclass of the target.
|
||||
#if SWIFT_OBJC_INTEROP
|
||||
@@ -1171,7 +1171,7 @@ swift_dynamicCastMetatypeImpl(const Metadata *sourceType,
|
||||
// Get the actual class object.
|
||||
sourceType = static_cast<const ObjCClassWrapperMetadata*>(sourceType)
|
||||
->Class;
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
case MetadataKind::Class:
|
||||
case MetadataKind::ForeignClass:
|
||||
// Check if the source is a subclass of the target.
|
||||
@@ -1214,7 +1214,7 @@ swift_dynamicCastMetatypeUnconditionalImpl(const Metadata *sourceType,
|
||||
// Get the actual class object.
|
||||
targetType = static_cast<const ObjCClassWrapperMetadata*>(targetType)
|
||||
->Class;
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
case MetadataKind::Class:
|
||||
// The source value must also be a class; otherwise the cast fails.
|
||||
switch (sourceType->getKind()) {
|
||||
@@ -1222,7 +1222,7 @@ swift_dynamicCastMetatypeUnconditionalImpl(const Metadata *sourceType,
|
||||
// Get the actual class object.
|
||||
sourceType = static_cast<const ObjCClassWrapperMetadata*>(sourceType)
|
||||
->Class;
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
case MetadataKind::Class: {
|
||||
// Check if the source is a subclass of the target.
|
||||
#if SWIFT_OBJC_INTEROP
|
||||
@@ -1261,7 +1261,7 @@ swift_dynamicCastMetatypeUnconditionalImpl(const Metadata *sourceType,
|
||||
// Get the actual class object.
|
||||
sourceType = static_cast<const ObjCClassWrapperMetadata*>(sourceType)
|
||||
->Class;
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
case MetadataKind::Class:
|
||||
case MetadataKind::ForeignClass:
|
||||
// Check if the source is a subclass of the target.
|
||||
@@ -2410,7 +2410,7 @@ static bool swift_dynamicCastImpl(OpaqueValue *dest, OpaqueValue *src,
|
||||
return _dynamicCastFromAnyHashable(dest, src, srcType,
|
||||
targetType, flags);
|
||||
}
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
|
||||
case MetadataKind::Enum:
|
||||
case MetadataKind::Optional: {
|
||||
@@ -2525,7 +2525,7 @@ static bool swift_dynamicCastImpl(OpaqueValue *dest, OpaqueValue *src,
|
||||
break;
|
||||
}
|
||||
|
||||
LLVM_FALLTHROUGH;
|
||||
SWIFT_FALLTHROUGH;
|
||||
|
||||
// The non-polymorphic types.
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user