[all-commits] [llvm/llvm-project] 4735b4: [APINotes] Support C++ tag conformances to Swift p...

Egor Zhdan via All-commits all-commits at lists.llvm.org
Mon Aug 12 07:22:31 PDT 2024


  Branch: refs/heads/users/egorzhdan/apinotes-conforms-to
  Home:   https://github.com/llvm/llvm-project
  Commit: 4735b4c7bad13dee4bbeb819aba8ac555f842322
      https://github.com/llvm/llvm-project/commit/4735b4c7bad13dee4bbeb819aba8ac555f842322
  Author: Egor Zhdan <e_zhdan at apple.com>
  Date:   2024-08-12 (Mon, 12 Aug 2024)

  Changed paths:
    M clang/docs/APINotes.rst
    M clang/include/clang/APINotes/Types.h
    M clang/lib/APINotes/APINotesFormat.h
    M clang/lib/APINotes/APINotesReader.cpp
    M clang/lib/APINotes/APINotesWriter.cpp
    M clang/lib/APINotes/APINotesYAMLCompiler.cpp
    M clang/lib/Sema/SemaAPINotes.cpp
    M clang/test/APINotes/Inputs/Headers/SwiftImportAs.apinotes
    M clang/test/APINotes/swift-import-as.cpp

  Log Message:
  -----------
  [APINotes] Support C++ tag conformances to Swift protocols

This allows adding a Clang attribute `swift_attr("conforms_to:ModuleName.ProtocolName")` to C++ structs via API Notes.

The Swift compiler respects this attribute when importing C++ types into Swift by automatically declaring the C++ type as a conforming type to the given Swift protocol.

rdar://131388824



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