- Project Name: ExtractAPI Objective-C categories
- Organization: [LLVM Org.]
- Mentors: Daniel Grumberg
- Project Repository: Link to GitHub Repository
- GSOC Project Page: ExtractAPI Objective-C categories
Clang, a compiler front-end (a part of LLVM infrastructure) supports symbol graph generation for languages such as C and Objective-C. One way to gather correct API information without exposing unnecessary low-level details, is by using “clang-extract-api” tool. It gathers and serializes information about APIs from header files to JSON output. However, support for Objective-C “categories” is still not complete. The primary objective of this project is to focus on modifying clang’s symbol graph output to generate and to include Objective-C categories and to implement support for generating this information both through clang and through libclang.
Introducing support for Objective-C Categories for ExtractAPI. The support 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.
The following diagram well represents the purpose ->
C++
I primarily faced following challenge -
- It took me a long time to build LLVM from scratch and to debug the LLVM code (due to slow machine). Although I had an access to the faster machine, I decided not to do so.
- I read others code and learned how to organize code in industry-level projects.
- Additionally, this practice increased my ability to comprehend code authored by others more efficiently.
- I used LLDB extensively and thus that increased my knowledge about debugging big codebase in general.
- I also learned that testing is important to keep the industry standard and one should extensively test their code keeping various edge cases in mind.
- The key work required is to ensure that the generated
json
(for theObjective-C
categories) should be appropriately displayed in the docc preview.
I would like to include following commit link (in LLVM phabricator) to the primary patch.
I would like to thanks my mentor Daniel Grumberg for helping me in completing all the above objectives.
In conclusion, this project strives to introduce support to the Objective-C
categories in LLVM's ExtractAPI. To sum up my GSoC journey, I would like to express my gratitude to mentors and the LLVM Organization for giving me a chance to work on this project.
Many thanks for your time and giving me this opportunity!
Ruturaj Vaidya [GitHub Profile]