coverage: Correctly report and check LLVM's coverage mapping version

This commit is contained in:
Zalathar 2024-02-13 23:00:49 +11:00
parent a77322c16f
commit 8289dadfbc
2 changed files with 24 additions and 10 deletions

View file

@ -205,5 +205,8 @@ extern "C" void LLVMRustCoverageWriteMappingVarNameToString(RustStringRef Str) {
}
extern "C" uint32_t LLVMRustCoverageMappingVersion() {
return coverage::CovMapVersion::Version6;
// This should always be `CurrentVersion`, because that's the version LLVM
// will use when encoding the data we give it. If for some reason we ever
// want to override the version number we _emit_, do it on the Rust side.
return coverage::CovMapVersion::CurrentVersion;
}