[clang] extend external_source_symbol attribute with USR clause
authorAlex Lorenz <arphaman@gmail.com>
Thu, 23 Feb 2023 22:14:14 +0000 (14:14 -0800)
committerAlex Lorenz <arphaman@gmail.com>
Thu, 23 Feb 2023 22:59:26 +0000 (14:59 -0800)
commitc8b37e48f6f00bb2aa3882ca3cc26082f85ca999
tree5e75ac7a02846bddc0e9addf2bf87595eedea841
parent5a4f193afa0d73f7ec459648d8f02535577dd604
[clang] extend external_source_symbol attribute with USR clause

Allow the user to specify a concrete USR in the external_source_symbol attribute.
That will let Clang's indexer to use Swift USRs for Swift declarations that are
represented with C++ declarations.

This new clause is used by Swift when generating a C++ header representation
of a Swift module:
https://github.com/apple/swift/pull/63002

Differential Revision: https://reviews.llvm.org/D141324
17 files changed:
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Basic/DiagnosticCommonKinds.td
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Parse/Parser.h
clang/lib/Index/USRGeneration.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/Parser.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/AST/ast-dump-attr.cpp
clang/test/Index/Core/external-source-symbol-attr-cxx.cpp [new file with mode: 0644]
clang/test/Index/Core/external-source-symbol-attr.m
clang/test/Parser/attr-external-source-symbol.m
clang/test/Sema/attr-external-source-symbol-cxx.cpp [new file with mode: 0644]
clang/test/Sema/attr-external-source-symbol.c
clang/utils/TableGen/ClangAttrEmitter.cpp