@@ -456,17 +456,13 @@ Decl::getSemanticAvailableAttr(const AvailableAttr *attr) const {
456
456
}
457
457
458
458
std::optional<SemanticAvailableAttr>
459
- Decl::getActiveAvailableAttrForCurrentPlatform (bool ignoreAppExtensions ) const {
459
+ Decl::getActiveAvailableAttrForCurrentPlatform () const {
460
460
std::optional<SemanticAvailableAttr> bestAttr;
461
461
462
462
for (auto attr : getSemanticAvailableAttrs (/* includingInactive=*/ false )) {
463
463
if (!attr.isPlatformSpecific ())
464
464
continue ;
465
465
466
- if (ignoreAppExtensions &&
467
- isApplicationExtensionPlatform (attr.getPlatform ()))
468
- continue ;
469
-
470
466
// We have an attribute that is active for the platform, but is it more
471
467
// specific than our current best?
472
468
if (!bestAttr || inheritsAvailabilityFromPlatform (
@@ -577,23 +573,17 @@ bool Decl::isUnavailableInCurrentSwiftVersion() const {
577
573
return false ;
578
574
}
579
575
580
- std::optional<SemanticAvailableAttr>
581
- getDeclUnavailableAttr (const Decl *D, bool ignoreAppExtensions) {
576
+ std::optional<SemanticAvailableAttr> getDeclUnavailableAttr (const Decl *D) {
582
577
auto &ctx = D->getASTContext ();
583
578
std::optional<SemanticAvailableAttr> result;
584
- auto bestActive =
585
- D->getActiveAvailableAttrForCurrentPlatform (ignoreAppExtensions);
579
+ auto bestActive = D->getActiveAvailableAttrForCurrentPlatform ();
586
580
587
581
for (auto attr : D->getSemanticAvailableAttrs (/* includingInactive=*/ false )) {
588
582
// If this is a platform-specific attribute and it isn't the most
589
583
// specific attribute for the current platform, we're done.
590
584
if (attr.isPlatformSpecific () && (!bestActive || attr != bestActive))
591
585
continue ;
592
586
593
- if (ignoreAppExtensions &&
594
- isApplicationExtensionPlatform (attr.getPlatform ()))
595
- continue ;
596
-
597
587
// Unconditional unavailable.
598
588
if (attr.isUnconditionallyUnavailable ())
599
589
return attr;
@@ -612,9 +602,8 @@ getDeclUnavailableAttr(const Decl *D, bool ignoreAppExtensions) {
612
602
return result;
613
603
}
614
604
615
- std::optional<SemanticAvailableAttr>
616
- Decl::getUnavailableAttr (bool ignoreAppExtensions) const {
617
- if (auto attr = getDeclUnavailableAttr (this , ignoreAppExtensions))
605
+ std::optional<SemanticAvailableAttr> Decl::getUnavailableAttr () const {
606
+ if (auto attr = getDeclUnavailableAttr (this ))
618
607
return attr;
619
608
620
609
// If D is an extension member, check if the extension is unavailable.
@@ -626,7 +615,7 @@ Decl::getUnavailableAttr(bool ignoreAppExtensions) const {
626
615
// and the availability of other categories. rdar://problem/53956555
627
616
if (!getClangNode ())
628
617
if (auto ext = dyn_cast<ExtensionDecl>(getDeclContext ()))
629
- return ext->getUnavailableAttr (ignoreAppExtensions );
618
+ return ext->getUnavailableAttr ();
630
619
631
620
return std::nullopt;
632
621
}
0 commit comments