When a user uses a mismatched clang + llvm-profdata, they didn't get a very informative error message. It would just say "unsupported version".
As a result, users are often confused as to what they are supposed to do and tend to assume that it's a bug in the profiling runtime.
This patch improves the error message by:
- Adding a new class of error (raw_profile_version_mismatch) to make it clear that, specifically, the *raw profile* version is unsupported because of a tool mismatch.
- Adding an error message that tells the user which raw profile version was encountered, which version was expected, and instructs them to align their tool versions.
To support this, this patch also updates InstrProfError::take to also propagate the optional error message.
Given how pervasive the problem is, maybe the error message should also link to the docs explaining what the compatibility guarantees are/are-not.