Skip to content

Commit adacab3

Browse files
authored
[orc-rt] Fix byteswap implementation for 64-bit types, rename tests. (#157074)
The 64-bit path included references to the llvm:: namespace that would have caused compile failures but for the fact that they were compiled out on all machines where the ORC runtime is currently tested.
1 parent 98f1e4a commit adacab3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

orc-rt/include/orc-rt/bit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ template <typename T, typename = std::enable_if_t<std::is_integral_v<T>>>
9595
#elif defined(_MSC_VER) && !defined(_DEBUG)
9696
return _byteswap_uint64(UV);
9797
#else
98-
uint64_t Hi = llvm::byteswap<uint32_t>(UV);
99-
uint32_t Lo = llvm::byteswap<uint32_t>(UV >> 32);
98+
uint64_t Hi = byteswap<uint32_t>(UV);
99+
uint32_t Lo = byteswap<uint32_t>(UV >> 32);
100100
return (Hi << 32) | Lo;
101101
#endif
102102
} else {

orc-rt/unittests/bit-test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ TEST(BitTest, endian) {
3434
#endif
3535
}
3636

37-
TEST(MathTest, byte_swap_32) {
37+
TEST(BitTest, byte_swap_32) {
3838
unsigned char Seq[] = {0x01, 0x23, 0x45, 0x67};
3939
uint32_t X = 0;
4040
memcpy(&X, Seq, sizeof(X));
@@ -56,7 +56,7 @@ TEST(MathTest, byte_swap_32) {
5656
#endif
5757
}
5858

59-
TEST(MathTest, byte_swap_64) {
59+
TEST(BitTest, byte_swap_64) {
6060
unsigned char Seq[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
6161
uint64_t X = 0;
6262
memcpy(&X, Seq, sizeof(X));

0 commit comments

Comments
 (0)