[PATCH] D152770: [clang][ExtractAPI] Add support for Objective-C categories

R4444 via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 4 05:46:08 PDT 2023


Ruturaj4 created this revision.
Herald added a reviewer: ributzka.
Herald added a project: All.
Ruturaj4 added a reviewer: dang.
Ruturaj4 edited the summary of this revision.
Ruturaj4 edited the summary of this revision.
Ruturaj4 updated this revision to Diff 537064.
Ruturaj4 added a comment.
Ruturaj4 edited the summary of this revision.
Ruturaj4 published this revision for review.
Herald added subscribers: cfe-commits, wangpc.
Herald added a project: clang.



1. Updating D152770 <https://reviews.llvm.org/D152770>: [clang][ExtractAPI] Add support for Objective-C categories #
2. Enter a brief description of the changes included in this update.
3. The first line is used as subject, next lines as comment. #
4. If you intended to create a new revision, use:
5. $ arc diff --create

Introducing support for Objective-C Categories for ExtractAPI. The suuport for Objective-C Categories is currently lacking
in terms of categories that extend a type defined in current module and categories that extend types that belong to external
modules such as NSString. Thus the objective of this patch is two fold, to fix former and the later.

This is achieved by introducing two new symbols ->

objective-c.module.extension.
objective-c.class.extension.
Note that the extension represents objective-c "category" (orienting well with Swift's Extension, which in spite that fact
that is different, however "broadly" serves similar purpose). The original idea is inspired by Max's @theMomax initial
post - https://forums.swift.org/t/symbol-graph-adaptions-for-documenting-extensions-to-external-types-in-docc/56684,
and Daniel's helpful comments and feedback. The implementation nonetheless is different serving purpose for this project.


Introducing support for Objective-C Categories for ExtractAPI. The suuport for Objective-C Categories is currently lacking
in terms of categories that extend a type defined in current module and categories that extend types that belong to external
modules such as `NSString`. Thus the objective of this patch is two fold, to fix former and the later.

This is achieved by introducing two new symbols ->

1. `objective-c.module.extension`.
2. `objective-c.class.extension`.

Note that the extension represents objective-c "category" (orienting well with Swift's Extension, which in spite that fact
that is different, however "broadly" serves similar purpose). The original idea is inspired by Max's `@theMomax` initial
post - https://forums.swift.org/t/symbol-graph-adaptions-for-documenting-extensions-to-external-types-in-docc/56684,
and Daniel's helpful comments and feedback. The implementation nonetheless is different serving purpose for this project.

The following diagram well represents the purpose ->
F28127510: llvm_categories.png <https://reviews.llvm.org/F28127510>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152770

Files:
  clang/include/clang/ExtractAPI/API.h
  clang/include/clang/ExtractAPI/ExtractAPIVisitor.h
  clang/include/clang/ExtractAPI/Serialization/SerializerBase.h
  clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h
  clang/lib/ExtractAPI/API.cpp
  clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
  clang/test/ExtractAPI/objc_module_category.m
  clang/test/ExtractAPI/objc_various_categories.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152770.537064.patch
Type: text/x-patch
Size: 34780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230704/955e4fd4/attachment-0001.bin>


More information about the cfe-commits mailing list