-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Rename libc/src/__support/endian.h to endian_internal.h #115950
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
Conversation
This prevents a conflict with the Linux system endian.h when built in overlay mode for CPP files in __support. This issue appeared in PR llvm#106259.
7d2e3b7
to
fbb21ee
Compare
@llvm/pr-subscribers-libc Author: Daniel Thornburgh (mysterymath) ChangesThis prevents a conflict with the Linux system endian.h when built in overlay mode for CPP files in __support. This issue appeared in PR #106259. Full diff: https://github.com/llvm/llvm-project/pull/115950.diff 15 Files Affected:
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index c44e333645e22e..6637ff9d56f4bc 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -55,7 +55,7 @@ add_header_library(
common
HDRS
common.h
- endian.h
+ endian_internal.h
macros/properties/architectures.h
macros/attributes.h
macros/properties/cpu_features.h
diff --git a/libc/src/__support/HashTable/generic/bitmask_impl.inc b/libc/src/__support/HashTable/generic/bitmask_impl.inc
index 6266ac3c84a900..469ddeeed8a859 100644
--- a/libc/src/__support/HashTable/generic/bitmask_impl.inc
+++ b/libc/src/__support/HashTable/generic/bitmask_impl.inc
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/__support/common.h"
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/__support/endian.h b/libc/src/__support/endian_internal.h
similarity index 96%
rename from libc/src/__support/endian.h
rename to libc/src/__support/endian_internal.h
index 8c443fefab5e8f..77839ad75455ba 100644
--- a/libc/src/__support/endian.h
+++ b/libc/src/__support/endian_internal.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC___SUPPORT_ENDIAN_H
-#define LLVM_LIBC_SRC___SUPPORT_ENDIAN_H
+#ifndef LLVM_LIBC_SRC___SUPPORT_ENDIAN_INTERNAL_H
+#define LLVM_LIBC_SRC___SUPPORT_ENDIAN_INTERNAL_H
#include "common.h"
#include "src/__support/macros/config.h"
@@ -143,4 +143,4 @@ using Endian = internal::Endian<__BYTE_ORDER__>;
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC___SUPPORT_ENDIAN_H
+#endif // LLVM_LIBC_SRC___SUPPORT_ENDIAN_INTERNAL_H
diff --git a/libc/src/network/htonl.cpp b/libc/src/network/htonl.cpp
index ec3c02e2894f2f..681786adea68a7 100644
--- a/libc/src/network/htonl.cpp
+++ b/libc/src/network/htonl.cpp
@@ -8,7 +8,7 @@
#include "src/network/htonl.h"
#include "src/__support/common.h"
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/network/htons.cpp b/libc/src/network/htons.cpp
index 78416b3a7d1f0a..675f53cf4a0ad6 100644
--- a/libc/src/network/htons.cpp
+++ b/libc/src/network/htons.cpp
@@ -8,7 +8,7 @@
#include "src/network/htons.h"
#include "src/__support/common.h"
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/network/ntohl.cpp b/libc/src/network/ntohl.cpp
index 974b574432ff3d..6a309e97fca79b 100644
--- a/libc/src/network/ntohl.cpp
+++ b/libc/src/network/ntohl.cpp
@@ -8,7 +8,7 @@
#include "src/network/ntohl.h"
#include "src/__support/common.h"
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/network/ntohs.cpp b/libc/src/network/ntohs.cpp
index bb1779f3dcb30c..b51ecb93241cac 100644
--- a/libc/src/network/ntohs.cpp
+++ b/libc/src/network/ntohs.cpp
@@ -8,7 +8,7 @@
#include "src/network/ntohs.h"
#include "src/__support/common.h"
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/string/memory_utils/op_generic.h b/libc/src/string/memory_utils/op_generic.h
index 89bbea8a2bdd2b..da20a84dede4d1 100644
--- a/libc/src/string/memory_utils/op_generic.h
+++ b/libc/src/string/memory_utils/op_generic.h
@@ -26,7 +26,7 @@
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/optimization.h"
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT64
diff --git a/libc/src/string/memory_utils/utils.h b/libc/src/string/memory_utils/utils.h
index 5e5fe593cce773..cae65bddd92f6e 100644
--- a/libc/src/string/memory_utils/utils.h
+++ b/libc/src/string/memory_utils/utils.h
@@ -12,7 +12,7 @@
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/cstddef.h"
#include "src/__support/CPP/type_traits.h"
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt
index 7ad262d5f1f300..e7ab85906a94f6 100644
--- a/libc/test/src/__support/CMakeLists.txt
+++ b/libc/test/src/__support/CMakeLists.txt
@@ -57,11 +57,11 @@ add_libc_test(
)
add_libc_test(
- endian_test
+ endian_internal_test
SUITE
libc-support-tests
SRCS
- endian_test.cpp
+ endian_internal_test.cpp
DEPENDS
libc.src.__support.common
)
diff --git a/libc/test/src/__support/endian_test.cpp b/libc/test/src/__support/endian_internal_test.cpp
similarity index 97%
rename from libc/test/src/__support/endian_test.cpp
rename to libc/test/src/__support/endian_internal_test.cpp
index 758c13b686946a..eab0f376e74956 100644
--- a/libc/test/src/__support/endian_test.cpp
+++ b/libc/test/src/__support/endian_internal_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/__support/macros/config.h"
#include "test/UnitTest/Test.h"
diff --git a/libc/test/src/network/htonl_test.cpp b/libc/test/src/network/htonl_test.cpp
index d3b930d0b1ea24..f2e2541312c31a 100644
--- a/libc/test/src/network/htonl_test.cpp
+++ b/libc/test/src/network/htonl_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/network/htonl.h"
#include "src/network/ntohl.h"
#include "test/UnitTest/Test.h"
diff --git a/libc/test/src/network/htons_test.cpp b/libc/test/src/network/htons_test.cpp
index d38fab8153b97c..9668162523ce5d 100644
--- a/libc/test/src/network/htons_test.cpp
+++ b/libc/test/src/network/htons_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/network/htons.h"
#include "src/network/ntohs.h"
#include "test/UnitTest/Test.h"
diff --git a/libc/test/src/network/ntohl_test.cpp b/libc/test/src/network/ntohl_test.cpp
index b06f8e19e4f45b..b72456b7200e58 100644
--- a/libc/test/src/network/ntohl_test.cpp
+++ b/libc/test/src/network/ntohl_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/network/htonl.h"
#include "src/network/ntohl.h"
#include "test/UnitTest/Test.h"
diff --git a/libc/test/src/network/ntohs_test.cpp b/libc/test/src/network/ntohs_test.cpp
index 654a39662ac9ce..1104356076b94b 100644
--- a/libc/test/src/network/ntohs_test.cpp
+++ b/libc/test/src/network/ntohs_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/endian.h"
+#include "src/__support/endian_internal.h"
#include "src/network/htons.h"
#include "src/network/ntohs.h"
#include "test/UnitTest/Test.h"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update the file name in bazel BUILD file?
Sure, done. |
This prevents a conflict with the Linux system endian.h when built in overlay mode for CPP files in __support.
This issue appeared in PR #106259.