[libc-commits] [libc] [llvm] [libc] use constexpr for sinpif (PR #176580)

via libc-commits libc-commits at lists.llvm.org
Sat Jan 17 09:50:58 PST 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/shared/math/sinpif.h libc/src/__support/math/sinpif.h libc/shared/math.h libc/src/math/generic/sinpif.cpp libc/test/shared/shared_math_test.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/src/__support/math/sinpif.h b/libc/src/__support/math/sinpif.h
index c1e97ddd0..44a52d54f 100644
--- a/libc/src/__support/math/sinpif.h
+++ b/libc/src/__support/math/sinpif.h
@@ -1,4 +1,5 @@
-//===-- Implementation header for sinpif -------------------------*- C++ -*-===//
+//===-- Implementation header for sinpif -------------------------*- C++
+//-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/src/math/generic/sinpif.cpp b/libc/src/math/generic/sinpif.cpp
index f7a6e1acb..3b4d43c66 100644
--- a/libc/src/math/generic/sinpif.cpp
+++ b/libc/src/math/generic/sinpif.cpp
@@ -10,7 +10,5 @@
 #include "src/__support/math/sinpif.h"
 namespace LIBC_NAMESPACE_DECL {
 
-LLVM_LIBC_FUNCTION(float, sinpif, (float x)) {
-  return math::sinpif(x);
-}
+LLVM_LIBC_FUNCTION(float, sinpif, (float x)) { return math::sinpif(x); }
 } // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/test/shared/shared_math_test.cpp b/libc/test/shared/shared_math_test.cpp
index 554873637..0c1f8a811 100644
--- a/libc/test/shared/shared_math_test.cpp
+++ b/libc/test/shared/shared_math_test.cpp
@@ -69,7 +69,7 @@ TEST(LlvmLibcSharedMathTest, AllFloat) {
   EXPECT_FP_EQ(0x0p+0f, LIBC_NAMESPACE::shared::exp2m1f(0.0f));
   EXPECT_FP_EQ(0x1p+0f, LIBC_NAMESPACE::shared::expf(0.0f));
   EXPECT_FP_EQ(0x1p+0f, LIBC_NAMESPACE::shared::exp2f(0.0f));
-  EXPECT_FP_EQ(0x0p+0f, LIBC_NAMESPACE::shared::expm1f(0.0f));  
+  EXPECT_FP_EQ(0x0p+0f, LIBC_NAMESPACE::shared::expm1f(0.0f));
   EXPECT_FP_EQ(0x0p+0f, LIBC_NAMESPACE::shared::hypotf(0.0f, 0.0f));
   EXPECT_FP_EQ_ALL_ROUNDING(0.75f,
                             LIBC_NAMESPACE::shared::frexpf(24.0f, &exponent));

``````````

</details>


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


More information about the libc-commits mailing list