@@ -1242,14 +1242,15 @@ extractBuilderValueIfExists(const swift::NominalTypeDecl *TypeDecl,
12421242 ;
12431243}
12441244
1245- void writeAttrInformation (llvm::json::OStream &JSON,
1246- const DeclAttributes &Attrs) {
1247- auto availableAttr = Attrs.getAttributes <AvailableAttr>();
1248- if (availableAttr.empty ())
1245+ void writeAvailabilityAttributes (llvm::json::OStream &JSON, const Decl &decl) {
1246+ auto semanticAttrs = decl.getSemanticAvailableAttrs ();
1247+ if (semanticAttrs.empty ())
12491248 return ;
12501249
12511250 JSON.attributeArray (" availabilityAttributes" , [&] {
1252- for (const AvailableAttr *attr : availableAttr) {
1251+ for (auto semanticAttr : semanticAttrs) {
1252+ auto attr = semanticAttr.getParsedAttr ();
1253+
12531254 JSON.object ([&] {
12541255 if (!attr->platformString ().empty ())
12551256 JSON.attribute (" platform" , attr->platformString ());
@@ -1370,7 +1371,7 @@ void writeProperties(llvm::json::OStream &JSON,
13701371 }
13711372 writePropertyWrapperAttributes (JSON, PropertyInfo.PropertyWrappers ,
13721373 decl->getASTContext ());
1373- writeAttrInformation (JSON, decl-> getAttrs () );
1374+ writeAvailabilityAttributes (JSON, * decl);
13741375 });
13751376 }
13761377 });
@@ -1450,7 +1451,7 @@ bool writeAsJSONToFile(const std::vector<ConstValueTypeInfo> &ConstValueInfos,
14501451 writeAssociatedTypeAliases (JSON, *NomTypeDecl);
14511452 writeProperties (JSON, TypeInfo, *NomTypeDecl);
14521453 writeEnumCases (JSON, TypeInfo.EnumElements );
1453- writeAttrInformation (JSON, NomTypeDecl-> getAttrs () );
1454+ writeAvailabilityAttributes (JSON, * NomTypeDecl);
14541455 });
14551456 }
14561457 });
0 commit comments