[llvm] [libc] [libc][NFC] Fix missing LIBC_INLINE + style (PR #73659)

Clement Courbet via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 03:59:42 PST 2023


================
@@ -24,74 +26,74 @@ constexpr unsigned long long ULLONG_MAX = ~0ULL;
 
 template <class T> class numeric_limits {
 public:
-  static constexpr T max();
-  static constexpr T min();
+  LIBC_INLINE static constexpr T max();
+  LIBC_INLINE static constexpr T min();
 };
 
 // TODO: Add numeric_limits specializations as needed for new types.
 
 template <> class numeric_limits<int> {
 public:
-  static constexpr int max() { return INT_MAX; }
-  static constexpr int min() { return INT_MIN; }
+  LIBC_INLINE static constexpr int max() { return INT_MAX; }
----------------
legrosbuffle wrote:

I've read the documentation (libc/docs/code_style.rst), but it conflates `LIBC_INLINE` and `inline`:

```
Instead of using the ``inline`` keyword, they should be tagged with the   ``LIBC_INLINE``
```

(though it does mention implicitly inline functions):

```
 The ``LIBC_INLINE`` tag should also be added to functions which have
   definitions that are implicitly inline
```

I still kind of find the name misleading, maybe it should just avoid using `inline` which is already used for not-quite-the-same concept ?



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


More information about the llvm-commits mailing list