[all-commits] [llvm/llvm-project] 5aab45: [clang][extract-api] Add global record support

Zixu Wang via All-commits all-commits at lists.llvm.org
Wed Mar 16 15:15:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5aab45f430669d7d2af51386819d071b26c3c89c
      https://github.com/llvm/llvm-project/commit/5aab45f430669d7d2af51386819d071b26c3c89c
  Author: Zixu Wang <zixu_wang at apple.com>
  Date:   2022-03-16 (Wed, 16 Mar 2022)

  Changed paths:
    M clang/include/clang/AST/RawCommentList.h
    M clang/include/clang/Frontend/FrontendActions.h
    A clang/include/clang/SymbolGraph/API.h
    A clang/include/clang/SymbolGraph/AvailabilityInfo.h
    A clang/include/clang/SymbolGraph/DeclarationFragments.h
    A clang/include/clang/SymbolGraph/FrontendActions.h
    A clang/include/clang/SymbolGraph/Serialization.h
    M clang/lib/AST/RawCommentList.cpp
    M clang/lib/CMakeLists.txt
    M clang/lib/Frontend/CMakeLists.txt
    R clang/lib/Frontend/ExtractAPIConsumer.cpp
    M clang/lib/FrontendTool/CMakeLists.txt
    M clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
    A clang/lib/SymbolGraph/API.cpp
    A clang/lib/SymbolGraph/CMakeLists.txt
    A clang/lib/SymbolGraph/DeclarationFragments.cpp
    A clang/lib/SymbolGraph/ExtractAPIConsumer.cpp
    A clang/lib/SymbolGraph/Serialization.cpp
    M clang/test/Driver/extract-api.c
    A clang/test/SymbolGraph/global_record.c

  Log Message:
  -----------
  [clang][extract-api] Add global record support

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

Differential Revision: https://reviews.llvm.org/D119479




More information about the All-commits mailing list