Skip to content

Commit 255e634

Browse files
committed
[libc][NFC] Ensure internal implementation is in __llvm_libc namespace
Summary: In preparation for D76818. Reviewers: PaulkaToast, sivachandra, gchatelet Reviewed By: PaulkaToast, sivachandra Subscribers: MaskRay, tschuett, libc-commits Differential Revision: https://reviews.llvm.org/D76967
1 parent f0a5af9 commit 255e634

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

libc/src/signal/linux/__restore.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
#include "config/linux/syscall.h"
1414
#include "include/sys/syscall.h"
1515

16+
namespace __llvm_libc {
17+
1618
extern "C" void __restore_rt()
1719
__attribute__((no_sanitize("thread", "memory", "undefined", "fuzzer"),
1820
hidden));
1921

2022
extern "C" void __restore_rt() { __llvm_libc::syscall(SYS_rt_sigreturn); }
23+
24+
} // namespace __llvm_libc

libc/src/string/memory_utils/memcpy_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
#define USE_BUILTIN_MEMCPY
2121
#endif
2222

23+
namespace __llvm_libc {
24+
2325
// This is useful for testing.
2426
#if defined(LLVM_LIBC_MEMCPY_MONITOR)
2527
extern "C" void LLVM_LIBC_MEMCPY_MONITOR(char *__restrict,
2628
const char *__restrict, size_t);
2729
#endif
2830

29-
namespace __llvm_libc {
30-
3131
// Copies `kBlockSize` bytes from `src` to `dst`.
3232
template <size_t kBlockSize>
3333
static void Copy(char *__restrict dst, const char *__restrict src) {

libc/src/threads/linux/thread_utils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include <stdatomic.h>
1515
#include <stdint.h>
1616

17+
namespace __llvm_libc {
18+
1719
// The futex data has to be exactly 4 bytes long. However, we use a uint type
1820
// here as we do not want to use `_Atomic uint32_t` as the _Atomic keyword which
1921
// is C only. The header stdatomic.h does not define an atomic type
@@ -35,4 +37,6 @@ struct ThreadParams {
3537
static constexpr uint32_t ClearTIDValue = 0xABCD1234;
3638
};
3739

40+
} // namespace __llvm_libc
41+
3842
#endif // LLVM_LIBC_SRC_THREADS_LINUX_THREAD_UTILS_H

0 commit comments

Comments
 (0)