[libc-commits] [libc] [llvm] [libc] Moves __cxa_thread_atexit_impl into proper entrypoint (PR #229347)

via libc-commits libc-commits at lists.llvm.org
Tue Oct 6 02:08:14 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- libc/src/threads/__cxa_thread_atexit_impl.cpp libc/src/threads/__cxa_thread_atexit_impl.h libc/src/__support/threads/thread.cpp libc/src/__support/threads/thread.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/__support/threads/thread.h b/libc/src/__support/threads/thread.h
index 746e1dcda..afb18af39 100644
--- a/libc/src/__support/threads/thread.h
+++ b/libc/src/__support/threads/thread.h
@@ -175,7 +175,7 @@ namespace internal {
 // implementing the thread_exit function.
 void call_atexit_callbacks();
 
-}//internal namespace
+} // namespace internal
 
 using AtExitCallback = void(void *);
 
@@ -183,7 +183,7 @@ int add_thread_atexit_callback(AtExitCallback *callback, void *obj);
 
 LIBC_INLINE Thread current_thread() {
   return Thread(get_current_thread_attrib());
-  }
+}
 
 } // namespace LIBC_NAMESPACE_DECL
 
diff --git a/libc/src/threads/__cxa_thread_atexit_impl.cpp b/libc/src/threads/__cxa_thread_atexit_impl.cpp
index 67b387ab7..2199dcab4 100644
--- a/libc/src/threads/__cxa_thread_atexit_impl.cpp
+++ b/libc/src/threads/__cxa_thread_atexit_impl.cpp
@@ -14,7 +14,7 @@
 #include "src/threads/__cxa_thread_atexit_impl.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
-#include "src/__support/threads/thread.h" 
+#include "src/__support/threads/thread.h"
 
 #include <threads.h>
 
@@ -27,7 +27,7 @@ namespace LIBC_NAMESPACE_DECL {
 // The semantics are very similar to the __cxa_atexit function except for the
 // fact that the registered callback is thread specific.
 LLVM_LIBC_FUNCTION(int, __cxa_thread_atexit_impl,
-                   (AtExitCallback* callback, void *obj, void *)) {
+                   (AtExitCallback * callback, void *obj, void *)) {
   return add_thread_atexit_callback(callback, obj);
 }
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/threads/__cxa_thread_atexit_impl.h b/libc/src/threads/__cxa_thread_atexit_impl.h
index 729498b40..79e28e753 100644
--- a/libc/src/threads/__cxa_thread_atexit_impl.h
+++ b/libc/src/threads/__cxa_thread_atexit_impl.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for __cxa_thread_atexit_impl function ------------*- C++ -*-===//
+//===-- Implementation header for __cxa_thread_atexit_impl function
+//------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -14,9 +15,7 @@
 
 namespace LIBC_NAMESPACE_DECL {
 
-int __cxa_thread_atexit_impl(AtExitCallback *callback, void *obj,
-                                        void *);
-}// namespace LIBC_NAMESPACE_DECL
+int __cxa_thread_atexit_impl(AtExitCallback *callback, void *obj, void *);
+} // namespace LIBC_NAMESPACE_DECL
 
 #endif // LLVM_LIBC_SRC_THREADS_CXA_THREAD_ATEXIT_IMPL_H
-

``````````

</details>


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


More information about the libc-commits mailing list