File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -947,6 +947,11 @@ struct CounterCoverageMappingBuilder
947
947
return {ExecCnt, Builder.subtract (ParentCnt, ExecCnt)};
948
948
}
949
949
950
+ Counter getSwitchImplicitDefaultCounter (const Stmt *Cond, Counter ParentCount,
951
+ Counter CaseCountSum) {
952
+ return Builder.subtract (ParentCount, CaseCountSum);
953
+ }
954
+
950
955
bool IsCounterEqual (Counter OutCount, Counter ParentCount) {
951
956
if (OutCount == ParentCount)
952
957
return true ;
@@ -1903,7 +1908,8 @@ struct CounterCoverageMappingBuilder
1903
1908
// the hidden branch, which will be added later by the CodeGen. This region
1904
1909
// will be associated with the switch statement's condition.
1905
1910
if (!HasDefaultCase) {
1906
- Counter DefaultCount = subtractCounters (ParentCount, CaseCountSum);
1911
+ Counter DefaultCount = getSwitchImplicitDefaultCounter (
1912
+ S->getCond (), ParentCount, CaseCountSum);
1907
1913
createBranchRegion (S->getCond (), Counter::getZero (), DefaultCount);
1908
1914
}
1909
1915
}
You can’t perform that action at this time.
0 commit comments