Runtime: Remove unused helper.

Swift SVN r23139
This commit is contained in:
Joe Groff
2014-11-06 22:32:13 +00:00
parent e2cd398caf
commit f0c4b46bf6

View File

@@ -351,19 +351,6 @@ static bool _conformsToProtocols(const OpaqueValue *value,
return true;
}
static const OpaqueValue *
_dynamicCastToExistential(const OpaqueValue *value,
const Metadata *sourceType,
const ExistentialTypeMetadata *targetType) {
for (unsigned i = 0, n = targetType->Protocols.NumProtocols; i != n; ++i) {
auto *protocol = targetType->Protocols[i];
if (!_conformsToProtocol(value, sourceType, protocol, nullptr))
return nullptr;
}
return value;
}
static bool shouldDeallocateSource(bool castSucceeded, DynamicCastFlags flags) {
return (castSucceeded && (flags & DynamicCastFlags::TakeOnSuccess)) ||
(!castSucceeded && (flags & DynamicCastFlags::DestroyOnFailure));