[libc-commits] [libc] [libc] Fixes all guard comments of libc (PR #188701)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 26 01:08:06 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Zorojuro (Sukumarsawant)

<details>
<summary>Changes</summary>

This PR intends to fix ALL the wrong guard comments for libc


Script used: [guard_checker](https://github.com/Sukumarsawant/guard_checker/blob/main/check_headers.py)

---
Full diff: https://github.com/llvm/llvm-project/pull/188701.diff


22 Files Affected:

- (modified) libc/hdr/math_function_macros.h (+1-1) 
- (modified) libc/hdr/sys_epoll_macros.h (+1-1) 
- (modified) libc/hdr/types/dl_info.h (+1-1) 
- (modified) libc/hdr/types/suseconds_t.h (+1-1) 
- (modified) libc/include/llvm-libc-types/Elf32_Phdr.h (+1-1) 
- (modified) libc/include/llvm-libc-types/Elf64_Off.h (+1-1) 
- (modified) libc/src/__support/frac128.h (+1-1) 
- (modified) libc/src/__support/math/exp10_float16_constants.h (+1-1) 
- (modified) libc/src/__support/math/fmabf16.h (+1-1) 
- (modified) libc/src/__support/threads/CndVar.h (+1-1) 
- (modified) libc/src/__support/threads/unix_mutex.h (+1-1) 
- (modified) libc/src/math/fminimum_mag_num.h (+1-1) 
- (modified) libc/src/math/powi.h (+1-1) 
- (modified) libc/src/math/powif.h (+1-1) 
- (modified) libc/src/math/setpayloadsigl.h (+1-1) 
- (modified) libc/src/math/totalordermagl.h (+1-1) 
- (modified) libc/src/stdlib/memalignment.h (+1-1) 
- (modified) libc/src/string/memory_utils/arm/inline_memset.h (+1-1) 
- (modified) libc/src/unistd/fpathconf.h (+1-1) 
- (modified) libc/src/unistd/linux/pathconf_utils.h (+1-1) 
- (modified) libc/src/unistd/pathconf.h (+1-1) 
- (modified) libc/test/src/math/performance_testing/Timer.h (+1-1) 


``````````diff
diff --git a/libc/hdr/math_function_macros.h b/libc/hdr/math_function_macros.h
index 48dec8260ef89..a15f52e00737f 100644
--- a/libc/hdr/math_function_macros.h
+++ b/libc/hdr/math_function_macros.h
@@ -24,4 +24,4 @@
 
 #endif // LLVM_LIBC_FULL_BUILD
 
-#endif // LLVM_LIBC_HDR_MATH_MACROS_H
+#endif // LLVM_LIBC_HDR_MATH_FUNCTION_MACROS_H
diff --git a/libc/hdr/sys_epoll_macros.h b/libc/hdr/sys_epoll_macros.h
index db047f1616343..642484a22e3c5 100644
--- a/libc/hdr/sys_epoll_macros.h
+++ b/libc/hdr/sys_epoll_macros.h
@@ -19,4 +19,4 @@
 
 #endif // LLVM_LIBC_FULL_BUILD
 
-#endif // LLVM_LIBC_HDR_SYS/EPOLL_MACROS_H
+#endif // LLVM_LIBC_HDR_SYS_EPOLL_MACROS_H
diff --git a/libc/hdr/types/dl_info.h b/libc/hdr/types/dl_info.h
index c7428319e0597..d74dc7969ef6e 100644
--- a/libc/hdr/types/dl_info.h
+++ b/libc/hdr/types/dl_info.h
@@ -18,4 +18,4 @@
 
 #endif // LIBC_FULL_BUILD
 
-#endif // LLVM_LIBC_HDR_TYPES_STRUCT_TIMESPEC_H
+#endif // LLVM_LIBC_HDR_TYPES_DLINFO_H
diff --git a/libc/hdr/types/suseconds_t.h b/libc/hdr/types/suseconds_t.h
index f60168c59fb89..c10eff90c6ee6 100644
--- a/libc/hdr/types/suseconds_t.h
+++ b/libc/hdr/types/suseconds_t.h
@@ -19,4 +19,4 @@
 
 #endif // LLVM_LIBC_FULL_BUILD
 
-#endif // #ifndef LLVM_LIBC_HDR_TYPES_SUSECONDS_T_H
+#endif // LLVM_LIBC_HDR_TYPES_SUSECONDS_T_H
diff --git a/libc/include/llvm-libc-types/Elf32_Phdr.h b/libc/include/llvm-libc-types/Elf32_Phdr.h
index 1fcb6d0e18108..6a5aae7e7235c 100644
--- a/libc/include/llvm-libc-types/Elf32_Phdr.h
+++ b/libc/include/llvm-libc-types/Elf32_Phdr.h
@@ -24,4 +24,4 @@ typedef struct {
   Elf32_Word p_align;
 } Elf32_Phdr;
 
-#endif // LLVM_LIBC_TYPES_ELF32_EHDR_H
+#endif // LLVM_LIBC_TYPES_ELF32_PHDR_H
diff --git a/libc/include/llvm-libc-types/Elf64_Off.h b/libc/include/llvm-libc-types/Elf64_Off.h
index e33c47e658152..8a3e49f2ed1b8 100644
--- a/libc/include/llvm-libc-types/Elf64_Off.h
+++ b/libc/include/llvm-libc-types/Elf64_Off.h
@@ -13,4 +13,4 @@
 
 typedef uint64_t Elf64_Off;
 
-#endif // LLVM_LIBC_TYPES_ELF32_OFF_H
+#endif // LLVM_LIBC_TYPES_ELF64_OFF_H
diff --git a/libc/src/__support/frac128.h b/libc/src/__support/frac128.h
index 0e19eb32676c0..037efd46f3837 100644
--- a/libc/src/__support/frac128.h
+++ b/libc/src/__support/frac128.h
@@ -57,4 +57,4 @@ struct Frac128 : public UInt<128> {
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC___SUPPORT_UINT128_H
+#endif // LLVM_LIBC_SRC___SUPPORT_FRAC128_H
diff --git a/libc/src/__support/math/exp10_float16_constants.h b/libc/src/__support/math/exp10_float16_constants.h
index cf8bb7f25b41c..e65e50f9fddf8 100644
--- a/libc/src/__support/math/exp10_float16_constants.h
+++ b/libc/src/__support/math/exp10_float16_constants.h
@@ -40,4 +40,4 @@ LIBC_INLINE_VAR constexpr float LOG10F_2 = 0x1.344136p-2f;
 
 #endif // LIBC_TYPES_HAS_FLOAT16
 
-#endif // LLVM_LIBC_SRC___SUPPORT_MATH_EXP10F16_H
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_EXP10_FLOAT16_CONSTANTS_H
diff --git a/libc/src/__support/math/fmabf16.h b/libc/src/__support/math/fmabf16.h
index f69de4bbd9842..41a99df2d952b 100644
--- a/libc/src/__support/math/fmabf16.h
+++ b/libc/src/__support/math/fmabf16.h
@@ -24,4 +24,4 @@ LIBC_INLINE bfloat16 fmabf16(bfloat16 x, bfloat16 y, bfloat16 z) {
 } // namespace math
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC___SUPPORT_MATH_FMAXBF16_H
+#endif // LLVM_LIBC_SRC___SUPPORT_MATH_FMABF16_H
diff --git a/libc/src/__support/threads/CndVar.h b/libc/src/__support/threads/CndVar.h
index 901b652c553d8..406bcf193704e 100644
--- a/libc/src/__support/threads/CndVar.h
+++ b/libc/src/__support/threads/CndVar.h
@@ -51,4 +51,4 @@ class CndVar {
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_CNDVAR_H
+#endif // LLVM_LIBC___SUPPORT_SRC_THREADS_LINUX_CNDVAR_H
diff --git a/libc/src/__support/threads/unix_mutex.h b/libc/src/__support/threads/unix_mutex.h
index 626cee9d0913d..aaaa931efe310 100644
--- a/libc/src/__support/threads/unix_mutex.h
+++ b/libc/src/__support/threads/unix_mutex.h
@@ -86,4 +86,4 @@ class Mutex final : private RawMutex {
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC___SUPPORT_THREADS_LINUX_MUTEX_H
+#endif // LLVM_LIBC_SRC___SUPPORT_THREADS_UNIX_MUTEX_H
diff --git a/libc/src/math/fminimum_mag_num.h b/libc/src/math/fminimum_mag_num.h
index c4464343338dc..3a9136fd8fb04 100644
--- a/libc/src/math/fminimum_mag_num.h
+++ b/libc/src/math/fminimum_mag_num.h
@@ -18,4 +18,4 @@ double fminimum_mag_num(double x, double y);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_MATH_FMINIMUM_MAG_NUMH
+#endif // LLVM_LIBC_SRC_MATH_FMINIMUM_MAG_NUM_H
diff --git a/libc/src/math/powi.h b/libc/src/math/powi.h
index a70fab62b85cb..0aa1b5eb676ec 100644
--- a/libc/src/math/powi.h
+++ b/libc/src/math/powi.h
@@ -17,4 +17,4 @@ double powi(double x, int y);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_MATH_POW_H
+#endif // LLVM_LIBC_SRC_MATH_POWI_H
diff --git a/libc/src/math/powif.h b/libc/src/math/powif.h
index ee6716f2a1846..f4dadab956fef 100644
--- a/libc/src/math/powif.h
+++ b/libc/src/math/powif.h
@@ -17,4 +17,4 @@ float powif(float x, int y);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_MATH_POW_H
+#endif // LLVM_LIBC_SRC_MATH_POWIF_H
diff --git a/libc/src/math/setpayloadsigl.h b/libc/src/math/setpayloadsigl.h
index 9bc47eed90197..7fc9619c5e3cd 100644
--- a/libc/src/math/setpayloadsigl.h
+++ b/libc/src/math/setpayloadsigl.h
@@ -17,4 +17,4 @@ int setpayloadsigl(long double *res, long double pl);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_MATH_SETPAYLOADSIGF_H
+#endif // LLVM_LIBC_SRC_MATH_SETPAYLOADSIGL_H
diff --git a/libc/src/math/totalordermagl.h b/libc/src/math/totalordermagl.h
index 64d27f1566877..eadcea2229a42 100644
--- a/libc/src/math/totalordermagl.h
+++ b/libc/src/math/totalordermagl.h
@@ -17,4 +17,4 @@ int totalordermagl(const long double *x, const long double *y);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_MATH_TOTALORDERMAGl_H
+#endif // LLVM_LIBC_SRC_MATH_TOTALORDERMAGL_H
diff --git a/libc/src/stdlib/memalignment.h b/libc/src/stdlib/memalignment.h
index b7c7430af8c8e..2621ea55ebdd7 100644
--- a/libc/src/stdlib/memalignment.h
+++ b/libc/src/stdlib/memalignment.h
@@ -18,4 +18,4 @@ size_t memalignment(const void *p);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_STDLIB_LDIV_H
+#endif // LLVM_LIBC_SRC_STDLIB_MEM_ALIGNMENT_H
diff --git a/libc/src/string/memory_utils/arm/inline_memset.h b/libc/src/string/memory_utils/arm/inline_memset.h
index a7ef9cc7df916..ce36e40617bb1 100644
--- a/libc/src/string/memory_utils/arm/inline_memset.h
+++ b/libc/src/string/memory_utils/arm/inline_memset.h
@@ -153,4 +153,4 @@ inline_memset_arm_dispatch(Ptr dst, uint8_t value, size_t size) {
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ARM_INLINE_MEMCPY_H
+#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ARM_INLINE_MEMSET_H
diff --git a/libc/src/unistd/fpathconf.h b/libc/src/unistd/fpathconf.h
index 610e2429123e5..e6a3b16948f40 100644
--- a/libc/src/unistd/fpathconf.h
+++ b/libc/src/unistd/fpathconf.h
@@ -17,4 +17,4 @@ long fpathconf(int fd, int name);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_UNISTD_FSYNC_H
+#endif // LLVM_LIBC_SRC_UNISTD_FPATHCONF_H
diff --git a/libc/src/unistd/linux/pathconf_utils.h b/libc/src/unistd/linux/pathconf_utils.h
index bd34de23cc38e..8487802c09dca 100644
--- a/libc/src/unistd/linux/pathconf_utils.h
+++ b/libc/src/unistd/linux/pathconf_utils.h
@@ -18,4 +18,4 @@ long pathconfig(const statfs_utils::LinuxStatFs &s, int name);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_UNISTD_PREAD_H
+#endif // LLVM_LIBC_SRC_UNISTD_PATHCONF_UTILS_H
diff --git a/libc/src/unistd/pathconf.h b/libc/src/unistd/pathconf.h
index d6b891ea8be68..e2dd484960822 100644
--- a/libc/src/unistd/pathconf.h
+++ b/libc/src/unistd/pathconf.h
@@ -17,4 +17,4 @@ long pathconf(const char *path, int name);
 
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_SRC_UNISTD_PREAD_H
+#endif // LLVM_LIBC_SRC_UNISTD_PATHCONF_H
diff --git a/libc/test/src/math/performance_testing/Timer.h b/libc/test/src/math/performance_testing/Timer.h
index f75c1f0285e4b..31deeb3c53d79 100644
--- a/libc/test/src/math/performance_testing/Timer.h
+++ b/libc/test/src/math/performance_testing/Timer.h
@@ -31,4 +31,4 @@ class Timer {
 } // namespace testing
 } // namespace LIBC_NAMESPACE_DECL
 
-#endif // LLVM_LIBC_TEST_SRC_MATH_PERFORMANCE_TESTING_TIMER_H
+#endif // LLVM_LIBC_TEST_SRC_MATH_PERFORMACE_TESTING_TIMER_H

``````````

</details>


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


More information about the libc-commits mailing list