[libcxx-commits] [libcxx] Add C++23 stacktrace (P0881R7) (PR #136528)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 1 01:29:57 PDT 2025


================
@@ -0,0 +1,91 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+/*
+"Generic" implementation for any platform that doesn't have its own special implementation.
+(Currently this means any platform other than Windows)
+*/
+
+#if !defined(_WIN32)
+
+#  include <__config>
+#  include <__stacktrace/stacktrace_entry.h>
+
+#  include "stacktrace/images.h"
+#  include "stacktrace/unwinding.h"
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+namespace __stacktrace {
+
+_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE _LIBCPP_EXPORTED_FROM_ABI void
+base::current_impl(size_t skip, size_t max_depth) {
+  if (!max_depth) [[unlikely]] {
----------------
philnik777 wrote:

Please don't add annotations like this without a clear performance benefit.

https://github.com/llvm/llvm-project/pull/136528


More information about the libcxx-commits mailing list