-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[libc++] Add std::stacktrace (P0881R7) #136528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
528d7a2
979441d
2156560
64a0af4
562f700
e4885c4
3526a3a
f2439c9
339c65d
9489ab7
41c6c65
b1e4a80
c9fd1f5
52dd57c
5c20b62
0185ed1
d64984f
e71ff7a
9544b13
bdcb282
81ba9b1
bf2cfe8
1a36da5
e71b1d5
ddcc193
775ae37
7b2fc6c
e0d2736
aebf1e0
b376d8f
c0670d3
fd37e3f
12ed9d5
ae3d3cf
fec40ae
3698e56
6440081
179091d
c6f56a0
f0381d6
ff2962c
000e830
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -965,6 +965,33 @@ typedef __char32_t char32_t; | |
# define _LIBCPP_NOINLINE | ||
# endif | ||
|
||
// Some functions, e.g. std::stacktrace::current, need to avoid being | ||
// tail-called by (and tail-calling other) functions, for proper enumeration of | ||
// call-stack frames. | ||
// clang-format off | ||
|
||
// Disables tail-call optimization for "outbound" calls | ||
// performed in the function annotated with this attribute. | ||
# if __has_cpp_attribute(_Clang::__disable_tail_calls__) | ||
# define _LIBCPP_NO_TAIL_CALLS_OUT [[_Clang::__disable_tail_calls__]] | ||
# elif __has_cpp_attribute(__gnu__::__optimize__) | ||
# define _LIBCPP_NO_TAIL_CALLS_OUT [[__gnu__::__optimize__("no-optimize-sibling-calls")]] | ||
# else | ||
# define _LIBCPP_NO_TAIL_CALLS_OUT | ||
# endif | ||
|
||
// Disables tail-call optimization for "inbound" calls -- that is, | ||
// calls from some other function calling the one having this attribute. | ||
# if __has_cpp_attribute(_Clang::__not_tail_called__) | ||
# define _LIBCPP_NO_TAIL_CALLS_IN [[_Clang::__not_tail_called__]] | ||
# else | ||
# define _LIBCPP_NO_TAIL_CALLS_IN | ||
# endif | ||
|
||
// Disable TCO for calls into, and out from, the annotated function. | ||
# define _LIBCPP_NO_TAIL_CALLS _LIBCPP_NO_TAIL_CALLS_IN _LIBCPP_NO_TAIL_CALLS_OUT | ||
// clang-format on | ||
|
||
|
||
// We often repeat things just for handling wide characters in the library. | ||
// When wide characters are disabled, it can be useful to have a quick way of | ||
// disabling it without having to resort to #if-#endif, which has a larger | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update all issue links to the universal format after: #156288