Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][ExtractAPI] Update availability serialization in SGF #71418

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

daniel-grumberg
Copy link
Contributor

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

rdar://117823923

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

rdar://117823923
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Nov 6, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 6, 2023

@llvm/pr-subscribers-clang

Author: Daniel Grumberg (daniel-grumberg)

Changes

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

rdar://117823923


Full diff: https://github.com/llvm/llvm-project/pull/71418.diff

2 Files Affected:

  • (modified) clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp (+3-3)
  • (modified) clang/test/ExtractAPI/availability.c (+10-10)
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
index 3c8668d26c60b76..f757522ef8e49db 100644
--- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
+++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
@@ -177,11 +177,11 @@ 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));
diff --git a/clang/test/ExtractAPI/availability.c b/clang/test/ExtractAPI/availability.c
index 0c8cd3629f3fdee..5e3890df83563d4 100644
--- a/clang/test/ExtractAPI/availability.c
+++ b/clang/test/ExtractAPI/availability.c
@@ -127,7 +127,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
       "availability": [
         {
           "domain": "macos",
-          "introducedVersion": {
+          "introduced": {
             "major": 12,
             "minor": 0,
             "patch": 0
@@ -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
@@ -284,18 +284,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
@@ -303,7 +303,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
         },
         {
           "domain": "ios",
-          "introducedVersion": {
+          "introduced": {
             "major": 13,
             "minor": 0,
             "patch": 0
@@ -311,7 +311,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
         },
         {
           "domain": "tvos",
-          "introducedVersion": {
+          "introduced": {
             "major": 15,
             "minor": 0,
             "patch": 0
@@ -389,7 +389,7 @@ void e(void) __attribute__((availability(tvos, unavailable)));
         },
         {
           "domain": "macos",
-          "introducedVersion": {
+          "introduced": {
             "major": 11,
             "minor": 0,
             "patch": 0

Copy link
Member

@zixu-w zixu-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@daniel-grumberg daniel-grumberg merged commit 6b43764 into llvm:main Nov 7, 2023
4 checks passed
daniel-grumberg added a commit to daniel-grumberg/llvm-project that referenced this pull request Nov 7, 2023
)

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

rdar://117823923
daniel-grumberg added a commit to swiftlang/llvm-project that referenced this pull request Nov 8, 2023
)

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

rdar://117823923
daniel-grumberg added a commit to daniel-grumberg/llvm-project that referenced this pull request Dec 20, 2023
)

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

rdar://117823923
daniel-grumberg added a commit to swiftlang/llvm-project that referenced this pull request Jan 3, 2024
)

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

rdar://117823923
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants