[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 2 22:20:51 PST 2019


rjmccall added inline comments.


================
Comment at: clang/docs/AutomaticReferenceCounting.rst:1748
+``objc_externally_retained`` can apply to local variables, or to parameters via
+a function definitions.
+
----------------
I think "can apply to parameters and local variables" is probably the clearest way to express this.

I would suggest turning this around a bit.  Don't name the section after the attribute; instead,
start by talking about externally-retained variables as a general concept, then begin a new
paragraph to discuss how they arise: (1) certain implicit places which will be discussed below
and (2) this attribute, which you can then discuss.  It will then be natural to add a third
paragraph to talk about the pragma or whatever it ends up being.

The first paragraph should talk about things like capture semantics like the attribute docs do.


================
Comment at: clang/include/clang/Basic/AttrDocs.td:3811
+will be retained as part of capturing it and released when the block is
+destroyed. It also affects C++ features such as lambda capture, ``decltype``,
+and template argument deduction.
----------------
Worth adding after this sentence: "(Note that the block capture field is not considered
externally retained.)"


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55865/new/

https://reviews.llvm.org/D55865





More information about the cfe-commits mailing list