[libc-commits] [clang] [libc] [llvm] [clang] Make __builtin_expf constexpr. (PR #140841)

Alexey Samsonov via libc-commits libc-commits at lists.llvm.org
Tue May 20 23:06:33 PDT 2025


================
@@ -0,0 +1,22 @@
+//===-- 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 "src/__support/math/expf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace shared {
+
+using math::expf;
----------------
vonosmas wrote:

I wonder if there's any value in having a per-function (or per-function-group) header? E.g. `libc/shared/math/exp.h` . Otherwise the user who wants to use just one function will include header with all of them, potentially pulling in a bunch of deps they don't want (or won't work on their system).

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


More information about the libc-commits mailing list