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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 16 07:48:51 PDT 2015


On Wed, Sep 16, 2015 at 12:46 AM, Akira Hatanaka <ahatanak at gmail.com> wrote:
> 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.

Ah, thank you for that clarification.

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

Do you have a guess as to what the name of that other attribute will
be? I just want to make sure we pick clear names, and I could see the
current proposed attribute name being used for either situation.

~Aaron

>
>
> 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
>


More information about the cfe-commits mailing list