[llvm] [Profile] Add a more descriptive message to the bad_header error (PR #211281)

Hubert Tong via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 19:33:43 PDT 2026


================
@@ -101,6 +101,10 @@ static std::string getInstrProfErrString(instrprof_error Err,
   case instrprof_error::bad_header:
     OS << "invalid instrumentation profile data (file header is corrupt)";
     break;
+  case instrprof_error::header_size_mismatch:
+    OS << "profile file size does not match header expectations (file may be "
----------------
hubert-reinterpretcast wrote:

The elaboration added after the fixed message text already explains that the profile file size does not match header expectations. The existing wording (apart from the parenthetical) is reasonable and has the advantage of being shorter.

Suggestion:
```
invalid instrumentation profile data (file is incomplete or header is corrupt)
```

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


More information about the llvm-commits mailing list