[Clang] Add the `annotate_type` attribute
authorMartin Boehme <mboehme@google.com>
Wed, 15 Jun 2022 06:08:10 +0000 (08:08 +0200)
committerMartin Boehme <mboehme@google.com>
Wed, 15 Jun 2022 07:47:28 +0000 (09:47 +0200)
commit665da187ccf338bad1560e8a960e8feaebb5c9d9
treebfcb0201061bcf086c66606bcb077e5ea76f28ab
parent3151fb5ef7249d5d0a293daea6af756856800005
[Clang] Add the `annotate_type` attribute

This is an analog to the `annotate` attribute but for types. The intent is to allow adding arbitrary annotations to types for use in static analysis tools.

For details, see this RFC:

https://discourse.llvm.org/t/rfc-new-attribute-annotate-type-iteration-2/61378

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D111548
14 files changed:
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Sema/Sema.h
clang/lib/AST/TypePrinter.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Sema/SemaAttr.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaType.cpp
clang/test/AST/attr-annotate-type.c [new file with mode: 0644]
clang/test/CodeGenCXX/annotate-type.cpp [new file with mode: 0644]
clang/test/Sema/annotate-type.c [new file with mode: 0644]
clang/test/SemaCXX/annotate-type.cpp [new file with mode: 0644]
clang/unittests/AST/AttrTest.cpp