Skip to content

Commit ab9bbcc

Browse files
committed
swift-api-digester: Adopt SemanticAvailableAttr.
1 parent d4d9c9e commit ab9bbcc

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/APIDigester/ModuleAnalyzerNodes.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,16 +1339,14 @@ std::optional<uint8_t> SDKContext::getFixedBinaryOrder(ValueDecl *VD) const {
13391339
// check for if it has @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
13401340
static bool isABIPlaceHolder(Decl *D) {
13411341
llvm::SmallSet<PlatformKind, 4> Platforms;
1342-
for (auto semanticAttr : D->getSemanticAvailableAttrs()) {
1343-
auto attr = semanticAttr.getParsedAttr();
1344-
auto domain = semanticAttr.getDomain();
1345-
if (domain.isPlatform() && attr->Introduced &&
1346-
attr->Introduced->getMajor() == 9999) {
1347-
Platforms.insert(attr->getPlatform());
1342+
for (auto attr : D->getSemanticAvailableAttrs()) {
1343+
if (attr.isPlatformSpecific() && attr.getIntroduced().has_value() &&
1344+
attr.getIntroduced()->getMajor() == 9999) {
1345+
Platforms.insert(attr.getPlatform());
13481346
}
13491347
}
13501348

1351-
// FIXME: This probably isn't correct anymore, now that visionOS exists
1349+
// FIXME: [availability] This probably isn't correct now that visionOS exists
13521350
return Platforms.size() == 4;
13531351
}
13541352

0 commit comments

Comments
 (0)