]> granicus.if.org Git - clang/commit
Add lifetime categories attributes
authorMatthias Gehre <M.Gehre@gmx.de>
Thu, 25 Jul 2019 17:50:51 +0000 (17:50 +0000)
committerMatthias Gehre <M.Gehre@gmx.de>
Thu, 25 Jul 2019 17:50:51 +0000 (17:50 +0000)
commit07d5b4a5da63a6e1602d04fee0eabcae3871b2f2
tree4903a8ecbf4bd930b8d42fe96c60c68e89690004
parent297c334b449f40cdcdb42e154e0255c7fef629cf
Add lifetime categories attributes

Summary:
This is the first part of work announced in
"[RFC] Adding lifetime analysis to clang" [0],
i.e. the addition of the [[gsl::Owner(T)]] and
[[gsl::Pointer(T)]] attributes, which
will enable user-defined types to participate in
the lifetime analysis (which will be part of the
next PR).
The type `T` here is called "DerefType" in the paper,
and denotes the type that an Owner owns and a Pointer
points to. E.g. `std::vector<int>` should be annotated
with `[[gsl::Owner(int)]]` and
a `std::vector<int>::iterator` with `[[gsl::Pointer(int)]]`.

[0] http://lists.llvm.org/pipermail/cfe-dev/2018-November/060355.html

Reviewers: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367040 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Parse/ParseDecl.cpp
lib/Sema/SemaDeclAttr.cpp
test/AST/ast-dump-attr.cpp
test/Misc/pragma-attribute-supported-attributes-list.test
test/SemaCXX/attr-gsl-owner-pointer.cpp [new file with mode: 0644]
test/SemaOpenCL/invalid-kernel-attrs.cl
utils/TableGen/ClangAttrEmitter.cpp