[Memprof] Fix a warning

This patch fixes:

  llvm/lib/ProfileData/MemProfReader.cpp:685:1: error: non-void
  function does not return a value in all con trol paths
  [-Werror,-Wreturn-type]

While I am at it, this patch removes an else-after-return.
This commit is contained in:
Kazu Hirata 2024-06-26 12:05:58 -07:00
parent d058b51604
commit 22b36bfa3f

View File

@ -677,11 +677,10 @@ llvm::SmallVector<std::pair<uint64_t, MemInfoBlock>>
RawMemProfReader::readMemInfoBlocks(const char *Ptr) {
if (MemprofRawVersion == 3ULL)
return readMemInfoBlocksV3(Ptr);
else if (MemprofRawVersion == 4ULL)
if (MemprofRawVersion == 4ULL)
return readMemInfoBlocksV4(Ptr);
else
assert(false &&
"Panic: Unsupported version number when reading MemInfoBlocks");
llvm_unreachable(
"Panic: Unsupported version number when reading MemInfoBlocks");
}
Error RawMemProfReader::readRawProfile(