@@ -427,52 +427,6 @@ DeclAttributes::findMostSpecificActivePlatform(const ASTContext &ctx,
427427 return bestAttr;
428428}
429429
430- const AvailableAttr *
431- DeclAttributes::getUnavailable (const ASTContext &ctx,
432- bool ignoreAppExtensions) const {
433- const AvailableAttr *conditional = nullptr ;
434- const AvailableAttr *bestActive =
435- findMostSpecificActivePlatform (ctx, ignoreAppExtensions);
436-
437- for (auto Attr : *this )
438- if (auto AvAttr = dyn_cast<AvailableAttr>(Attr)) {
439- if (AvAttr->isInvalid ())
440- continue ;
441-
442- // If this is a platform-specific attribute and it isn't the most
443- // specific attribute for the current platform, we're done.
444- if (AvAttr->hasPlatform () &&
445- (!bestActive || AvAttr != bestActive))
446- continue ;
447-
448- // If this attribute doesn't apply to the active platform, we're done.
449- if (!AvAttr->isActivePlatform (ctx) &&
450- !AvAttr->isLanguageVersionSpecific () &&
451- !AvAttr->isPackageDescriptionVersionSpecific ())
452- continue ;
453-
454- if (ignoreAppExtensions &&
455- isApplicationExtensionPlatform (AvAttr->getPlatform ()))
456- continue ;
457-
458- // Unconditional unavailable.
459- if (AvAttr->isUnconditionallyUnavailable ())
460- return AvAttr;
461-
462- switch (AvAttr->getVersionAvailability (ctx)) {
463- case AvailableVersionComparison::Available:
464- case AvailableVersionComparison::PotentiallyUnavailable:
465- break ;
466-
467- case AvailableVersionComparison::Obsoleted:
468- case AvailableVersionComparison::Unavailable:
469- conditional = AvAttr;
470- break ;
471- }
472- }
473- return conditional;
474- }
475-
476430const AvailableAttr *
477431DeclAttributes::getDeprecated (const ASTContext &ctx) const {
478432 const AvailableAttr *conditional = nullptr ;
@@ -2440,25 +2394,6 @@ AvailableVersionComparison AvailableAttr::getVersionAvailability(
24402394 return AvailableVersionComparison::Available;
24412395}
24422396
2443- const AvailableAttr *AvailableAttr::isUnavailable (const Decl *D) {
2444- ASTContext &ctx = D->getASTContext ();
2445- if (auto attr = D->getAttrs ().getUnavailable (ctx))
2446- return attr;
2447-
2448- // If D is an extension member, check if the extension is unavailable.
2449- //
2450- // Skip decls imported from Clang, they could be associated to the wrong
2451- // extension and inherit undesired unavailability. The ClangImporter
2452- // associates Objective-C protocol members to the first category where the
2453- // protocol is directly or indirectly adopted, no matter its availability
2454- // and the availability of other categories. rdar://problem/53956555
2455- if (!D->getClangNode ())
2456- if (auto ext = dyn_cast<ExtensionDecl>(D->getDeclContext ()))
2457- return AvailableAttr::isUnavailable (ext);
2458-
2459- return nullptr ;
2460- }
2461-
24622397SpecializeAttr::SpecializeAttr (SourceLoc atLoc, SourceRange range,
24632398 TrailingWhereClause *clause, bool exported,
24642399 SpecializationKind kind,
0 commit comments