aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderMap.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-09-23 13:30:16 -0700
committerKazu Hirata <kazu@google.com>2023-09-23 13:30:16 -0700
commitf435f55d58542ecde0e66460555ccbcbca355cc5 (patch)
tree9294a42473f46fbbf229fafaca4303ad5d3177c1 /clang/lib/Lex/HeaderMap.cpp
parent10dff21f2b87ad0fd25f55353cd3c2397686c45c (diff)
downloadllvm-f435f55d58542ecde0e66460555ccbcbca355cc5.zip
llvm-f435f55d58542ecde0e66460555ccbcbca355cc5.tar.gz
llvm-f435f55d58542ecde0e66460555ccbcbca355cc5.tar.bz2
[Lex] Use llvm::byteswap instead of sys::getSwappedBytes (NFC)
Diffstat (limited to 'clang/lib/Lex/HeaderMap.cpp')
-rw-r--r--clang/lib/Lex/HeaderMap.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp
index 2b26426..22a1532 100644
--- a/clang/lib/Lex/HeaderMap.cpp
+++ b/clang/lib/Lex/HeaderMap.cpp
@@ -87,9 +87,8 @@ bool HeaderMapImpl::checkHeader(const llvm::MemoryBuffer &File,
// Check the number of buckets. It should be a power of two, and there
// should be enough space in the file for all of them.
- uint32_t NumBuckets = NeedsByteSwap
- ? llvm::sys::getSwappedBytes(Header->NumBuckets)
- : Header->NumBuckets;
+ uint32_t NumBuckets =
+ NeedsByteSwap ? llvm::byteswap(Header->NumBuckets) : Header->NumBuckets;
if (!llvm::isPowerOf2_32(NumBuckets))
return false;
if (File.getBufferSize() <