Skip to content

[libc] Use relative inclusion for public headers. #114324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 1, 2024
Merged

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Oct 30, 2024

We are finalizing the header inclusion policy, and for our public headers in the libc/include folder, they must use relative path in "..." when including each other.

This PR does the cleanup making sure that all the public header inclusions in libc/include folder use relative paths.

@llvmbot llvmbot added the libc label Oct 30, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 30, 2024

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Patch is 22.01 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/114324.diff

47 Files Affected:

  • (modified) libc/include/gpu/rpc.h.def (+1-1)
  • (modified) libc/include/llvm-libc-macros/containerof-macro.h (+1-1)
  • (modified) libc/include/llvm-libc-macros/sys-queue-macros.h (+2-2)
  • (modified) libc/include/llvm-libc-types/__mutex_type.h (+1-1)
  • (modified) libc/include/llvm-libc-types/cnd_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/cookie_io_functions_t.h (+3-3)
  • (modified) libc/include/llvm-libc-types/fd_set.h (+1-1)
  • (modified) libc/include/llvm-libc-types/mtx_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/once_flag.h (+1-1)
  • (modified) libc/include/llvm-libc-types/pthread_attr_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/pthread_mutex_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/pthread_once_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/pthread_rwlock_t.h (+2-2)
  • (modified) libc/include/llvm-libc-types/pthread_spinlock_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/pthread_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/siginfo_t.h (+4-4)
  • (modified) libc/include/llvm-libc-types/sigset_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/stack_t.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_dirent.h (+2-2)
  • (modified) libc/include/llvm-libc-types/struct_epoll_event.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_f_owner_ex.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_flock.h (+2-2)
  • (modified) libc/include/llvm-libc-types/struct_flock64.h (+2-2)
  • (modified) libc/include/llvm-libc-types/struct_rlimit.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_rusage.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_sched_param.h (+3-3)
  • (modified) libc/include/llvm-libc-types/struct_sigaction.h (+2-2)
  • (modified) libc/include/llvm-libc-types/struct_sockaddr.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_sockaddr_un.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_stat.h (+10-10)
  • (modified) libc/include/llvm-libc-types/struct_termios.h (+3-3)
  • (modified) libc/include/llvm-libc-types/struct_timespec.h (+1-1)
  • (modified) libc/include/llvm-libc-types/struct_timeval.h (+2-2)
  • (modified) libc/include/llvm-libc-types/thrd_t.h (+1-1)
  • (modified) libc/include/sys/auxv.h.def (+1-1)
  • (modified) libc/include/sys/epoll.h.def (+1-1)
  • (modified) libc/include/sys/ioctl.h.def (+1-1)
  • (modified) libc/include/sys/mman.h.def (+1-1)
  • (modified) libc/include/sys/queue.h (+1-1)
  • (modified) libc/include/sys/random.h.def (+1-1)
  • (modified) libc/include/sys/resource.h.def (+1-1)
  • (modified) libc/include/sys/select.h.def (+1-1)
  • (modified) libc/include/sys/socket.h.def (+1-1)
  • (modified) libc/include/sys/stat.h.def (+1-1)
  • (modified) libc/include/sys/time.h.def (+2-2)
  • (modified) libc/include/sys/wait.h.def (+1-1)
  • (modified) libc/utils/gpu/loader/Loader.h (+1-1)
diff --git a/libc/include/gpu/rpc.h.def b/libc/include/gpu/rpc.h.def
index 72acf0c8142281..060650345e1fb1 100644
--- a/libc/include/gpu/rpc.h.def
+++ b/libc/include/gpu/rpc.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-types/rpc_opcodes_t.h"
+#include "../llvm-libc-types/rpc_opcodes_t.h"
 
 %%public_api()
 
diff --git a/libc/include/llvm-libc-macros/containerof-macro.h b/libc/include/llvm-libc-macros/containerof-macro.h
index 592acd6e3aa98c..debf441bf845e3 100644
--- a/libc/include/llvm-libc-macros/containerof-macro.h
+++ b/libc/include/llvm-libc-macros/containerof-macro.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_MACROS_CONTAINEROF_MACRO_H
 #define LLVM_LIBC_MACROS_CONTAINEROF_MACRO_H
 
-#include "llvm-libc-macros/offsetof-macro.h"
+#include "offsetof-macro.h"
 
 #define __containerof(ptr, type, member)                                       \
   ({                                                                           \
diff --git a/libc/include/llvm-libc-macros/sys-queue-macros.h b/libc/include/llvm-libc-macros/sys-queue-macros.h
index 089b6abaa02409..21e80f42a91db9 100644
--- a/libc/include/llvm-libc-macros/sys-queue-macros.h
+++ b/libc/include/llvm-libc-macros/sys-queue-macros.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_MACROS_SYS_QUEUE_MACROS_H
 #define LLVM_LIBC_MACROS_SYS_QUEUE_MACROS_H
 
-#include "llvm-libc-macros/containerof-macro.h"
-#include "llvm-libc-macros/null-macro.h"
+#include "containerof-macro.h"
+#include "null-macro.h"
 
 #ifdef __cplusplus
 #define QUEUE_TYPEOF(type) type
diff --git a/libc/include/llvm-libc-types/__mutex_type.h b/libc/include/llvm-libc-types/__mutex_type.h
index 3779c78203ed8a..83556162614958 100644
--- a/libc/include/llvm-libc-types/__mutex_type.h
+++ b/libc/include/llvm-libc-types/__mutex_type.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES___MUTEX_TYPE_H
 #define LLVM_LIBC_TYPES___MUTEX_TYPE_H
 
-#include "llvm-libc-types/__futex_word.h"
+#include "__futex_word.h"
 
 typedef struct {
   unsigned char __timed;
diff --git a/libc/include/llvm-libc-types/cnd_t.h b/libc/include/llvm-libc-types/cnd_t.h
index 266dfbb5889268..77ec58352f074e 100644
--- a/libc/include/llvm-libc-types/cnd_t.h
+++ b/libc/include/llvm-libc-types/cnd_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_CND_T_H
 #define LLVM_LIBC_TYPES_CND_T_H
 
-#include "llvm-libc-types/__futex_word.h"
+#include "__futex_word.h"
 
 typedef struct {
   void *__qfront;
diff --git a/libc/include/llvm-libc-types/cookie_io_functions_t.h b/libc/include/llvm-libc-types/cookie_io_functions_t.h
index a3e7c32a50966a..d1eea8ff3b5dc7 100644
--- a/libc/include/llvm-libc-types/cookie_io_functions_t.h
+++ b/libc/include/llvm-libc-types/cookie_io_functions_t.h
@@ -9,9 +9,9 @@
 #ifndef LLVM_LIBC_TYPES_COOKIE_IO_FUNCTIONS_T_H
 #define LLVM_LIBC_TYPES_COOKIE_IO_FUNCTIONS_T_H
 
-#include "llvm-libc-types/off64_t.h"
-#include "llvm-libc-types/size_t.h"
-#include "llvm-libc-types/ssize_t.h"
+#include "off64_t.h"
+#include "size_t.h"
+#include "ssize_t.h"
 
 typedef ssize_t cookie_read_function_t(void *, char *, size_t);
 typedef ssize_t cookie_write_function_t(void *, const char *, size_t);
diff --git a/libc/include/llvm-libc-types/fd_set.h b/libc/include/llvm-libc-types/fd_set.h
index fd1bde24c90e8d..7835a916712a0b 100644
--- a/libc/include/llvm-libc-types/fd_set.h
+++ b/libc/include/llvm-libc-types/fd_set.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_FD_SET_H
 #define LLVM_LIBC_TYPES_FD_SET_H
 
-#include "llvm-libc-macros/sys-select-macros.h" // FD_SETSIZE
+#include "../llvm-libc-macros/sys-select-macros.h" // FD_SETSIZE
 
 typedef struct {
   __FD_SET_WORD_TYPE __set[__FD_SET_ARRAYSIZE];
diff --git a/libc/include/llvm-libc-types/mtx_t.h b/libc/include/llvm-libc-types/mtx_t.h
index ebf79871c93575..56e41bdf89bce5 100644
--- a/libc/include/llvm-libc-types/mtx_t.h
+++ b/libc/include/llvm-libc-types/mtx_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_MTX_T_H
 #define LLVM_LIBC_TYPES_MTX_T_H
 
-#include "llvm-libc-types/__mutex_type.h"
+#include "__mutex_type.h"
 
 typedef __mutex_type mtx_t;
 
diff --git a/libc/include/llvm-libc-types/once_flag.h b/libc/include/llvm-libc-types/once_flag.h
index f80d35e317e99a..b3b7e0de988ca2 100644
--- a/libc/include/llvm-libc-types/once_flag.h
+++ b/libc/include/llvm-libc-types/once_flag.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_ONCE_FLAG_H
 #define LLVM_LIBC_TYPES_ONCE_FLAG_H
 
-#include "llvm-libc-types/__futex_word.h"
+#include "__futex_word.h"
 
 #ifdef __linux__
 typedef __futex_word once_flag;
diff --git a/libc/include/llvm-libc-types/pthread_attr_t.h b/libc/include/llvm-libc-types/pthread_attr_t.h
index 7512193ef97be2..e686ac91a6fe58 100644
--- a/libc/include/llvm-libc-types/pthread_attr_t.h
+++ b/libc/include/llvm-libc-types/pthread_attr_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_PTHREAD_ATTR_T_H
 #define LLVM_LIBC_TYPES_PTHREAD_ATTR_T_H
 
-#include "llvm-libc-types/size_t.h"
+#include "size_t.h"
 
 typedef struct {
   int __detachstate;
diff --git a/libc/include/llvm-libc-types/pthread_mutex_t.h b/libc/include/llvm-libc-types/pthread_mutex_t.h
index cf2194d719f354..1535cba658350e 100644
--- a/libc/include/llvm-libc-types/pthread_mutex_t.h
+++ b/libc/include/llvm-libc-types/pthread_mutex_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_PTHREAD_MUTEX_T_H
 #define LLVM_LIBC_TYPES_PTHREAD_MUTEX_T_H
 
-#include "llvm-libc-types/__mutex_type.h"
+#include "__mutex_type.h"
 
 typedef __mutex_type pthread_mutex_t;
 
diff --git a/libc/include/llvm-libc-types/pthread_once_t.h b/libc/include/llvm-libc-types/pthread_once_t.h
index 8ea926f4ee7dc4..12a81502baaf04 100644
--- a/libc/include/llvm-libc-types/pthread_once_t.h
+++ b/libc/include/llvm-libc-types/pthread_once_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_PTHREAD_ONCE_T_H
 #define LLVM_LIBC_TYPES_PTHREAD_ONCE_T_H
 
-#include "llvm-libc-types/__futex_word.h"
+#include "__futex_word.h"
 
 #ifdef __linux__
 typedef __futex_word pthread_once_t;
diff --git a/libc/include/llvm-libc-types/pthread_rwlock_t.h b/libc/include/llvm-libc-types/pthread_rwlock_t.h
index da49a155a2bdb0..4a7c6c75250a82 100644
--- a/libc/include/llvm-libc-types/pthread_rwlock_t.h
+++ b/libc/include/llvm-libc-types/pthread_rwlock_t.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_TYPES_PTHREAD_RWLOCK_T_H
 #define LLVM_LIBC_TYPES_PTHREAD_RWLOCK_T_H
 
-#include "llvm-libc-types/__futex_word.h"
-#include "llvm-libc-types/pid_t.h"
+#include "__futex_word.h"
+#include "pid_t.h"
 typedef struct {
   unsigned __is_pshared : 1;
   unsigned __preference : 1;
diff --git a/libc/include/llvm-libc-types/pthread_spinlock_t.h b/libc/include/llvm-libc-types/pthread_spinlock_t.h
index 03eb02dded9eff..afb4fe91edd2be 100644
--- a/libc/include/llvm-libc-types/pthread_spinlock_t.h
+++ b/libc/include/llvm-libc-types/pthread_spinlock_t.h
@@ -8,7 +8,7 @@
 
 #ifndef LLVM_LIBC_TYPES_PTHREAD_SPINLOCK_T_H
 #define LLVM_LIBC_TYPES_PTHREAD_SPINLOCK_T_H
-#include "llvm-libc-types/pid_t.h"
+#include "pid_t.h"
 typedef struct {
   unsigned char __lockword;
   pid_t __owner;
diff --git a/libc/include/llvm-libc-types/pthread_t.h b/libc/include/llvm-libc-types/pthread_t.h
index 63cc0d7dd74cb4..f64887b25225ff 100644
--- a/libc/include/llvm-libc-types/pthread_t.h
+++ b/libc/include/llvm-libc-types/pthread_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_PTHREAD_T_H
 #define LLVM_LIBC_TYPES_PTHREAD_T_H
 
-#include "llvm-libc-types/__thread_type.h"
+#include "__thread_type.h"
 
 typedef __thread_type pthread_t;
 
diff --git a/libc/include/llvm-libc-types/siginfo_t.h b/libc/include/llvm-libc-types/siginfo_t.h
index dafe9c1b5f8ebf..20fdd461bb6df6 100644
--- a/libc/include/llvm-libc-types/siginfo_t.h
+++ b/libc/include/llvm-libc-types/siginfo_t.h
@@ -9,10 +9,10 @@
 #ifndef LLVM_LIBC_TYPES_SIGINFO_T_H
 #define LLVM_LIBC_TYPES_SIGINFO_T_H
 
-#include "llvm-libc-types/clock_t.h"
-#include "llvm-libc-types/pid_t.h"
-#include "llvm-libc-types/uid_t.h"
-#include "llvm-libc-types/union_sigval.h"
+#include "clock_t.h"
+#include "pid_t.h"
+#include "uid_t.h"
+#include "union_sigval.h"
 
 #define SI_MAX_SIZE 128
 
diff --git a/libc/include/llvm-libc-types/sigset_t.h b/libc/include/llvm-libc-types/sigset_t.h
index 5c3e4e6f0431bd..600e9a1cf0456d 100644
--- a/libc/include/llvm-libc-types/sigset_t.h
+++ b/libc/include/llvm-libc-types/sigset_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_SIGSET_T_H
 #define LLVM_LIBC_TYPES_SIGSET_T_H
 
-#include "llvm-libc-macros/signal-macros.h"
+#include "../llvm-libc-macros/signal-macros.h"
 
 // This definition can be adjusted/specialized for different targets and
 // platforms as necessary. This definition works for Linux on most targets.
diff --git a/libc/include/llvm-libc-types/stack_t.h b/libc/include/llvm-libc-types/stack_t.h
index 9156425436e948..92d03058716802 100644
--- a/libc/include/llvm-libc-types/stack_t.h
+++ b/libc/include/llvm-libc-types/stack_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STACK_T_H
 #define LLVM_LIBC_TYPES_STACK_T_H
 
-#include "llvm-libc-types/size_t.h"
+#include "size_t.h"
 
 typedef struct {
   // The order of the fields declared here should match the kernel definition
diff --git a/libc/include/llvm-libc-types/struct_dirent.h b/libc/include/llvm-libc-types/struct_dirent.h
index 0bb71b9f3b84c5..f950869fc77dd1 100644
--- a/libc/include/llvm-libc-types/struct_dirent.h
+++ b/libc/include/llvm-libc-types/struct_dirent.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_DIRENT_H
 #define LLVM_LIBC_TYPES_STRUCT_DIRENT_H
 
-#include "llvm-libc-types/ino_t.h"
-#include "llvm-libc-types/off_t.h"
+#include "ino_t.h"
+#include "off_t.h"
 
 struct dirent {
   ino_t d_ino;
diff --git a/libc/include/llvm-libc-types/struct_epoll_event.h b/libc/include/llvm-libc-types/struct_epoll_event.h
index b7685df20bd7ee..f95fd1a92bc8ef 100644
--- a/libc/include/llvm-libc-types/struct_epoll_event.h
+++ b/libc/include/llvm-libc-types/struct_epoll_event.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_EPOLL_EVENT_H
 #define LLVM_LIBC_TYPES_STRUCT_EPOLL_EVENT_H
 
-#include "llvm-libc-types/struct_epoll_data.h"
+#include "struct_epoll_data.h"
 
 typedef struct
 #ifdef __x86_64__
diff --git a/libc/include/llvm-libc-types/struct_f_owner_ex.h b/libc/include/llvm-libc-types/struct_f_owner_ex.h
index c9cc85f69d2b45..87d4b8988178f4 100644
--- a/libc/include/llvm-libc-types/struct_f_owner_ex.h
+++ b/libc/include/llvm-libc-types/struct_f_owner_ex.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_F_OWNER_EX_H
 #define LLVM_LIBC_TYPES_STRUCT_F_OWNER_EX_H
 
-#include "llvm-libc-types/pid_t.h"
+#include "pid_t.h"
 
 enum pid_type {
   F_OWNER_TID = 0,
diff --git a/libc/include/llvm-libc-types/struct_flock.h b/libc/include/llvm-libc-types/struct_flock.h
index 51c9d27640ea1a..d4bde09045e83c 100644
--- a/libc/include/llvm-libc-types/struct_flock.h
+++ b/libc/include/llvm-libc-types/struct_flock.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_FLOCK_H
 #define LLVM_LIBC_TYPES_STRUCT_FLOCK_H
 
-#include "llvm-libc-types/off_t.h"
-#include "llvm-libc-types/pid_t.h"
+#include "off_t.h"
+#include "pid_t.h"
 
 #include <stdint.h>
 
diff --git a/libc/include/llvm-libc-types/struct_flock64.h b/libc/include/llvm-libc-types/struct_flock64.h
index ac50003ca62f60..8e485d73773848 100644
--- a/libc/include/llvm-libc-types/struct_flock64.h
+++ b/libc/include/llvm-libc-types/struct_flock64.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_FLOCK64_H
 #define LLVM_LIBC_TYPES_STRUCT_FLOCK64_H
 
-#include "llvm-libc-types/off64_t.h"
-#include "llvm-libc-types/pid_t.h"
+#include "off64_t.h"
+#include "pid_t.h"
 
 #include <stdint.h>
 
diff --git a/libc/include/llvm-libc-types/struct_rlimit.h b/libc/include/llvm-libc-types/struct_rlimit.h
index 11e6bee15f9d64..15d8c0e16a640a 100644
--- a/libc/include/llvm-libc-types/struct_rlimit.h
+++ b/libc/include/llvm-libc-types/struct_rlimit.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_RLIMIT_H
 #define LLVM_LIBC_TYPES_STRUCT_RLIMIT_H
 
-#include "llvm-libc-types/rlim_t.h"
+#include "rlim_t.h"
 
 struct rlimit {
   rlim_t rlim_cur;
diff --git a/libc/include/llvm-libc-types/struct_rusage.h b/libc/include/llvm-libc-types/struct_rusage.h
index ed838d30ede3d3..59fe9f7c1d2bc5 100644
--- a/libc/include/llvm-libc-types/struct_rusage.h
+++ b/libc/include/llvm-libc-types/struct_rusage.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_RUSAGE_H
 #define LLVM_LIBC_TYPES_STRUCT_RUSAGE_H
 
-#include "llvm-libc-types/struct_timeval.h"
+#include "struct_timeval.h"
 
 struct rusage {
   struct timeval ru_utime;
diff --git a/libc/include/llvm-libc-types/struct_sched_param.h b/libc/include/llvm-libc-types/struct_sched_param.h
index 86209ac3a1816c..e44a00bc0e87ab 100644
--- a/libc/include/llvm-libc-types/struct_sched_param.h
+++ b/libc/include/llvm-libc-types/struct_sched_param.h
@@ -9,9 +9,9 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_SCHED_PARAM_H
 #define LLVM_LIBC_TYPES_STRUCT_SCHED_PARAM_H
 
-#include "llvm-libc-types/pid_t.h"
-#include "llvm-libc-types/struct_timespec.h"
-#include "llvm-libc-types/time_t.h"
+#include "pid_t.h"
+#include "struct_timespec.h"
+#include "time_t.h"
 
 struct sched_param {
   // Process or thread execution scheduling priority.
diff --git a/libc/include/llvm-libc-types/struct_sigaction.h b/libc/include/llvm-libc-types/struct_sigaction.h
index 945354105f4938..4257cfecd643a4 100644
--- a/libc/include/llvm-libc-types/struct_sigaction.h
+++ b/libc/include/llvm-libc-types/struct_sigaction.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_SIGACTION_H
 #define LLVM_LIBC_TYPES_STRUCT_SIGACTION_H
 
-#include "llvm-libc-types/siginfo_t.h"
-#include "llvm-libc-types/sigset_t.h"
+#include "siginfo_t.h"
+#include "sigset_t.h"
 
 struct sigaction {
   union {
diff --git a/libc/include/llvm-libc-types/struct_sockaddr.h b/libc/include/llvm-libc-types/struct_sockaddr.h
index 0e492452f693c0..b7579e9c6ba73b 100644
--- a/libc/include/llvm-libc-types/struct_sockaddr.h
+++ b/libc/include/llvm-libc-types/struct_sockaddr.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_SOCKADDR_H
 #define LLVM_LIBC_TYPES_STRUCT_SOCKADDR_H
 
-#include "llvm-libc-types/sa_family_t.h"
+#include "sa_family_t.h"
 
 struct sockaddr {
   sa_family_t sa_family;
diff --git a/libc/include/llvm-libc-types/struct_sockaddr_un.h b/libc/include/llvm-libc-types/struct_sockaddr_un.h
index 3c0362ce24fba0..5ed31a49ebb517 100644
--- a/libc/include/llvm-libc-types/struct_sockaddr_un.h
+++ b/libc/include/llvm-libc-types/struct_sockaddr_un.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_SOCKADDR_UN_H
 #define LLVM_LIBC_TYPES_STRUCT_SOCKADDR_UN_H
 
-#include "llvm-libc-types/sa_family_t.h"
+#include "sa_family_t.h"
 
 // This is the sockaddr specialization for AF_UNIX or AF_LOCAL sockets, as
 // defined by posix.
diff --git a/libc/include/llvm-libc-types/struct_stat.h b/libc/include/llvm-libc-types/struct_stat.h
index d8ae9dd6ffdcab..4026679f8d67f0 100644
--- a/libc/include/llvm-libc-types/struct_stat.h
+++ b/libc/include/llvm-libc-types/struct_stat.h
@@ -9,16 +9,16 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_STAT_H
 #define LLVM_LIBC_TYPES_STRUCT_STAT_H
 
-#include "llvm-libc-types/blkcnt_t.h"
-#include "llvm-libc-types/blksize_t.h"
-#include "llvm-libc-types/dev_t.h"
-#include "llvm-libc-types/gid_t.h"
-#include "llvm-libc-types/ino_t.h"
-#include "llvm-libc-types/mode_t.h"
-#include "llvm-libc-types/nlink_t.h"
-#include "llvm-libc-types/off_t.h"
-#include "llvm-libc-types/struct_timespec.h"
-#include "llvm-libc-types/uid_t.h"
+#include "blkcnt_t.h"
+#include "blksize_t.h"
+#include "dev_t.h"
+#include "gid_t.h"
+#include "ino_t.h"
+#include "mode_t.h"
+#include "nlink_t.h"
+#include "off_t.h"
+#include "struct_timespec.h"
+#include "uid_t.h"
 
 struct stat {
   dev_t st_dev;
diff --git a/libc/include/llvm-libc-types/struct_termios.h b/libc/include/llvm-libc-types/struct_termios.h
index 51241192f741f9..e3c5f2809e4398 100644
--- a/libc/include/llvm-libc-types/struct_termios.h
+++ b/libc/include/llvm-libc-types/struct_termios.h
@@ -9,9 +9,9 @@
 #ifndef __LLVM_LIBC_TYPES_STRUCT_TERMIOS_H__
 #define __LLVM_LIBC_TYPES_STRUCT_TERMIOS_H__
 
-#include "llvm-libc-types/cc_t.h"
-#include "llvm-libc-types/speed_t.h"
-#include "llvm-libc-types/tcflag_t.h"
+#include "cc_t.h"
+#include "speed_t.h"
+#include "tcflag_t.h"
 
 struct termios {
   tcflag_t c_iflag; // Input mode flags
diff --git a/libc/include/llvm-libc-types/struct_timespec.h b/libc/include/llvm-libc-types/struct_timespec.h
index 4baab07c10f853..28b5a571f67902 100644
--- a/libc/include/llvm-libc-types/struct_timespec.h
+++ b/libc/include/llvm-libc-types/struct_timespec.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_TIMESPEC_H
 #define LLVM_LIBC_TYPES_STRUCT_TIMESPEC_H
 
-#include "llvm-libc-types/time_t.h"
+#include "time_t.h"
 
 struct timespec {
   time_t tv_sec; /* Seconds.  */
diff --git a/libc/include/llvm-libc-types/struct_timeval.h b/libc/include/llvm-libc-types/struct_timeval.h
index 365b835d345dd3..9595d85a46c8fa 100644
--- a/libc/include/llvm-libc-types/struct_timeval.h
+++ b/libc/include/llvm-libc-types/struct_timeval.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_TYPES_STRUCT_TIMEVAL_H
 #define LLVM_LIBC_TYPES_STRUCT_TIMEVAL_H
 
-#include "llvm-libc-types/suseconds_t.h"
-#include "llvm-libc-types/time_t.h"
+#include "suseconds_t.h"
+#include "time_t.h"
 
 struct timeval {
   time_t tv_sec;       // Seconds
diff --git a/libc/include/llvm-libc-types/thrd_t.h b/libc/include/llvm-libc-types/thrd_t.h
index 751ea5b9e4c020..d5f31064f2fe56 100644
--- a/libc/include/llvm-libc-types/thrd_t.h
+++ b/libc/include/llvm-libc-types/thrd_t.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TYPES_THRD_T_H
 #define LLVM_LIBC_TYPES_THRD_T_H
 
-#include "llvm-libc-types/__thread_type.h"
+#include "__thread_type.h"
 
 typedef __thread_type thrd_t;
 
diff --git a/libc/include/sys/auxv.h.def b/libc/include/sys/auxv.h.def
index 11ab25bcfe2c25..d790160e903101 100644
--- a/libc/include/sys/auxv.h.def
+++ b/libc/include/sys/auxv.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-macros/sys-auxv-macros.h"
+#include "../llvm-libc-macros/sys-auxv-macros.h"
 
 %%public_api()
 
diff --git a/libc/include/sys/epoll.h.def b/libc/include/sys/epoll.h.def
index 98d96bf4292510..2240fe46f2afc3 100644
--- a/libc/include/sys/epoll.h.def
+++ b/libc/include/sys/epoll.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-macros/sys-epoll-macros.h"
+#include "../llvm-libc-macros/sys-epoll-macros.h"
 
 %%public_api()
 
diff --git a/libc/include/sys/ioctl.h.def b/libc/include/sys/ioctl.h.def
index 2f37a1190ac11d..133efcdca06b00 100644
--- a/libc/include/sys/ioctl.h.def
+++ b/libc/include/sys/ioctl.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-macros/sys-ioctl-macros.h"
+#include "../llvm-libc-macros/sys-ioctl-macros.h"
 
 %%public_api()
 
diff --git a/libc/include/sys/mman.h.def b/libc/include/sys/mman.h.def
index 2e2c2f1997b834..55f5cb68a200ba 100644
--- a/libc/include/sys/mman.h.def
+++ b/libc/include/sys/mman.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-macros/sys-mman-macros.h"
+#include "../llvm-libc-macros/sys-mman-macros.h"
 
 %%public_api()
 
diff --git a/libc/include/sys/queue.h b/libc/include/sys/queue.h
index cca53c16f0f3c9..fc739b4a253b14 100644
--- a/libc/include/sys/queue.h
+++ b/libc/include/sys/queue.h
@@ -9,6 +9,6 @@
 #ifndef SYS_QUEUE_H
 #define SYS_QUEUE_H
 
-#include "llvm-libc-macros/sys-queue-macros.h"
+#include "../llvm-libc-macros/sys-queue-macros.h"
 
 #endif // SYS_QUEUE_H
diff --git a/libc/include/sys/random.h.def b/libc/include/sys/random.h.def
index d11431b2755d9a..456048f1a818e1 100644
--- a/libc/include/sys/random.h.def
+++ b/libc/include/sys/random.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-macros/sys-random-macros.h"
+#include "../llvm-libc-macros/sys-random-macros.h"
 
 %%public_api()
 
diff --git a/libc/include/sys/resource.h.def b/libc/include/sys/resource.h.def
index 365d803cf7154f..119c47971fb94c 100644
--- a/libc/include/sys/resource.h.def
+++ b/libc/include/sys/resource.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-macros/sys-resource-macros.h"
+#include "../llvm-libc-macros/sys-resource-macros.h"
 
 %%public_api()
 
diff --git a/libc/include/sys/select.h.def b/libc/include/sys/select.h.def
index 529be7158f262c..c9bf382b676af0 100644
--- a/libc/include/sys/select.h.def
+++ b/libc/include/sys/select.h.def
@@ -11,7 +11,7 @@
 
 #include "__llvm-libc-common.h"
 
-#include "llvm-libc-macros/sys-select-macros.h"
+#includ...
[truncated]

@nickdesaulniers
Copy link
Member

Initially I thought "didn't we try+revert this?" I'm thinking of

a35a3b7 and 9feb0c9

though I guess this isn't the same.

@nickdesaulniers
Copy link
Member

nickdesaulniers commented Oct 30, 2024

The commit lacks a description, such as addressing "why should we make this change?"

For the hunks that make the include line shorter, I like those changes. For the hunks that add "../" prefixes, I don't.

Is that the reason for this PR, or something else? Whatever it is, please update the description (or the commit message when merging).

@lntue
Copy link
Contributor Author

lntue commented Nov 1, 2024

The commit lacks a description, such as addressing "why should we make this change?"

For the hunks that make the include line shorter, I like those changes. For the hunks that add "../" prefixes, I don't.

Is that the reason for this PR, or something else? Whatever it is, please update the description (or the commit message when merging).

Done.

@lntue lntue merged commit 88a0a31 into llvm:main Nov 1, 2024
7 checks passed
@lntue lntue deleted the header branch November 1, 2024 18:33
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 1, 2024

LLVM Buildbot has detected a new failure on builder libc-riscv32-qemu-yocto-fullbuild-dbg running on rv32gc-qemu-system while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/196/builds/400

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure) (timed out)
...
[       OK ] LlvmLibcPThreadMutexAttrTest.SetAndGetRobust (254 us)
[ RUN      ] LlvmLibcPThreadMutexAttrTest.SetAndGetPShared
[       OK ] LlvmLibcPThreadMutexAttrTest.SetAndGetPShared (242 us)
Ran 4 tests.  PASS: 4  FAIL: 0
[2042/2045] Running unit test libc.test.src.time.nanosleep_test.__unit__
sh: line 1: /timer.22798: Permission denied
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcNanosleep.SmokeTest
[       OK ] LlvmLibcNanosleep.SmokeTest (660 us)
Ran 1 tests.  PASS: 1  FAIL: 0
command timed out: 1200 seconds without output running [b'python', b'../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py', b'--debug'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=2390.054757
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
sh: line 1: /timer.22818: Permission denied
[==========] Running 5 tests from 1 test suite.
[ RUN      ] LlvmLibcPThreadAttrTest.InitAndDestroy
[       OK ] LlvmLibcPThreadAttrTest.InitAndDestroy (496 us)
[ RUN      ] LlvmLibcPThreadattrTest.SetAndGetDetachState
[       OK ] LlvmLibcPThreadattrTest.SetAndGetDetachState (192 us)
[ RUN      ] LlvmLibcPThreadattrTest.SetAndGetGuardSize
[       OK ] LlvmLibcPThreadattrTest.SetAndGetGuardSize (203 us)
[ RUN      ] LlvmLibcPThreadattrTest.SetAndGetStackSize
[       OK ] LlvmLibcPThreadattrTest.SetAndGetStackSize (167 us)
[ RUN      ] LlvmLibcPThreadattrTest.SetAndGetStack
[       OK ] LlvmLibcPThreadattrTest.SetAndGetStack (265 us)
Ran 5 tests.  PASS: 5  FAIL: 0
[2039/2045] Running unit test libc.test.src.time.gettimeofday_test
sh: line 1: /timer.22821: Permission denied
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcGettimeofday.SmokeTest
[       OK ] LlvmLibcGettimeofday.SmokeTest (684 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[2040/2045] Running unit test libc.test.src.time.gmtime_r_test
sh: line 1: /timer.22824: Permission denied
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcGmTimeR.EndOf32BitEpochYear
[       OK ] LlvmLibcGmTimeR.EndOf32BitEpochYear (919 us)
[ RUN      ] LlvmLibcGmTimeR.Max64BitYear
[       OK ] LlvmLibcGmTimeR.Max64BitYear (107 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[2041/2045] Running unit test libc.test.src.pthread.pthread_mutexattr_test
sh: line 1: /timer.22827: Permission denied
[==========] Running 4 tests from 1 test suite.
[ RUN      ] LlvmLibcPThreadMutexAttrTest.InitAndDestroy
[       OK ] LlvmLibcPThreadMutexAttrTest.InitAndDestroy (276 us)
[ RUN      ] LlvmLibcPThreadMutexAttrTest.SetAndGetType
[       OK ] LlvmLibcPThreadMutexAttrTest.SetAndGetType (271 us)
[ RUN      ] LlvmLibcPThreadMutexAttrTest.SetAndGetRobust
[       OK ] LlvmLibcPThreadMutexAttrTest.SetAndGetRobust (254 us)
[ RUN      ] LlvmLibcPThreadMutexAttrTest.SetAndGetPShared
[       OK ] LlvmLibcPThreadMutexAttrTest.SetAndGetPShared (242 us)
Ran 4 tests.  PASS: 4  FAIL: 0
[2042/2045] Running unit test libc.test.src.time.nanosleep_test.__unit__
sh: line 1: /timer.22798: Permission denied
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcNanosleep.SmokeTest
[       OK ] LlvmLibcNanosleep.SmokeTest (660 us)
Ran 1 tests.  PASS: 1  FAIL: 0

command timed out: 1200 seconds without output running [b'python', b'../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py', b'--debug'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=2390.054757

smallp-o-p pushed a commit to smallp-o-p/llvm-project that referenced this pull request Nov 3, 2024
We are finalizing the header inclusion policy, and for our public
headers in the `libc/include` folder, they must use relative path in
`"..."` when including each other.

This PR does the cleanup making sure that all the public header
inclusions in `libc/include` folder use relative paths.

---------

Co-authored-by: Nick Desaulniers <[email protected]>
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
We are finalizing the header inclusion policy, and for our public
headers in the `libc/include` folder, they must use relative path in
`"..."` when including each other.

This PR does the cleanup making sure that all the public header
inclusions in `libc/include` folder use relative paths.

---------

Co-authored-by: Nick Desaulniers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants