Skip to content

Commit 270547f

Browse files
authored
[libc][clang-tidy] Add llvm-header-guard to get consistant naming and prevent file copy/paste issues. (#66477)
1 parent 1a9358c commit 270547f

File tree

257 files changed

+759
-748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+759
-748
lines changed

libc/src/.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
InheritParentConfig: true
2-
Checks: '-*,llvmlibc-*,readability-identifier-naming'
2+
Checks: '-*,llvmlibc-*,readability-identifier-naming,llvm-header-guard'
33
HeaderFilterRegex: '.*'
44
WarningsAsErrors: 'llvmlibc-*'
55
CheckOptions:

libc/src/__support/CPP/algorithm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// they prove useful.
1010
//===----------------------------------------------------------------------===//
1111

12-
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_ALGORITHM_H
13-
#define LLVM_LIBC_SRC_SUPPORT_CPP_ALGORITHM_H
12+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_ALGORITHM_H
13+
#define LLVM_LIBC_SRC___SUPPORT_CPP_ALGORITHM_H
1414

1515
#include "src/__support/macros/attributes.h" // LIBC_INLINE
1616

@@ -28,4 +28,4 @@ template <class T> LIBC_INLINE constexpr const T &min(const T &a, const T &b) {
2828
} // namespace cpp
2929
} // namespace __llvm_libc
3030

31-
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_ALGORITHM_H
31+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_ALGORITHM_H

libc/src/__support/CPP/array.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_ARRAY_H
10-
#define LLVM_LIBC_SRC_SUPPORT_CPP_ARRAY_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_ARRAY_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_ARRAY_H
1111

1212
#include "src/__support/macros/attributes.h"
1313
#include <stddef.h> // For size_t.
@@ -52,4 +52,4 @@ template <class T, size_t N> struct array {
5252
} // namespace cpp
5353
} // namespace __llvm_libc
5454

55-
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_ARRAY_H
55+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_ARRAY_H

libc/src/__support/CPP/atomic.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_ATOMIC_H
10-
#define LLVM_LIBC_SRC_SUPPORT_CPP_ATOMIC_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_ATOMIC_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_ATOMIC_H
1111

1212
#include "src/__support/macros/attributes.h"
1313
#include "src/__support/macros/properties/architectures.h"
@@ -118,4 +118,4 @@ LIBC_INLINE void atomic_thread_fence(MemoryOrder mem_ord) {
118118
} // namespace cpp
119119
} // namespace __llvm_libc
120120

121-
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_ATOMIC_H
121+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_ATOMIC_H

libc/src/__support/CPP/bit.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SUPPORT_CPP_BIT_H
10-
#define LLVM_LIBC_SUPPORT_CPP_BIT_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
1111

1212
#include "src/__support/CPP/type_traits.h"
1313
#include "src/__support/macros/attributes.h"
@@ -61,4 +61,4 @@ LIBC_INLINE constexpr To bit_or_static_cast(const From &from) {
6161

6262
} // namespace __llvm_libc::cpp
6363

64-
#endif // LLVM_LIBC_SUPPORT_CPP_BIT_H
64+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H

libc/src/__support/CPP/bitset.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_BITSET_H
10-
#define LLVM_LIBC_SRC_SUPPORT_CPP_BITSET_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_BITSET_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_BITSET_H
1111

1212
#include "src/__support/macros/attributes.h"
1313
#include <stddef.h> // For size_t.
@@ -87,4 +87,4 @@ template <size_t NumberOfBits> struct bitset {
8787

8888
} // namespace __llvm_libc::cpp
8989

90-
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_BITSET_H
90+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_BITSET_H

libc/src/__support/CPP/cstddef.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_BYTE_H
10-
#define LLVM_LIBC_SRC_SUPPORT_CPP_BYTE_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_CSTDDEF_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_CSTDDEF_H
1111

1212
#include "src/__support/macros/attributes.h"
1313
#include "type_traits.h" // For enable_if_t, is_integral_v.
@@ -68,4 +68,4 @@ to_integer(byte b) noexcept {
6868

6969
} // namespace __llvm_libc::cpp
7070

71-
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_BYTE_H
71+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_CSTDDEF_H

libc/src/__support/CPP/expected.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SUPPORT_CPP_EXPECTED_H
10-
#define LLVM_LIBC_SUPPORT_CPP_EXPECTED_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_EXPECTED_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_EXPECTED_H
1111

1212
namespace __llvm_libc::cpp {
1313

@@ -48,4 +48,4 @@ template <class T, class E> class expected {
4848

4949
} // namespace __llvm_libc::cpp
5050

51-
#endif // LLVM_LIBC_SUPPORT_CPP_EXPECTED_H
51+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_EXPECTED_H

libc/src/__support/CPP/functional.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_FUNCTIONAL_H
10-
#define LLVM_LIBC_SRC_SUPPORT_CPP_FUNCTIONAL_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
1111

1212
#include "src/__support/CPP/type_traits/enable_if.h"
1313
#include "src/__support/CPP/type_traits/is_convertible.h"
@@ -67,4 +67,4 @@ template <typename Ret, typename... Params> class function<Ret(Params...)> {
6767
} // namespace cpp
6868
} // namespace __llvm_libc
6969

70-
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_FUNCTIONAL_H
70+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H

libc/src/__support/CPP/limits.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_LIMITS_H
10-
#define LLVM_LIBC_SRC_SUPPORT_CPP_LIMITS_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_LIMITS_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CPP_LIMITS_H
1111

1212
#include <limits.h>
1313

@@ -98,4 +98,4 @@ template <> class numeric_limits<__uint128_t> {
9898
} // namespace cpp
9999
} // namespace __llvm_libc
100100

101-
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_LIMITS_H
101+
#endif // LLVM_LIBC_SRC___SUPPORT_CPP_LIMITS_H

0 commit comments

Comments
 (0)