[PATCH] D32210: [Sema][ObjC] Add support for attribute "noescape"

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 19 11:09:11 PDT 2017


rjmccall added a comment.

The rule we actually want is that no reference to the block derived from the parameter value will survive after the function returns.  You can include examples of things that would cause potential escapes, but trying to actually lock down the list seems ill-advised.

Are you sure you want to try to enforce this in the frontend?  In Swift, we discovered that we needed some way of escaping the static checking in order to make this practical, because there are a lot of patterns that locally look like escapes but really aren't (e.g. passing the block to dispatch_async and then waiting for that to complete).  Seems more like a static analysis than a frontend warning.


https://reviews.llvm.org/D32210





More information about the cfe-commits mailing list