@@ -1243,38 +1243,37 @@ extractBuilderValueIfExists(const swift::NominalTypeDecl *TypeDecl,
1243
1243
}
1244
1244
1245
1245
void writeAvailabilityAttributes (llvm::json::OStream &JSON, const Decl &decl) {
1246
- auto semanticAttrs = decl.getSemanticAvailableAttrs ();
1247
- if (semanticAttrs .empty ())
1246
+ auto attrs = decl.getSemanticAvailableAttrs ();
1247
+ if (attrs .empty ())
1248
1248
return ;
1249
1249
1250
1250
JSON.attributeArray (" availabilityAttributes" , [&] {
1251
- for (auto semanticAttr : semanticAttrs) {
1252
- auto attr = semanticAttr.getParsedAttr ();
1253
-
1251
+ for (auto attr : attrs) {
1254
1252
JSON.object ([&] {
1255
- if (!attr->platformString ().empty ())
1256
- JSON.attribute (" platform" , attr->platformString ());
1253
+ auto domainName = attr.getDomain ().getNameForAttributePrinting ();
1254
+ if (!domainName.empty ())
1255
+ JSON.attribute (" platform" , domainName);
1257
1256
1258
- if (!attr-> Message .empty ())
1259
- JSON.attribute (" message" , attr-> Message );
1257
+ if (!attr. getMessage () .empty ())
1258
+ JSON.attribute (" message" , attr. getMessage () );
1260
1259
1261
- if (!attr-> Rename .empty ())
1262
- JSON.attribute (" rename" , attr-> Rename );
1260
+ if (!attr. getRename () .empty ())
1261
+ JSON.attribute (" rename" , attr. getRename () );
1263
1262
1264
- if (attr-> Introduced .has_value ())
1263
+ if (attr. getIntroduced () .has_value ())
1265
1264
JSON.attribute (" introducedVersion" ,
1266
- attr-> Introduced .value ().getAsString ());
1265
+ attr. getIntroduced () .value ().getAsString ());
1267
1266
1268
- if (attr-> Deprecated .has_value ())
1267
+ if (attr. getDeprecated () .has_value ())
1269
1268
JSON.attribute (" deprecatedVersion" ,
1270
- attr-> Deprecated .value ().getAsString ());
1269
+ attr. getDeprecated () .value ().getAsString ());
1271
1270
1272
- if (attr-> Obsoleted .has_value ())
1271
+ if (attr. getObsoleted () .has_value ())
1273
1272
JSON.attribute (" obsoletedVersion" ,
1274
- attr-> Obsoleted .value ().getAsString ());
1273
+ attr. getObsoleted () .value ().getAsString ());
1275
1274
1276
- JSON.attribute (" isUnavailable" , attr-> isUnconditionallyUnavailable ());
1277
- JSON.attribute (" isDeprecated" , attr-> isUnconditionallyDeprecated ());
1275
+ JSON.attribute (" isUnavailable" , attr. isUnconditionallyUnavailable ());
1276
+ JSON.attribute (" isDeprecated" , attr. isUnconditionallyDeprecated ());
1278
1277
});
1279
1278
}
1280
1279
});
0 commit comments