From e62c2146aa9a195c219b3585eb36c6987857c1bb Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 8 Jun 2024 14:03:30 -0700 Subject: [PATCH] [ProfileData] Simplify calls to readNext in readBinaryIdsInternal (NFC) (#94862) readNext has two variants: - readNext(ptr) - readNext(ptr, endian) This patch uses the latter to simplify readBinaryIdsInternal. Both forms default to unaligned. --- llvm/lib/ProfileData/InstrProfReader.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp index 27855bf92b871f..54a2a61c318755 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(BI); - else - BILen = endian::readNext(BI); - + uint64_t BILen = endian::readNext(BI, Endian); if (BILen == 0) return make_error(instrprof_error::malformed, "binary id length is 0");