aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-06-08 14:03:30 -0700
committerGitHub <noreply@github.com>2024-06-08 14:03:30 -0700
commite62c2146aa9a195c219b3585eb36c6987857c1bb (patch)
tree7021e481762cb17608359341386c31baa1a2325a
parent998c33e5fccd421a910c0a12689b35daf73e1856 (diff)
downloadllvm-e62c2146aa9a195c219b3585eb36c6987857c1bb.zip
llvm-e62c2146aa9a195c219b3585eb36c6987857c1bb.tar.gz
llvm-e62c2146aa9a195c219b3585eb36c6987857c1bb.tar.bz2
[ProfileData] Simplify calls to readNext in readBinaryIdsInternal (NFC) (#94862)
readNext has two variants: - readNext<uint64_t, endian>(ptr) - readNext<uint64_t>(ptr, endian) This patch uses the latter to simplify readBinaryIdsInternal. Both forms default to unaligned.
-rw-r--r--llvm/lib/ProfileData/InstrProfReader.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index 27855bf..54a2a61 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -113,12 +113,7 @@ readBinaryIdsInternal(const MemoryBuffer &DataBuffer,
instrprof_error::malformed,
"not enough data to read binary id length");
- uint64_t BILen = 0;
- if (Endian == llvm::endianness::little)
- BILen = endian::readNext<uint64_t, llvm::endianness::little>(BI);
- else
- BILen = endian::readNext<uint64_t, llvm::endianness::big>(BI);
-
+ uint64_t BILen = endian::readNext<uint64_t>(BI, Endian);
if (BILen == 0)
return make_error<InstrProfError>(instrprof_error::malformed,
"binary id length is 0");