[llvm] [Profile] Add a more descriptive message to the bad_header error (PR #211281)
Wael Yehia via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 21:06:41 PDT 2026
================
@@ -650,7 +659,25 @@ Error RawInstrProfReader<IntPtrT>::readHeader(
auto *Start = reinterpret_cast<const char *>(&Header);
if (Start + ValueDataOffset > DataBuffer->getBufferEnd())
- return error(instrprof_error::bad_header);
+ return error(
+ instrprof_error::header_size_mismatch,
+ ("Profile file size (" + Twine(DataBuffer->getBufferSize()) +
----------------
w2yehia wrote:
done
https://github.com/llvm/llvm-project/pull/211281
More information about the llvm-commits
mailing list