[llvm] 10dff21 - [Support] Use llvm::byteswap instead of sys::getSwappedBytes (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 23 13:17:53 PDT 2023
Author: Kazu Hirata
Date: 2023-09-23T13:17:46-07:00
New Revision: 10dff21f2b87ad0fd25f55353cd3c2397686c45c
URL: https://github.com/llvm/llvm-project/commit/10dff21f2b87ad0fd25f55353cd3c2397686c45c
DIFF: https://github.com/llvm/llvm-project/commit/10dff21f2b87ad0fd25f55353cd3c2397686c45c.diff
LOG: [Support] Use llvm::byteswap instead of sys::getSwappedBytes (NFC)
Added:
Modified:
llvm/lib/Support/SHA1.cpp
llvm/lib/Support/SHA256.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/SHA1.cpp b/llvm/lib/Support/SHA1.cpp
index 7e66063b07604cd..412f894492bfe0b 100644
--- a/llvm/lib/Support/SHA1.cpp
+++ b/llvm/lib/Support/SHA1.cpp
@@ -270,7 +270,7 @@ void SHA1::final(std::array<uint32_t, HASH_LENGTH / 4> &HashResult) {
} else {
// Swap byte order back
for (int i = 0; i < 5; i++) {
- HashResult[i] = sys::getSwappedBytes(InternalState.State[i]);
+ HashResult[i] = llvm::byteswap(InternalState.State[i]);
}
}
}
diff --git a/llvm/lib/Support/SHA256.cpp b/llvm/lib/Support/SHA256.cpp
index b1c07f83b68f25a..a8019002499cadf 100644
--- a/llvm/lib/Support/SHA256.cpp
+++ b/llvm/lib/Support/SHA256.cpp
@@ -250,7 +250,7 @@ void SHA256::final(std::array<uint32_t, HASH_LENGTH / 4> &HashResult) {
} else {
// Swap byte order back
for (int i = 0; i < 8; i++) {
- HashResult[i] = sys::getSwappedBytes(InternalState.State[i]);
+ HashResult[i] = llvm::byteswap(InternalState.State[i]);
}
}
}
More information about the llvm-commits
mailing list