aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CoverageMappingGen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index 38aaceb..05fb137 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -2269,6 +2269,11 @@ struct CounterCoverageMappingBuilder
// Track LHS True/False Decision.
const auto DecisionLHS = MCDCBuilder.pop();
+ if (auto Gap =
+ findGapAreaBetween(getEnd(E->getLHS()), getStart(E->getRHS()))) {
+ fillGapAreaWithCount(Gap->getBegin(), Gap->getEnd(), getRegionCounter(E));
+ }
+
// Counter tracks the right hand side of a logical and operator.
extendRegion(E->getRHS());
propagateCounts(getRegionCounter(E), E->getRHS());
@@ -2330,6 +2335,11 @@ struct CounterCoverageMappingBuilder
// Track LHS True/False Decision.
const auto DecisionLHS = MCDCBuilder.pop();
+ if (auto Gap =
+ findGapAreaBetween(getEnd(E->getLHS()), getStart(E->getRHS()))) {
+ fillGapAreaWithCount(Gap->getBegin(), Gap->getEnd(), getRegionCounter(E));
+ }
+
// Counter tracks the right hand side of a logical or operator.
extendRegion(E->getRHS());
propagateCounts(getRegionCounter(E), E->getRHS());