Update CoverageMappingFormat Support to Version6
Version 5 adds Branch Regions which are a prerequisite for branch coverage. Version 6 can use the zeroth filename as prefix for other relative files.
This commit is contained in:
@@ -10,6 +10,7 @@ using namespace llvm;
|
||||
|
||||
struct LLVMRustCounterMappingRegion {
|
||||
coverage::Counter Count;
|
||||
coverage::Counter FalseCount;
|
||||
uint32_t FileID;
|
||||
uint32_t ExpandedFileID;
|
||||
uint32_t LineStart;
|
||||
@@ -53,7 +54,7 @@ extern "C" void LLVMRustCoverageWriteMappingToBuffer(
|
||||
MappingRegions.reserve(NumMappingRegions);
|
||||
for (const auto &Region : makeArrayRef(RustMappingRegions, NumMappingRegions)) {
|
||||
MappingRegions.emplace_back(
|
||||
Region.Count, Region.FileID, Region.ExpandedFileID,
|
||||
Region.Count, Region.FalseCount, Region.FileID, Region.ExpandedFileID,
|
||||
Region.LineStart, Region.ColumnStart, Region.LineEnd, Region.ColumnEnd,
|
||||
Region.Kind);
|
||||
}
|
||||
@@ -108,5 +109,9 @@ extern "C" void LLVMRustCoverageWriteMappingVarNameToString(RustStringRef Str) {
|
||||
}
|
||||
|
||||
extern "C" uint32_t LLVMRustCoverageMappingVersion() {
|
||||
return coverage::CovMapVersion::Version4;
|
||||
#if LLVM_VERSION_GE(13, 0)
|
||||
return coverage::CovMapVersion::Version6;
|
||||
#else
|
||||
return coverage::CovMapVersion::Version5;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user