[PATCH] D119479: [clang][extract-api] Add global record support

Zixu Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 10 13:44:03 PST 2022


zixuw created this revision.
Herald added a subscriber: mgorny.
zixuw requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Add facilities for extract-api:

- Structs/classes to hold collected API information: `APIRecord`, `API`
- Structs/classes for API information:
  - `AvailabilityInfo`: aggregated availbility information
  - `DeclarationFragments`: declaration fragments
    - `DeclarationFragmentsBuilder`: helper class to build declaration fragments for various types/declarations
  - `FunctionSignature`: function signature
- Serialization: `Serializer`
- Add output file for `ExtractAPIAction`
- Refactor `clang::RawComment::getFormattedText` to provide an additional `getFormattedLines` for a more detailed view of comment lines used for the SymbolGraph format

Add support for global records (global variables and functions)

- Add `GlobalRecord` based on `APIRecord` to store global records' information
- Implement `VisitVarDecl` and `VisitFunctionDecl` in `ExtractAPIVisitor` to collect information
- Implement serialization for global records
- Add test case for global records


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119479

Files:
  clang/include/clang/AST/RawCommentList.h
  clang/include/clang/Frontend/FrontendActions.h
  clang/include/clang/SymbolGraph/API.h
  clang/include/clang/SymbolGraph/AvailabilityInfo.h
  clang/include/clang/SymbolGraph/DeclarationFragments.h
  clang/include/clang/SymbolGraph/Serialization.h
  clang/lib/AST/RawCommentList.cpp
  clang/lib/CMakeLists.txt
  clang/lib/Frontend/CMakeLists.txt
  clang/lib/Frontend/ExtractAPIConsumer.cpp
  clang/lib/SymbolGraph/API.cpp
  clang/lib/SymbolGraph/CMakeLists.txt
  clang/lib/SymbolGraph/DeclarationFragments.cpp
  clang/lib/SymbolGraph/Serialization.cpp
  clang/test/Driver/extract-api.c
  clang/test/SymbolGraph/global_record.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119479.407666.patch
Type: text/x-patch
Size: 68093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220210/876f58b6/attachment-0001.bin>


More information about the cfe-commits mailing list