Add support for function attribute 'disable_tail_calls'.
The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. For example, int callee(int); int foo(int a) __attribute__((disable_tail_calls)) { return callee(a); // This call is not tail-call optimized. } Note that this attribute is different from 'not_tail_called', which prevents tail-call optimization to the marked function. rdar://problem/8973573 Differential Revision: http://reviews.llvm.org/D12547 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252986 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/Attr.td 7 additions, 0 deletionsinclude/clang/Basic/Attr.td
- include/clang/Basic/AttrDocs.td 38 additions, 0 deletionsinclude/clang/Basic/AttrDocs.td
- lib/CodeGen/CGCall.cpp 5 additions, 1 deletionlib/CodeGen/CGCall.cpp
- lib/Sema/SemaDeclAttr.cpp 23 additions, 1 deletionlib/Sema/SemaDeclAttr.cpp
- test/CodeGen/attr-disable-tail-calls.c 13 additions, 5 deletionstest/CodeGen/attr-disable-tail-calls.c
- test/CodeGenCXX/attr-disable-tail-calls.cpp 35 additions, 0 deletionstest/CodeGenCXX/attr-disable-tail-calls.cpp
- test/Sema/attr-disable-tail-calls.c 13 additions, 0 deletionstest/Sema/attr-disable-tail-calls.c
- test/SemaCXX/attr-disable-tail-calls.cpp 8 additions, 0 deletionstest/SemaCXX/attr-disable-tail-calls.cpp
Loading
Please register or sign in to comment