diff --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h index f356e3a54a364..aa6cdf198485b 100644 --- a/llvm/include/llvm/ProfileData/MemProf.h +++ b/llvm/include/llvm/ProfileData/MemProf.h @@ -471,16 +471,12 @@ class RecordLookupTrait { hash_value_type ComputeHash(uint64_t K) { return K; } - std::pair + static std::pair ReadKeyDataLength(const unsigned char *&D) { using namespace support; - // Starting with Version2, we don't read the key length because it is a - // constant. offset_type KeyLen = - Version < Version2 - ? endian::readNext(D) - : sizeof(uint64_t); + endian::readNext(D); offset_type DataLen = endian::readNext(D); return std::make_pair(KeyLen, DataLen); @@ -538,9 +534,7 @@ class RecordWriterTrait { endian::Writer LE(Out, llvm::endianness::little); offset_type N = sizeof(K); - // Starting with Version2, we omit the key length because it is a constant. - if (Version < Version2) - LE.write(N); + LE.write(N); offset_type M = V.serializedSize(Version); LE.write(M); return std::make_pair(N, M); diff --git a/llvm/include/llvm/Support/OnDiskHashTable.h b/llvm/include/llvm/Support/OnDiskHashTable.h index b6dbea53f3da6..f6b4055e74de7 100644 --- a/llvm/include/llvm/Support/OnDiskHashTable.h +++ b/llvm/include/llvm/Support/OnDiskHashTable.h @@ -377,7 +377,7 @@ template class OnDiskChainedHashTable { // Determine the length of the key and the data. const std::pair &L = - InfoPtr->ReadKeyDataLength(Items); + Info::ReadKeyDataLength(Items); offset_type ItemLen = L.first + L.second; // Compare the hashes. If they are not the same, skip the entry entirely.