Skip to content

Commit 7ed123a

Browse files
committed
AST: Adopt SemanticAvailableAttr in Decl::getIntroducedOSVersion().
1 parent 100a794 commit 7ed123a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/AST/Decl.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,9 @@ const Decl *Decl::getInnermostDeclWithAvailability() const {
571571

572572
std::optional<llvm::VersionTuple>
573573
Decl::getIntroducedOSVersion(PlatformKind Kind) const {
574-
for (auto *attr: getAttrs()) {
575-
if (auto *ava = dyn_cast<AvailableAttr>(attr)) {
576-
if (ava->getPlatform() == Kind && ava->Introduced) {
577-
return ava->Introduced;
578-
}
579-
}
574+
for (auto attr : getSemanticAvailableAttrs()) {
575+
if (attr.getPlatform() == Kind && attr.getIntroduced().has_value())
576+
return attr.getIntroduced();
580577
}
581578
return std::nullopt;
582579
}

0 commit comments

Comments
 (0)