aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
diff options
context:
space:
mode:
authorAlan Phipps <a-phipps@ti.com>2023-12-13 14:13:56 -0600
committerAlan Phipps <a-phipps@ti.com>2023-12-13 15:10:05 -0600
commit8ecbb0404d740d1ab173554e47cef39cd5e3ef8c (patch)
tree93cc0afc02965f5ccc27dc83c7389662ef772661 /llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
parent14d7e0bb0f75066da5d2eff718b6d59215a02077 (diff)
downloadllvm-8ecbb0404d740d1ab173554e47cef39cd5e3ef8c.zip
llvm-8ecbb0404d740d1ab173554e47cef39cd5e3ef8c.tar.gz
llvm-8ecbb0404d740d1ab173554e47cef39cd5e3ef8c.tar.bz2
Reland "[Coverage][llvm-cov] Enable MC/DC Support in LLVM Source-based Code Coverage (2/3)"
Part 2 of 3. This includes the Visualization and Evaluation components. Differential Revision: https://reviews.llvm.org/D138847
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp')
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp b/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
index 2abfbba..1c7d8a8 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
@@ -237,6 +237,23 @@ void CoverageMappingWriter::write(raw_ostream &OS) {
writeCounter(MinExpressions, Count, OS);
writeCounter(MinExpressions, FalseCount, OS);
break;
+ case CounterMappingRegion::MCDCBranchRegion:
+ encodeULEB128(unsigned(I->Kind)
+ << Counter::EncodingCounterTagAndExpansionRegionTagBits,
+ OS);
+ writeCounter(MinExpressions, Count, OS);
+ writeCounter(MinExpressions, FalseCount, OS);
+ encodeULEB128(unsigned(I->MCDCParams.ID), OS);
+ encodeULEB128(unsigned(I->MCDCParams.TrueID), OS);
+ encodeULEB128(unsigned(I->MCDCParams.FalseID), OS);
+ break;
+ case CounterMappingRegion::MCDCDecisionRegion:
+ encodeULEB128(unsigned(I->Kind)
+ << Counter::EncodingCounterTagAndExpansionRegionTagBits,
+ OS);
+ encodeULEB128(unsigned(I->MCDCParams.BitmapIdx), OS);
+ encodeULEB128(unsigned(I->MCDCParams.NumConditions), OS);
+ break;
}
assert(I->LineStart >= PrevLineStart);
encodeULEB128(I->LineStart - PrevLineStart, OS);