[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:19 PDT 2026


================
@@ -513,7 +513,8 @@ Error RawInstrProfReader<IntPtrT>::readHeader() {
   if (!hasFormat(*DataBuffer))
     return error(instrprof_error::bad_magic);
   if (DataBuffer->getBufferSize() < sizeof(RawInstrProf::Header))
-    return error(instrprof_error::bad_header);
+    return error(instrprof_error::bad_header,
+                 std::string("Profile file header is truncated"));
----------------
w2yehia wrote:

i assume you mean the "Begin with lowercase" rule. Done

https://github.com/llvm/llvm-project/pull/211281


More information about the llvm-commits mailing list