[PATCH] D43841: Add an option to disable tail-call optimization for escaping blocks

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 1 12:27:43 PST 2018


ahatanak marked an inline comment as done.
ahatanak added inline comments.


================
Comment at: lib/Sema/SemaExpr.cpp:4846
+        if (auto *BE = dyn_cast<BlockExpr>(Arg->IgnoreParenNoopCasts(Context)))
+          BE->getBlockDecl()->setDoesNotEscape();
+
----------------
rjmccall wrote:
> Can this be based on the noescape parameter bit on the function type?
Oh that's right. It should be able to set the DoesNotEscape bit of a block when it's passed to an indirect function call. I added an IRGen test case that checks tail-call is enabled in such cases.



https://reviews.llvm.org/D43841





More information about the cfe-commits mailing list