[libc-commits] [libc] 8910cc2 - [libc] Use the new style includes

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Wed Jul 5 10:51:56 PDT 2023


Author: Petr Hosek
Date: 2023-07-05T17:51:41Z
New Revision: 8910cc2742f95350809fd972dd847213c6c6a0f2

URL: https://github.com/llvm/llvm-project/commit/8910cc2742f95350809fd972dd847213c6c6a0f2
DIFF: https://github.com/llvm/llvm-project/commit/8910cc2742f95350809fd972dd847213c6c6a0f2.diff

LOG: [libc] Use the new style includes

We should be using the standard includes.

Differential Revision: https://reviews.llvm.org/D154529

Added: 
    

Modified: 
    libc/src/pthread/pthread_mutex_init.h
    libc/src/signal/linux/signal_utils.h
    libc/src/signal/linux/sigprocmask.cpp
    libc/src/signal/raise.h
    libc/src/signal/sigdelset.h
    libc/src/signal/sigemptyset.h
    libc/src/signal/sigfillset.h
    libc/src/signal/signal.h
    libc/src/signal/sigprocmask.h
    libc/src/threads/cnd_broadcast.h
    libc/src/threads/cnd_destroy.h
    libc/src/threads/cnd_init.h
    libc/src/threads/cnd_signal.h
    libc/src/threads/cnd_wait.h
    libc/src/threads/linux/CndVar.h
    libc/src/threads/mtx_destroy.cpp
    libc/src/threads/mtx_destroy.h
    libc/src/threads/mtx_init.cpp
    libc/src/threads/mtx_init.h
    libc/src/threads/mtx_lock.cpp
    libc/src/threads/mtx_lock.h
    libc/src/threads/mtx_unlock.cpp
    libc/src/threads/mtx_unlock.h
    libc/src/threads/thrd_current.h
    libc/src/threads/thrd_detach.h
    libc/src/threads/thrd_equal.h
    libc/src/threads/thrd_exit.h
    libc/src/threads/thrd_join.h
    libc/src/time/nanosleep.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/pthread/pthread_mutex_init.h b/libc/src/pthread/pthread_mutex_init.h
index d25fe8968cd63a..237ea183b8c6a4 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 <pthread.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/linux/signal_utils.h b/libc/src/signal/linux/signal_utils.h
index ce8a07a8a8b5f1..3e9e70140ba37f 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 <signal.h>
 #include <stddef.h>
+#include <sys/syscall.h>          // For syscall numbers.
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/linux/sigprocmask.cpp b/libc/src/signal/linux/sigprocmask.cpp
index c128197e736b32..242e05530094cc 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 <signal.h>
+#include <sys/syscall.h> // For syscall numbers.
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/raise.h b/libc/src/signal/raise.h
index 00fd4c8fbda999..624b93c97b6109 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 <signal.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/sigdelset.h b/libc/src/signal/sigdelset.h
index a005d9c0aa138e..2283bb5fa701c2 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 <signal.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/sigemptyset.h b/libc/src/signal/sigemptyset.h
index 0651c7302f9927..bcb9c1a994e0a0 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 <signal.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/sigfillset.h b/libc/src/signal/sigfillset.h
index ed3612ce4ed5a6..08a70a40afc767 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 <signal.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/signal.h b/libc/src/signal/signal.h
index 4315497e2cf8c1..c45564cf9e4662 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 <signal.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/signal/sigprocmask.h b/libc/src/signal/sigprocmask.h
index 353c0c84b38a12..490a16df7d6ff5 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 <signal.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/cnd_broadcast.h b/libc/src/threads/cnd_broadcast.h
index 219341bc44981b..fd021956b7f664 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/cnd_destroy.h b/libc/src/threads/cnd_destroy.h
index 4fa1ea18b5e295..3400257529e38e 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/cnd_init.h b/libc/src/threads/cnd_init.h
index 8c14c88342e37e..826564b0498634 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/cnd_signal.h b/libc/src/threads/cnd_signal.h
index d85802dda4845d..ec2a9772199770 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/cnd_wait.h b/libc/src/threads/cnd_wait.h
index 5f9ac088467670..812e70425060f7 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/linux/CndVar.h b/libc/src/threads/linux/CndVar.h
index c526277d62c7df..c6b0ea63280a42 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 <linux/futex.h> // For futex operations.
 #include <stdint.h>
+#include <sys/syscall.h> // For syscall numbers.
+#include <threads.h>     // 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 6285b2c60a2d36..64327003bfc585 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 <threads.h> // 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 c123b814789fb4..353bc27453bacb 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/mtx_init.cpp b/libc/src/threads/mtx_init.cpp
index 1e4da794f6369d..188209c9d37184 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 <threads.h> // 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 7eed5ece6d5e73..8fcaa42a2307d1 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/mtx_lock.cpp b/libc/src/threads/mtx_lock.cpp
index 9200fedb2a37fe..58379f6f9d0fd9 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 <threads.h> // 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 5086f773f0fe60..df3ec0dccbdb72 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/mtx_unlock.cpp b/libc/src/threads/mtx_unlock.cpp
index 1b971215129cc0..f5c6a136d9dba1 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 <threads.h> // 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 55f0b4a7a6655c..b58df6392265e4 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/thrd_current.h b/libc/src/threads/thrd_current.h
index 774b445aa339b8..338a16dc56e9d4 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/thrd_detach.h b/libc/src/threads/thrd_detach.h
index 176770d59986ea..58d36e86380adf 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/thrd_equal.h b/libc/src/threads/thrd_equal.h
index 123563ea712479..9e1bebc0afe5e6 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/thrd_exit.h b/libc/src/threads/thrd_exit.h
index feed4701254c65..4cc835118a8523 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/threads/thrd_join.h b/libc/src/threads/thrd_join.h
index 248bced10263ac..d86529c8cb9759 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 <threads.h>
 
 namespace __llvm_libc {
 

diff  --git a/libc/src/time/nanosleep.cpp b/libc/src/time/nanosleep.cpp
index f0458de2d1a856..bd812692917c95 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 <sys/syscall.h> // For syscall numbers.
+
 namespace __llvm_libc {
 
 // TODO(michaelrj): Move this into time/linux with the other syscalls.


        


More information about the libc-commits mailing list