Skip to content

Commit

Permalink
[clang][ExtractAPI] Update availability serialization in SGF (llvm#71418
Browse files Browse the repository at this point in the history
)

The prevailiing symbol graph parsing library expects availability
attributes to just be "introduced" instead of "introducedVersion"

rdar://117823923
  • Loading branch information
daniel-grumberg committed Nov 7, 2023
1 parent a047009 commit 76b1140
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ Optional<Array> serializeAvailability(const AvailabilitySet &Availabilities) {
if (AvailInfo.Unavailable)
Availability["isUnconditionallyUnavailable"] = true;
else {
serializeObject(Availability, "introducedVersion",
serializeObject(Availability, "introduced",
serializeSemanticVersion(AvailInfo.Introduced));
serializeObject(Availability, "deprecatedVersion",
serializeObject(Availability, "deprecated",
serializeSemanticVersion(AvailInfo.Deprecated));
serializeObject(Availability, "obsoletedVersion",
serializeObject(Availability, "obsoleted",
serializeSemanticVersion(AvailInfo.Obsoleted));
}
AvailabilityArray.emplace_back(std::move(Availability));
Expand Down
20 changes: 10 additions & 10 deletions clang/test/ExtractAPI/availability.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
"availability": [
{
"domain": "macos",
"introducedVersion": {
"introduced": {
"major": 12,
"minor": 0,
"patch": 0
Expand Down Expand Up @@ -200,18 +200,18 @@ void e(void) __attribute__((availability(tvos, unavailable)));
"accessLevel": "public",
"availability": [
{
"deprecatedVersion": {
"deprecated": {
"major": 12,
"minor": 0,
"patch": 0
},
"domain": "macos",
"introducedVersion": {
"introduced": {
"major": 11,
"minor": 0,
"patch": 0
},
"obsoletedVersion": {
"obsoleted": {
"major": 20,
"minor": 0,
"patch": 0
Expand Down Expand Up @@ -284,34 +284,34 @@ void e(void) __attribute__((availability(tvos, unavailable)));
"accessLevel": "public",
"availability": [
{
"deprecatedVersion": {
"deprecated": {
"major": 12,
"minor": 0,
"patch": 0
},
"domain": "macos",
"introducedVersion": {
"introduced": {
"major": 11,
"minor": 0,
"patch": 0
},
"obsoletedVersion": {
"obsoleted": {
"major": 20,
"minor": 0,
"patch": 0
}
},
{
"domain": "ios",
"introducedVersion": {
"introduced": {
"major": 13,
"minor": 0,
"patch": 0
}
},
{
"domain": "tvos",
"introducedVersion": {
"introduced": {
"major": 15,
"minor": 0,
"patch": 0
Expand Down Expand Up @@ -389,7 +389,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
},
{
"domain": "macos",
"introducedVersion": {
"introduced": {
"major": 11,
"minor": 0,
"patch": 0
Expand Down

0 comments on commit 76b1140

Please sign in to comment.