Skip to content

Commit e62c214

Browse files
[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.
1 parent 998c33e commit e62c214

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

llvm/lib/ProfileData/InstrProfReader.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,7 @@ readBinaryIdsInternal(const MemoryBuffer &DataBuffer,
113113
instrprof_error::malformed,
114114
"not enough data to read binary id length");
115115

116-
uint64_t BILen = 0;
117-
if (Endian == llvm::endianness::little)
118-
BILen = endian::readNext<uint64_t, llvm::endianness::little>(BI);
119-
else
120-
BILen = endian::readNext<uint64_t, llvm::endianness::big>(BI);
121-
116+
uint64_t BILen = endian::readNext<uint64_t>(BI, Endian);
122117
if (BILen == 0)
123118
return make_error<InstrProfError>(instrprof_error::malformed,
124119
"binary id length is 0");

0 commit comments

Comments
 (0)