[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 4 09:58:12 PST 2019
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM aside from a few minor nits/questions.
================
Comment at: clang/docs/AutomaticReferenceCounting.rst:1747
+contrast with ``__unsafe_unretained``, an externally-retained variable still
+behaves as a strong variable outside of initialization and deinitialization. For
+instance, when an externally-retained variable is captured in a block the value
----------------
deinitialization -> destruction ?
================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6160
+ for (unsigned I = 0, E = getFunctionOrMethodNumParams(D); I != E; ++I) {
+ auto *PVD = const_cast<ParmVarDecl *>(getFunctionOrMethodParam(D, I));
+ QualType Ty = PVD->getType();
----------------
The `const_cast<>` here feels a bit nasty, but I'm not certain it's worth an overload of `getFunctionOrMethodParam()` to hide it away. Your call on whether you want to add the overload or not.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55865/new/
https://reviews.llvm.org/D55865
More information about the cfe-commits
mailing list