]> granicus.if.org Git - clang/commit
[attributes] Add a family of OS_CONSUMED, OS_RETURNS and OS_RETURNS_RETAINED attributes
authorGeorge Karpenkov <ekarpenkov@apple.com>
Fri, 30 Nov 2018 02:18:37 +0000 (02:18 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Fri, 30 Nov 2018 02:18:37 +0000 (02:18 +0000)
commit5d1a14dd3176d2d1946d9f40fcfd561e8e4c5f77
tree4838c0e7d18c83698c8cab08925c318b6327ccec
parent608f39163aa7ae3f20bbe5e1cac8ec68d3b14298
[attributes] Add a family of OS_CONSUMED, OS_RETURNS and OS_RETURNS_RETAINED attributes

The addition adds three attributes for communicating ownership,
analogous to existing NS_ and CF_ attributes.
The attributes are meant to be used for communicating ownership of all
objects in XNU (Darwin kernel) and all of the kernel modules.
The ownership model there is very similar, but still different from the
Foundation model, so we think that introducing a new family of
attributes is appropriate.

The addition required a sizeable refactoring of the existing code for
CF_ and NS_ ownership attributes, due to tight coupling and the fact
that differentiating between the types was previously done using a
boolean.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347947 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Sema/Sema.h
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/Misc/pragma-attribute-supported-attributes-list.test
test/Sema/attr-osobject.cpp [new file with mode: 0644]
test/Sema/attr-osobject.mm [new file with mode: 0644]