@@ -427,87 +427,6 @@ DeclAttributes::findMostSpecificActivePlatform(const ASTContext &ctx,
427427 return bestAttr;
428428}
429429
430- const AvailableAttr *
431- DeclAttributes::getDeprecated (const ASTContext &ctx) const {
432- const AvailableAttr *conditional = nullptr ;
433- const AvailableAttr *bestActive = findMostSpecificActivePlatform (ctx);
434- for (auto Attr : *this ) {
435- if (auto AvAttr = dyn_cast<AvailableAttr>(Attr)) {
436- if (AvAttr->isInvalid ())
437- continue ;
438-
439- if (AvAttr->hasPlatform () &&
440- (!bestActive || AvAttr != bestActive))
441- continue ;
442-
443- if (!AvAttr->isActivePlatform (ctx) &&
444- !AvAttr->isLanguageVersionSpecific () &&
445- !AvAttr->isPackageDescriptionVersionSpecific ())
446- continue ;
447-
448- // Unconditional deprecated.
449- if (AvAttr->isUnconditionallyDeprecated ())
450- return AvAttr;
451-
452- std::optional<llvm::VersionTuple> DeprecatedVersion = AvAttr->Deprecated ;
453-
454- StringRef DeprecatedPlatform = AvAttr->prettyPlatformString ();
455- llvm::VersionTuple RemappedDeprecatedVersion;
456- if (AvailabilityInference::updateDeprecatedPlatformForFallback (
457- AvAttr, ctx, DeprecatedPlatform, RemappedDeprecatedVersion))
458- DeprecatedVersion = RemappedDeprecatedVersion;
459-
460- if (!DeprecatedVersion.has_value ())
461- continue ;
462-
463- llvm::VersionTuple MinVersion = AvAttr->getActiveVersion (ctx);
464-
465- // We treat the declaration as deprecated if it is deprecated on
466- // all deployment targets.
467- // Once availability checking is enabled by default, we should
468- // query the availability scope tree to determine
469- // whether a declaration is deprecated on all versions
470- // allowed by the context containing the reference.
471- if (DeprecatedVersion.value () <= MinVersion) {
472- conditional = AvAttr;
473- }
474- }
475- }
476- return conditional;
477- }
478-
479- const AvailableAttr *
480- DeclAttributes::getSoftDeprecated (const ASTContext &ctx) const {
481- const AvailableAttr *conditional = nullptr ;
482- const AvailableAttr *bestActive = findMostSpecificActivePlatform (ctx);
483- for (auto Attr : *this ) {
484- if (auto AvAttr = dyn_cast<AvailableAttr>(Attr)) {
485- if (AvAttr->isInvalid ())
486- continue ;
487-
488- if (AvAttr->hasPlatform () &&
489- (!bestActive || AvAttr != bestActive))
490- continue ;
491-
492- if (!AvAttr->isActivePlatform (ctx) &&
493- !AvAttr->isLanguageVersionSpecific () &&
494- !AvAttr->isPackageDescriptionVersionSpecific ())
495- continue ;
496-
497- std::optional<llvm::VersionTuple> DeprecatedVersion = AvAttr->Deprecated ;
498- if (!DeprecatedVersion.has_value ())
499- continue ;
500-
501- llvm::VersionTuple ActiveVersion = AvAttr->getActiveVersion (ctx);
502-
503- if (DeprecatedVersion.value () > ActiveVersion) {
504- conditional = AvAttr;
505- }
506- }
507- }
508- return conditional;
509- }
510-
511430const AvailableAttr *DeclAttributes::getNoAsync (const ASTContext &ctx) const {
512431 const AvailableAttr *bestAttr = nullptr ;
513432 for (const DeclAttribute *attr : *this ) {
0 commit comments