Skip to content

Commit 22b36bf

Browse files
[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.
1 parent d058b51 commit 22b36bf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/ProfileData/MemProfReader.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,10 @@ llvm::SmallVector<std::pair<uint64_t, MemInfoBlock>>
677677
RawMemProfReader::readMemInfoBlocks(const char *Ptr) {
678678
if (MemprofRawVersion == 3ULL)
679679
return readMemInfoBlocksV3(Ptr);
680-
else if (MemprofRawVersion == 4ULL)
680+
if (MemprofRawVersion == 4ULL)
681681
return readMemInfoBlocksV4(Ptr);
682-
else
683-
assert(false &&
684-
"Panic: Unsupported version number when reading MemInfoBlocks");
682+
llvm_unreachable(
683+
"Panic: Unsupported version number when reading MemInfoBlocks");
685684
}
686685

687686
Error RawMemProfReader::readRawProfile(

0 commit comments

Comments
 (0)