mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 22:06:38 +00:00

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 llvm-svn: 252986
9 lines
226 B
C++
9 lines
226 B
C++
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
|
|
// expected-no-diagnostics
|
|
|
|
class B {
|
|
public:
|
|
[[clang::disable_tail_calls]] virtual int foo1() { return 1; }
|
|
[[clang::disable_tail_calls]] int foo2() { return 2; }
|
|
};
|