[libc-commits] [libc] [libc] Make BigInt bit_cast-able to compatible types (PR #75063)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Fri Dec 15 02:52:53 PST 2023


================
@@ -25,6 +25,27 @@ namespace LIBC_NAMESPACE::cpp {
 #define LLVM_LIBC_HAS_BUILTIN_MEMCPY_INLINE
 #endif
 
+// Performs a copy from 'src' to 'dst' of 'size' bytes.
+// The semantics is valid if 'src' and 'dst' are equal but undefined if the
+// regions defined by [src, src + size] and [dst, dst + size] overlap.
+template <size_t size, typename DstT, typename SrcT>
+LIBC_INLINE constexpr void memcpy_inline(DstT *__restrict dst,
----------------
gchatelet wrote:

We definitely need this function to implement the `memcpy` function. It was previously only defined in `libc/src/string/memory_utils/utils.h` but it's needed elsewhere now so I made it globally available in this header. It might not be the best place for it especially since it's not an official std function but I don't have a good home for it now. Do you have a suggestion? We can also leave it here, I don't think it hurts.

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


More information about the libc-commits mailing list