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

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 3 13:52:22 PST 2019


erik.pilkington marked an inline comment as done.
erik.pilkington added inline comments.


================
Comment at: clang/docs/AutomaticReferenceCounting.rst:1779
+externally-retained, unless the variable was explicitly qualified with
+``__strong``. For instance, ``first_param`` is externally-retained below, but
+not ``second_param``:
----------------
rjmccall wrote:
> I hadn't noticed the parameter-index feature.  Is that a good idea?  Surely if this level of control is needed, it would be better to add the attribute to each parameter individually — or still better, just use explicit ownership qualifiers to mark the exceptions.  And it creates all sorts of ugly questions about the indexing base and how it accounts for implicit parameters.
Oh, good point. I never even considered just opting out with `__strong` instead of indices. That makes a lot more sense and has better ergonomics. I'll remove that feature and update the docs...

FWIW: I explained why I went with the attribute on the FunctionDecl instead of the ParmVarDecl a few comments up if you missed it.


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

https://reviews.llvm.org/D55865





More information about the cfe-commits mailing list