File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -770,20 +770,18 @@ class APIGenRecorder final : public APIRecorder {
770
770
std::string introduced, obsoleted;
771
771
bool hasFallbackUnavailability = false ;
772
772
auto platform = targetPlatform (module ->getASTContext ().LangOpts );
773
- for (auto *attr : decl->getAttrs ()) {
774
- if (auto *ava = dyn_cast<AvailableAttr>(attr)) {
775
- if (ava->getPlatform () == PlatformKind::none) {
776
- hasFallbackUnavailability = ava->isUnconditionallyUnavailable ();
777
- continue ;
778
- }
779
- if (ava->getPlatform () != platform)
780
- continue ;
781
- unavailable = ava->isUnconditionallyUnavailable ();
782
- if (ava->Introduced )
783
- introduced = ava->Introduced ->getAsString ();
784
- if (ava->Obsoleted )
785
- obsoleted = ava->Obsoleted ->getAsString ();
773
+ for (auto attr : decl->getSemanticAvailableAttrs ()) {
774
+ if (!attr.isPlatformSpecific ()) {
775
+ hasFallbackUnavailability = attr.isUnconditionallyUnavailable ();
776
+ continue ;
786
777
}
778
+ if (attr.getPlatform () != platform)
779
+ continue ;
780
+ unavailable = attr.isUnconditionallyUnavailable ();
781
+ if (attr.getIntroduced ())
782
+ introduced = attr.getIntroduced ()->getAsString ();
783
+ if (attr.getObsoleted ())
784
+ obsoleted = attr.getObsoleted ()->getAsString ();
787
785
}
788
786
return {introduced, obsoleted,
789
787
unavailable.value_or (hasFallbackUnavailability)};
You can’t perform that action at this time.
0 commit comments