diff options
author | Zixu Wang <zixu_wang@apple.com> | 2022-03-25 15:15:08 -0700 |
---|---|---|
committer | Zixu Wang <zixu_wang@apple.com> | 2022-03-29 14:44:49 -0700 |
commit | d1d34bafef56b732b461e12032eaf030e609f55a (patch) | |
tree | 8360785bdf0fa068133c2916679cbb5550af3b8c /clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | |
parent | 122638d97d913edcdfa8ccf921eb5929498166c7 (diff) | |
download | llvm-d1d34bafef56b732b461e12032eaf030e609f55a.zip llvm-d1d34bafef56b732b461e12032eaf030e609f55a.tar.gz llvm-d1d34bafef56b732b461e12032eaf030e609f55a.tar.bz2 |
[clang][extract-api] Add Objective-C protocol support
Add support for Objective-C protocol declarations in ExtractAPI.
Depends on D122446
Differential Revision: https://reviews.llvm.org/D122511
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp')
-rw-r--r-- | clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp index 3faf9cd..1acb67a 100644 --- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp +++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp @@ -393,6 +393,10 @@ Object serializeSymbolKind(const APIRecord &Record, Language Lang) { Kind["identifier"] = AddLangPrefix("class"); Kind["displayName"] = "Class"; break; + case APIRecord::RK_ObjCProtocol: + Kind["identifier"] = AddLangPrefix("protocol"); + Kind["displayName"] = "Protocol"; + break; } return Kind; @@ -593,6 +597,10 @@ Object SymbolGraphSerializer::serialize() { for (const auto &ObjCInterface : API.getObjCInterfaces()) serializeObjCContainerRecord(*ObjCInterface.second); + // Serialize Objective-C protocol records in the API set. + for (const auto &ObjCProtocol : API.getObjCProtocols()) + serializeObjCContainerRecord(*ObjCProtocol.second); + Root["symbols"] = std::move(Symbols); Root["relationhips"] = std::move(Relationships); |