[PATCH] D12547: Add support for function attribute "disable_tail_calls"

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 15 21:46:30 PDT 2015


ahatanak updated this revision to Diff 34872.
ahatanak added a comment.

Sorry for the delay in my response.

I had discussions with the users who requested this feature and it turns out they were asking for two different kinds of attributes. They are both needed to disable tail call optimization to preserve the stack frame but they differ in which stack frame they are trying to preserve. The attribute in this patch disables optimization on the call sites inside a function to preserve the stack frame of the function. The other attribute disables tail call *to* the function and therefore preserves the stack frame of the calling function.

I'll send a patch for the other attribute shortly.


http://reviews.llvm.org/D12547

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/AttrDocs.td
  lib/CodeGen/CGCall.cpp
  lib/Sema/SemaDeclAttr.cpp
  test/CodeGen/attr-disable-tail-calls.c
  test/Sema/disable-tail-calls-attr.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12547.34872.patch
Type: text/x-patch
Size: 4882 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150916/2f809193/attachment.bin>


More information about the cfe-commits mailing list