[compiler-rt] [compiler-rt] Refactor Windows IN_SECTION declarations (PR #216582)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 16 10:32:55 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 -- compiler-rt/lib/asan/asan_globals_win.cpp compiler-rt/lib/asan/asan_win.cpp compiler-rt/lib/asan/asan_win_common_runtime_thunk.cpp compiler-rt/lib/asan/asan_win_common_runtime_thunk.h compiler-rt/lib/asan/asan_win_dynamic_runtime_thunk.cpp compiler-rt/lib/sanitizer_common/sanitizer_win.cpp compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.cpp compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.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/compiler-rt/lib/asan/asan_win.cpp b/compiler-rt/lib/asan/asan_win.cpp
index 7bb2fd4b1..c671a2d63 100644
--- a/compiler-rt/lib/asan/asan_win.cpp
+++ b/compiler-rt/lib/asan/asan_win.cpp
@@ -399,7 +399,7 @@ static void NTAPI asan_thread_init(void *module, DWORD reason, void *reserved) {
#pragma section(".CRT$XLAB", long, read)
IN_SECTION(".CRT$XLAB")
void(NTAPI* __asan_tls_init)(void*, unsigned long, void*) = asan_thread_init;
-#endif
+# endif
static void NTAPI asan_thread_exit(void *module, DWORD reason, void *reserved) {
if (reason == DLL_THREAD_DETACH) {
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
index 254a675fa..52f6cb6ea 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
@@ -761,7 +761,7 @@ static int RunAtexit() {
#pragma section(".CRT$XID", long, read)
IN_SECTION(".CRT$XID") int (*__run_atexit)() = RunAtexit;
-#endif
+# endif
// ------------------ sanitizer_libc.h
fd_t OpenFile(const char *filename, FileAccessMode mode, error_t *last_error) {
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h
index 0f97a1803..7f36f3ae7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h
@@ -163,14 +163,14 @@
// }
//
-# else // SANITIZER_GO
+# else // SANITIZER_GO
// Go neither needs nor wants weak references.
// The shenanigans above don't work for gcc.
# define WIN_WEAK_EXPORT_DEF(ReturnType, Name, ...) \
extern "C" ReturnType Name(__VA_ARGS__)
-# endif // SANITIZER_GO
+# endif // SANITIZER_GO
#endif // SANITIZER_WINDOWS
#endif // SANITIZER_WIN_DEFS_H
``````````
</details>
https://github.com/llvm/llvm-project/pull/216582
More information about the llvm-commits
mailing list