[libc-commits] [libc] 4671437 - [libc] Add missing LIBC_INLINE to functions defined in .h files (#213442)

via libc-commits libc-commits at lists.llvm.org
Sat Aug 1 11:48:49 PDT 2026


Author: Nico Weber
Date: 2026-08-01T14:48:45-04:00
New Revision: 4671437fb024a1c641b154850a7df4db2c22af21

URL: https://github.com/llvm/llvm-project/commit/4671437fb024a1c641b154850a7df4db2c22af21
DIFF: https://github.com/llvm/llvm-project/commit/4671437fb024a1c641b154850a7df4db2c22af21.diff

LOG: [libc] Add missing LIBC_INLINE to functions defined in .h files (#213442)

Added: 
    

Modified: 
    libc/src/__support/math/expm1.h
    libc/src/__support/math/tan.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/math/expm1.h b/libc/src/__support/math/expm1.h
index 3d2aa57b589cb..a357699cbed99 100644
--- a/libc/src/__support/math/expm1.h
+++ b/libc/src/__support/math/expm1.h
@@ -126,13 +126,13 @@ LIBC_INLINE DoubleDouble poly_approx_dd(const DoubleDouble &dx) {
 }
 
 #ifdef DEBUGDEBUG
-std::ostream &operator<<(std::ostream &OS, const DFloat128 &r) {
+LIBC_INLINE std::ostream &operator<<(std::ostream &OS, const DFloat128 &r) {
   OS << (r.sign == Sign::NEG ? "-(" : "(") << r.mantissa.val[0] << " + "
      << r.mantissa.val[1] << " * 2^64) * 2^" << r.exponent << "\n";
   return OS;
 }
 
-std::ostream &operator<<(std::ostream &OS, const DoubleDouble &r) {
+LIBC_INLINE std::ostream &operator<<(std::ostream &OS, const DoubleDouble &r) {
   OS << std::hexfloat << "(" << r.hi << " + " << r.lo << ")"
      << std::defaultfloat << "\n";
   return OS;

diff  --git a/libc/src/__support/math/tan.h b/libc/src/__support/math/tan.h
index 7ff6f4f795cfb..87f46acbf7017 100644
--- a/libc/src/__support/math/tan.h
+++ b/libc/src/__support/math/tan.h
@@ -108,8 +108,9 @@ LIBC_INLINE double tan_eval(const DoubleDouble &u, DoubleDouble &result) {
 // Calculation a / b = a * (1/b) for DFloat128.
 // Using the initial approximation of q ~ (1/b), then apply 2 Newton-Raphson
 // iterations, before multiplying by a.
-[[maybe_unused]] DFloat128 newton_raphson_div(const DFloat128 &a, DFloat128 b,
-                                              double q) {
+[[maybe_unused]] LIBC_INLINE DFloat128 newton_raphson_div(const DFloat128 &a,
+                                                          DFloat128 b,
+                                                          double q) {
   DFloat128 q0(q);
   LIBC_BIT_CAST_CONSTEXPR_VAR DFloat128 TWO(2.0);
   b.sign = (b.sign == Sign::POS) ? Sign::NEG : Sign::POS;


        


More information about the libc-commits mailing list