[all-commits] [llvm/llvm-project] 2bcbe4: [clang][ExtractAPI] Fix handling of anonymous TagD...

Daniel Grumberg via All-commits all-commits at lists.llvm.org
Wed Apr 24 05:53:52 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2bcbe40f8a1c6cc9a256711261d8aa8fde50f7b3
      https://github.com/llvm/llvm-project/commit/2bcbe40f8a1c6cc9a256711261d8aa8fde50f7b3
  Author: Daniel Grumberg <dgrumberg at apple.com>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    M clang/include/clang/ExtractAPI/API.h
    M clang/include/clang/ExtractAPI/APIRecords.inc
    M clang/include/clang/ExtractAPI/DeclarationFragments.h
    M clang/include/clang/ExtractAPI/ExtractAPIVisitor.h
    M clang/lib/ExtractAPI/API.cpp
    M clang/lib/ExtractAPI/DeclarationFragments.cpp
    M clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
    M clang/test/ExtractAPI/anonymous_record_no_typedef.c
    M clang/test/ExtractAPI/enum.c
    M clang/test/ExtractAPI/function_noexcepts.cpp
    M clang/test/ExtractAPI/methods.cpp
    M clang/test/ExtractAPI/objc_block.m
    M clang/test/ExtractAPI/typedef_anonymous_record.c
    M clang/test/ExtractAPI/typedef_struct_enum.c

  Log Message:
  -----------
  [clang][ExtractAPI] Fix handling of anonymous TagDecls (#87772)

This changes the handling of anonymous TagDecls to the following rules:
- If the TagDecl is embedded in the declaration for some VarDecl (this
is the only possibility for RecordDecls), then pretend the child decls
belong to the VarDecl
- If it's an EnumDecl proceed as we did previously, i.e., embed it in
the enclosing DeclContext.

Additionally this fixes a few issues with declaration fragments not
consistently including "{ ... }" for anonymous TagDecls. To make testing
these additions easier this patch fixes some text declaration fragments
merging issues and updates tests accordingly.

rdar://121436298



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list