From 8910cc2742f95350809fd972dd847213c6c6a0f2 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Wed, 5 Jul 2023 17:42:39 +0000 Subject: [PATCH] [libc] Use the new style includes We should be using the standard includes. Differential Revision: https://reviews.llvm.org/D154529 --- libc/src/pthread/pthread_mutex_init.h | 2 +- libc/src/signal/linux/signal_utils.h | 2 +- libc/src/signal/linux/sigprocmask.cpp | 2 +- libc/src/signal/raise.h | 2 +- libc/src/signal/sigdelset.h | 2 +- libc/src/signal/sigemptyset.h | 2 +- libc/src/signal/sigfillset.h | 2 +- libc/src/signal/signal.h | 2 +- libc/src/signal/sigprocmask.h | 2 +- libc/src/threads/cnd_broadcast.h | 2 +- libc/src/threads/cnd_destroy.h | 2 +- libc/src/threads/cnd_init.h | 2 +- libc/src/threads/cnd_signal.h | 2 +- libc/src/threads/cnd_wait.h | 2 +- libc/src/threads/linux/CndVar.h | 4 ++-- libc/src/threads/mtx_destroy.cpp | 3 ++- libc/src/threads/mtx_destroy.h | 2 +- libc/src/threads/mtx_init.cpp | 3 ++- libc/src/threads/mtx_init.h | 2 +- libc/src/threads/mtx_lock.cpp | 3 ++- libc/src/threads/mtx_lock.h | 2 +- libc/src/threads/mtx_unlock.cpp | 3 ++- libc/src/threads/mtx_unlock.h | 2 +- libc/src/threads/thrd_current.h | 2 +- libc/src/threads/thrd_detach.h | 2 +- libc/src/threads/thrd_equal.h | 2 +- libc/src/threads/thrd_exit.h | 2 +- libc/src/threads/thrd_join.h | 2 +- libc/src/time/nanosleep.cpp | 3 ++- 29 files changed, 35 insertions(+), 30 deletions(-) diff --git a/libc/src/pthread/pthread_mutex_init.h b/libc/src/pthread/pthread_mutex_init.h index d25fe89..237ea18 100644 --- a/libc/src/pthread/pthread_mutex_init.h +++ b/libc/src/pthread/pthread_mutex_init.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_PTHREAD_PTHREAD_MUTEX_INIT_H #define LLVM_LIBC_SRC_PTHREAD_PTHREAD_MUTEX_INIT_H -#include "include/pthread.h" +#include namespace __llvm_libc { diff --git a/libc/src/signal/linux/signal_utils.h b/libc/src/signal/linux/signal_utils.h index ce8a07a..3e9e701 100644 --- a/libc/src/signal/linux/signal_utils.h +++ b/libc/src/signal/linux/signal_utils.h @@ -9,12 +9,12 @@ #ifndef LLVM_LIBC_SRC_SIGNAL_LINUX_SIGNAL_UTILS_H #define LLVM_LIBC_SRC_SIGNAL_LINUX_SIGNAL_UTILS_H -#include "include/sys/syscall.h" // For syscall numbers. #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "src/__support/common.h" #include #include +#include // For syscall numbers. namespace __llvm_libc { diff --git a/libc/src/signal/linux/sigprocmask.cpp b/libc/src/signal/linux/sigprocmask.cpp index c128197..242e055 100644 --- a/libc/src/signal/linux/sigprocmask.cpp +++ b/libc/src/signal/linux/sigprocmask.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include "src/signal/sigprocmask.h" -#include "include/sys/syscall.h" // For syscall numbers. #include "src/__support/OSUtil/syscall.h" // For internal syscall function. #include "src/errno/libc_errno.h" #include "src/signal/linux/signal_utils.h" @@ -15,6 +14,7 @@ #include "src/__support/common.h" #include +#include // For syscall numbers. namespace __llvm_libc { diff --git a/libc/src/signal/raise.h b/libc/src/signal/raise.h index 00fd4c8..624b93c 100644 --- a/libc/src/signal/raise.h +++ b/libc/src/signal/raise.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_SIGNAL_RAISE_H #define LLVM_LIBC_SRC_SIGNAL_RAISE_H -#include "include/signal.h" +#include namespace __llvm_libc { diff --git a/libc/src/signal/sigdelset.h b/libc/src/signal/sigdelset.h index a005d9c..2283bb5f 100644 --- a/libc/src/signal/sigdelset.h +++ b/libc/src/signal/sigdelset.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_SIGNAL_SIGDELSET_H #define LLVM_LIBC_SRC_SIGNAL_SIGDELSET_H -#include "include/signal.h" +#include namespace __llvm_libc { diff --git a/libc/src/signal/sigemptyset.h b/libc/src/signal/sigemptyset.h index 0651c73..bcb9c1a 100644 --- a/libc/src/signal/sigemptyset.h +++ b/libc/src/signal/sigemptyset.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_SIGNAL_SIGEMPTYSET_H #define LLVM_LIBC_SRC_SIGNAL_SIGEMPTYSET_H -#include "include/signal.h" +#include namespace __llvm_libc { diff --git a/libc/src/signal/sigfillset.h b/libc/src/signal/sigfillset.h index ed3612c..08a70a4 100644 --- a/libc/src/signal/sigfillset.h +++ b/libc/src/signal/sigfillset.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_SIGNAL_SIGFILLSET_H #define LLVM_LIBC_SRC_SIGNAL_SIGFILLSET_H -#include "include/signal.h" +#include namespace __llvm_libc { diff --git a/libc/src/signal/signal.h b/libc/src/signal/signal.h index 4315497..c45564c 100644 --- a/libc/src/signal/signal.h +++ b/libc/src/signal/signal.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_SIGNAL_SIGNAL_H #define LLVM_LIBC_SRC_SIGNAL_SIGNAL_H -#include "include/signal.h" +#include namespace __llvm_libc { diff --git a/libc/src/signal/sigprocmask.h b/libc/src/signal/sigprocmask.h index 353c0c8..490a16d 100644 --- a/libc/src/signal/sigprocmask.h +++ b/libc/src/signal/sigprocmask.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_SIGNAL_SIGPROCMASK_H #define LLVM_LIBC_SRC_SIGNAL_SIGPROCMASK_H -#include "include/signal.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/cnd_broadcast.h b/libc/src/threads/cnd_broadcast.h index 219341b..fd02195 100644 --- a/libc/src/threads/cnd_broadcast.h +++ b/libc/src/threads/cnd_broadcast.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_CND_BROADCAST_H #define LLVM_LIBC_SRC_THREADS_CND_BROADCAST_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/cnd_destroy.h b/libc/src/threads/cnd_destroy.h index 4fa1ea1..3400257 100644 --- a/libc/src/threads/cnd_destroy.h +++ b/libc/src/threads/cnd_destroy.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_CND_DESTROY_H #define LLVM_LIBC_SRC_THREADS_CND_DESTROY_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/cnd_init.h b/libc/src/threads/cnd_init.h index 8c14c88..826564b 100644 --- a/libc/src/threads/cnd_init.h +++ b/libc/src/threads/cnd_init.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_CND_INIT_H #define LLVM_LIBC_SRC_THREADS_CND_INIT_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/cnd_signal.h b/libc/src/threads/cnd_signal.h index d85802d..ec2a977 100644 --- a/libc/src/threads/cnd_signal.h +++ b/libc/src/threads/cnd_signal.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_CND_SIGNAL_H #define LLVM_LIBC_SRC_THREADS_CND_SIGNAL_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/cnd_wait.h b/libc/src/threads/cnd_wait.h index 5f9ac08..812e704 100644 --- a/libc/src/threads/cnd_wait.h +++ b/libc/src/threads/cnd_wait.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_CND_WAIT_H #define LLVM_LIBC_SRC_THREADS_CND_WAIT_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/linux/CndVar.h b/libc/src/threads/linux/CndVar.h index c526277..c6b0ea6 100644 --- a/libc/src/threads/linux/CndVar.h +++ b/libc/src/threads/linux/CndVar.h @@ -9,8 +9,6 @@ #ifndef LLVM_LIBC_SRC_THREADS_LINUX_CNDVAR_H #define LLVM_LIBC_SRC_THREADS_LINUX_CNDVAR_H -#include "include/sys/syscall.h" // For syscall numbers. -#include "include/threads.h" // For values like thrd_success etc. #include "src/__support/CPP/atomic.h" #include "src/__support/OSUtil/syscall.h" // For syscall functions. #include "src/__support/threads/linux/futex_word.h" @@ -18,6 +16,8 @@ #include // For futex operations. #include +#include // For syscall numbers. +#include // For values like thrd_success etc. namespace __llvm_libc { diff --git a/libc/src/threads/mtx_destroy.cpp b/libc/src/threads/mtx_destroy.cpp index 6285b2c..6432700 100644 --- a/libc/src/threads/mtx_destroy.cpp +++ b/libc/src/threads/mtx_destroy.cpp @@ -7,10 +7,11 @@ //===----------------------------------------------------------------------===// #include "src/threads/mtx_destroy.h" -#include "include/threads.h" // For mtx_t definition. #include "src/__support/common.h" #include "src/__support/threads/mutex.h" +#include // For mtx_t definition. + namespace __llvm_libc { LLVM_LIBC_FUNCTION(void, mtx_destroy, (mtx_t *)) {} diff --git a/libc/src/threads/mtx_destroy.h b/libc/src/threads/mtx_destroy.h index c123b81..353bc27 100644 --- a/libc/src/threads/mtx_destroy.h +++ b/libc/src/threads/mtx_destroy.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_MTX_DESTROY_H #define LLVM_LIBC_SRC_THREADS_MTX_DESTROY_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/mtx_init.cpp b/libc/src/threads/mtx_init.cpp index 1e4da79..188209c 100644 --- a/libc/src/threads/mtx_init.cpp +++ b/libc/src/threads/mtx_init.cpp @@ -7,10 +7,11 @@ //===----------------------------------------------------------------------===// #include "src/threads/mtx_init.h" -#include "include/threads.h" // For mtx_t definition. #include "src/__support/common.h" #include "src/__support/threads/mutex.h" +#include // For mtx_t definition. + namespace __llvm_libc { static_assert(sizeof(Mutex) <= sizeof(mtx_t), diff --git a/libc/src/threads/mtx_init.h b/libc/src/threads/mtx_init.h index 7eed5ec..8fcaa42 100644 --- a/libc/src/threads/mtx_init.h +++ b/libc/src/threads/mtx_init.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_MTX_INIT_H #define LLVM_LIBC_SRC_THREADS_MTX_INIT_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/mtx_lock.cpp b/libc/src/threads/mtx_lock.cpp index 9200fed..58379f6 100644 --- a/libc/src/threads/mtx_lock.cpp +++ b/libc/src/threads/mtx_lock.cpp @@ -7,10 +7,11 @@ //===----------------------------------------------------------------------===// #include "src/threads/mtx_lock.h" -#include "include/threads.h" // For mtx_t definition. #include "src/__support/common.h" #include "src/__support/threads/mutex.h" +#include // For mtx_t definition. + namespace __llvm_libc { // The implementation currently handles only plain mutexes. diff --git a/libc/src/threads/mtx_lock.h b/libc/src/threads/mtx_lock.h index 5086f77..df3ec0d 100644 --- a/libc/src/threads/mtx_lock.h +++ b/libc/src/threads/mtx_lock.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_MTX_LOCK_H #define LLVM_LIBC_SRC_THREADS_MTX_LOCK_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/mtx_unlock.cpp b/libc/src/threads/mtx_unlock.cpp index 1b97121..f5c6a13 100644 --- a/libc/src/threads/mtx_unlock.cpp +++ b/libc/src/threads/mtx_unlock.cpp @@ -7,10 +7,11 @@ //===----------------------------------------------------------------------===// #include "src/threads/mtx_unlock.h" -#include "include/threads.h" // For mtx_t definition. #include "src/__support/common.h" #include "src/__support/threads/mutex.h" +#include // For mtx_t definition. + namespace __llvm_libc { // The implementation currently handles only plain mutexes. diff --git a/libc/src/threads/mtx_unlock.h b/libc/src/threads/mtx_unlock.h index 55f0b4a..b58df63 100644 --- a/libc/src/threads/mtx_unlock.h +++ b/libc/src/threads/mtx_unlock.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_MTX_UNLOCK_H #define LLVM_LIBC_SRC_THREADS_MTX_UNLOCK_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/thrd_current.h b/libc/src/threads/thrd_current.h index 774b445..338a16d 100644 --- a/libc/src/threads/thrd_current.h +++ b/libc/src/threads/thrd_current.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_THRD_CURRENT_H #define LLVM_LIBC_SRC_THREADS_THRD_CURRENT_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/thrd_detach.h b/libc/src/threads/thrd_detach.h index 176770d..58d36e8 100644 --- a/libc/src/threads/thrd_detach.h +++ b/libc/src/threads/thrd_detach.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_THRD_DETACH_H #define LLVM_LIBC_SRC_THREADS_THRD_DETACH_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/thrd_equal.h b/libc/src/threads/thrd_equal.h index 123563e..9e1bebc 100644 --- a/libc/src/threads/thrd_equal.h +++ b/libc/src/threads/thrd_equal.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_THRD_EQUAL_H #define LLVM_LIBC_SRC_THREADS_THRD_EQUAL_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/thrd_exit.h b/libc/src/threads/thrd_exit.h index feed470..4cc8351 100644 --- a/libc/src/threads/thrd_exit.h +++ b/libc/src/threads/thrd_exit.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_THRD_EXIT_H #define LLVM_LIBC_SRC_THREADS_THRD_EXIT_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/threads/thrd_join.h b/libc/src/threads/thrd_join.h index 248bced..d86529c 100644 --- a/libc/src/threads/thrd_join.h +++ b/libc/src/threads/thrd_join.h @@ -9,7 +9,7 @@ #ifndef LLVM_LIBC_SRC_THREADS_THRD_JOIN_H #define LLVM_LIBC_SRC_THREADS_THRD_JOIN_H -#include "include/threads.h" +#include namespace __llvm_libc { diff --git a/libc/src/time/nanosleep.cpp b/libc/src/time/nanosleep.cpp index f0458de..bd81269 100644 --- a/libc/src/time/nanosleep.cpp +++ b/libc/src/time/nanosleep.cpp @@ -8,11 +8,12 @@ #include "src/time/nanosleep.h" -#include "include/sys/syscall.h" // For syscall numbers. #include "src/__support/OSUtil/syscall.h" // For syscall functions. #include "src/__support/common.h" #include "src/errno/libc_errno.h" +#include // For syscall numbers. + namespace __llvm_libc { // TODO(michaelrj): Move this into time/linux with the other syscalls. -- 2.7.4