-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[clang][ExtractAPI] Update availability serialization in SGF #71418
Conversation
The prevailiing symbol graph parsing library expects availability attributes to just be "introduced" instead of "introducedVersion" rdar://117823923
@llvm/pr-subscribers-clang Author: Daniel Grumberg (daniel-grumberg) ChangesThe 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:
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The prevailiing symbol graph parsing library expects availability attributes to just be "introduced" instead of "introducedVersion"
rdar://117823923