[all-commits] [llvm/llvm-project] 9fc45c: [clang][extract-api] Add support for typedefs

Daniel Grumberg via All-commits all-commits at lists.llvm.org
Wed Apr 6 11:16:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fc45ca00a19336c0724631aa1b1985dd4f4d536
      https://github.com/llvm/llvm-project/commit/9fc45ca00a19336c0724631aa1b1985dd4f4d536
  Author: Daniel Grumberg <dgrumberg at apple.com>
  Date:   2022-04-06 (Wed, 06 Apr 2022)

  Changed paths:
    M clang/include/clang/ExtractAPI/API.h
    M clang/include/clang/ExtractAPI/DeclarationFragments.h
    M clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h
    M clang/lib/ExtractAPI/API.cpp
    M clang/lib/ExtractAPI/CMakeLists.txt
    M clang/lib/ExtractAPI/DeclarationFragments.cpp
    M clang/lib/ExtractAPI/ExtractAPIConsumer.cpp
    M clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
    A clang/lib/ExtractAPI/TypedefUnderlyingTypeResolver.cpp
    A clang/lib/ExtractAPI/TypedefUnderlyingTypeResolver.h
    A clang/test/ExtractAPI/typedef.c
    A clang/test/ExtractAPI/typedef_anonymous_record.c
    A clang/test/ExtractAPI/typedef_chain.c

  Log Message:
  -----------
  [clang][extract-api] Add support for typedefs

Typedef records consist of the symbol associated with the underlying
TypedefDecl and a SymbolReference to the underlying type. Additionally
typedefs for anonymous TagTypes use the typedef'd name as the symbol
name in their respective records and USRs. As a result the declaration
fragments for the anonymous TagType are those for the associated
typedef. This means that when the user is defining a typedef to a
typedef to a anonymous type, we use a reference the anonymous TagType
itself and do not emit the typedef to the anonymous type in the
generated symbol graph, including in the type destination of further
typedef symbol records.

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




More information about the All-commits mailing list