[libc-commits] [libc] [libc][benchmark] allow benchmark to be built without llvm support (PR #200951)

via libc-commits libc-commits at lists.llvm.org
Mon Jun 1 14:46: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 cpp,h -- libc/benchmarks/LibcBenchmark.cpp libc/benchmarks/LibcBenchmark.h libc/benchmarks/LibcMemoryBenchmark.cpp libc/benchmarks/LibcMemoryBenchmark.h libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp libc/benchmarks/MemorySizeDistributions.cpp --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/benchmarks/LibcBenchmark.cpp b/libc/benchmarks/LibcBenchmark.cpp
index 6135eaf66..a5bca1f71 100644
--- a/libc/benchmarks/LibcBenchmark.cpp
+++ b/libc/benchmarks/LibcBenchmark.cpp
@@ -48,8 +48,8 @@ HostState HostState::get() {
 
 #ifndef LIBC_BENCHMARKS_HAS_LLVM_SUPPORT
 #include "llvm/ADT/Twine.h"
-#include <iostream>
 #include <cstdlib>
+#include <iostream>
 
 namespace llvm {
 void report_fatal_error(const char *reason, bool gen_crash_diag) {
@@ -66,4 +66,3 @@ void report_fatal_error(const Twine &reason, bool gen_crash_diag) {
 }
 } // namespace llvm
 #endif
-
diff --git a/libc/benchmarks/LibcBenchmark.h b/libc/benchmarks/LibcBenchmark.h
index 903e25ed4..a790c3ad4 100644
--- a/libc/benchmarks/LibcBenchmark.h
+++ b/libc/benchmarks/LibcBenchmark.h
@@ -41,7 +41,6 @@
 
 #include "llvm/Support/ErrorHandling.h"
 
-
 namespace llvm {
 namespace libc_benchmarks {
 
diff --git a/libc/benchmarks/LibcMemoryBenchmark.cpp b/libc/benchmarks/LibcMemoryBenchmark.cpp
index 748e0567d..a0500ff02 100644
--- a/libc/benchmarks/LibcMemoryBenchmark.cpp
+++ b/libc/benchmarks/LibcMemoryBenchmark.cpp
@@ -85,7 +85,8 @@ static constexpr int64_t L1LeftAsideBytes = 1 * KiB;
 
 static size_t getAvailableBufferSize() {
   auto L1Size = getL1DataCacheSize();
-  return (L1Size ? *L1Size : 32 * 1024) - L1LeftAsideBytes - ParameterStorageBytes;
+  return (L1Size ? *L1Size : 32 * 1024) - L1LeftAsideBytes -
+         ParameterStorageBytes;
 }
 
 ParameterBatch::ParameterBatch(size_t BufferCount)
diff --git a/libc/benchmarks/MemorySizeDistributions.cpp b/libc/benchmarks/MemorySizeDistributions.cpp
index 1e9637844..9e7469cc8 100644
--- a/libc/benchmarks/MemorySizeDistributions.cpp
+++ b/libc/benchmarks/MemorySizeDistributions.cpp
@@ -4,8 +4,8 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 #else
-#include <sstream>
 #include <iostream>
+#include <sstream>
 #endif
 
 namespace llvm {

``````````

</details>


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


More information about the libc-commits mailing list