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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 1 12:38:53 PST 2018


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

Alright, this looks good to me.



================
Comment at: lib/Sema/SemaExpr.cpp:4846
+        if (auto *BE = dyn_cast<BlockExpr>(Arg->IgnoreParenNoopCasts(Context)))
+          BE->getBlockDecl()->setDoesNotEscape();
+
----------------
ahatanak wrote:
> 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.
> 
Thanks!


https://reviews.llvm.org/D43841





More information about the cfe-commits mailing list