[libc] [llvm] [libc][math] Refactor expf implementation to header-only in src/__support/math folder. (PR #143790)

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 11 16:08:24 PDT 2025


================
@@ -0,0 +1,23 @@
+//===-- Floating point math functions ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SHARED_MATH_H
+#define LLVM_LIBC_SHARED_MATH_H
+
+#include "libc_common.h"
+#include "src/__support/math/expf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::expf;
----------------
vonosmas wrote:

I wonder if we should have a per-function headers? (e.g. `libc/shared/math/expf.h`) Otherwise anyone willing to import a single math function from llvm-libc would need to include `libc/shared/math.h` and get **all** of them.

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


More information about the llvm-commits mailing list