aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorZequan Wu <zequanwu@google.com>2021-02-02 20:43:13 -0800
committerZequan Wu <zequanwu@google.com>2021-02-03 13:33:22 -0800
commit4dc08cc3aa41a28ca6ec82bb9c7183048761aad5 (patch)
treed02613d80d64f37ba0a2c4fec632448b9c0e2735 /clang/lib
parentd41c6d51cbadbbd0f81c6ac0d6628d01b881e2a5 (diff)
downloadllvm-4dc08cc3aa41a28ca6ec82bb9c7183048761aad5.zip
llvm-4dc08cc3aa41a28ca6ec82bb9c7183048761aad5.tar.gz
llvm-4dc08cc3aa41a28ca6ec82bb9c7183048761aad5.tar.bz2
[Coverage] Propogate counter to condition of conditional operator
Clang usually propagates counter mapping region for conditions of `if`, `while`, `for`, etc from parent counter. We should do the same for condition of conditional operator. Differential Revision: https://reviews.llvm.org/D95918
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index 5c25c20..4ebdaf6 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -1462,7 +1462,7 @@ struct CounterCoverageMappingBuilder
Counter ParentCount = getRegion().getCounter();
Counter TrueCount = getRegionCounter(E);
- Visit(E->getCond());
+ propagateCounts(ParentCount, E->getCond());
if (!isa<BinaryConditionalOperator>(E)) {
// The 'then' count applies to the area immediately after the condition.