This is an archive of the discontinued LLVM Phabricator instance.

[clang][extract-api] Add Objective-C Category support
ClosedPublic

Authored by zixuw on Mar 30 2022, 5:25 PM.

Details

Summary

Add (partial) support for Objective-C category records in ExtractAPI.
The current ExtractAPI collects everything for an Objective-C category,
but not fully serialized in the SymbolGraphSerializer. Categories
extending external interfaces are disgarded during serialization, and
categories extending known interfaces are merged (all members surfaced)
into the interfaces.

Diff Detail

Event Timeline

zixuw created this revision.Mar 30 2022, 5:25 PM
Herald added a project: Restricted Project. · View Herald Transcript
zixuw requested review of this revision.Mar 30 2022, 5:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2022, 5:25 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
zixuw updated this revision to Diff 419298.Mar 30 2022, 5:29 PM

Remove probably unnecessary includes added automatically by clangd.

zixuw updated this revision to Diff 419474.Mar 31 2022, 8:25 AM

Add missing documentatin for ObjCCategoryRecord.

dang added inline comments.Apr 4 2022, 5:32 AM
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
404

Since we currently never actually emit a standalone category symbol object, should we not just label this as llvm_unreachable with a comment explaining why that is?

zixuw marked an inline comment as done.Apr 4 2022, 3:43 PM
zixuw added inline comments.
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
404

Yep, makes sense.

zixuw updated this revision to Diff 420333.Apr 4 2022, 3:44 PM
zixuw marked an inline comment as done.

Address review comment:

  • Use llvm_unreachable for the Objective-C category case in serializeSymbolKind
dang accepted this revision.Apr 5 2022, 2:55 AM

LGTM!

This revision is now accepted and ready to land.Apr 5 2022, 2:55 AM
zixuw updated this revision to Diff 420964.Apr 6 2022, 12:00 PM

Remove extra commas in test case.

This revision was landed with ongoing or failed builds.Apr 6 2022, 12:03 PM
This revision was automatically updated to reflect the committed changes.