[compiler-rt] [sanitizer_common] Use HW_NCPUONLINE sysctl on NetBSD in GetNumberOfC… (PR #134704)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 11:50:45 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index 5fa24f289..ffd240974 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -840,11 +840,11 @@ u32 GetNumberOfCPUs() {
   int req[2];
   uptr len = sizeof(ncpu);
   req[0] = CTL_HW;
-#ifdef HW_NCPUONLINE
+#    ifdef HW_NCPUONLINE
   req[1] = HW_NCPUONLINE;
-#else
+#    else
   req[1] = HW_NCPU;
-#endif
+#    endif
   CHECK_EQ(internal_sysctl(req, 2, &ncpu, &len, NULL, 0), 0);
   return ncpu;
 #  elif SANITIZER_SOLARIS

``````````

</details>


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


More information about the llvm-commits mailing list