[clang] 6b43764 - [clang][ExtractAPI] Update availability serialization in SGF (#71418)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 7 02:44:49 PST 2023
Author: Daniel Grumberg
Date: 2023-11-07T10:44:45Z
New Revision: 6b43764a9553b1aa09013298d5ec8905dd635308
URL: https://github.com/llvm/llvm-project/commit/6b43764a9553b1aa09013298d5ec8905dd635308
DIFF: https://github.com/llvm/llvm-project/commit/6b43764a9553b1aa09013298d5ec8905dd635308.diff
LOG: [clang][ExtractAPI] Update availability serialization in SGF (#71418)
The prevailiing symbol graph parsing library expects availability
attributes to just be "introduced" instead of "introducedVersion"
rdar://117823923
Added:
Modified:
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
clang/test/ExtractAPI/availability.c
Removed:
################################################################################
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
More information about the cfe-commits
mailing list