This revision was automatically updated to reflect the committed changes.
Closed by commit rG859bf4d2bea2: [Coverage] Emit a gap region to cover switch
bodies (authored by vsk).
Herald added a project: clang.
Changed prior to commit:
https://reviews.llvm.org/D70571?vs=231724&id=231964#toc
Repo
vsk marked an inline comment as done.
vsk added inline comments.
Comment at: clang/docs/SourceBasedCodeCoverage.rst:330
+last case ends). This gap region has a zero count: this causes "gap" areas in
+between case statements, which contain no executable code, to appear uncovered.
hans accepted this revision.
hans added a comment.
This revision is now accepted and ready to land.
Looks fine to me.
Comment at: clang/docs/SourceBasedCodeCoverage.rst:330
+last case ends). This gap region has a zero count: this causes "gap" areas in
+between case statements,
vsk updated this revision to Diff 231724.
vsk added a comment.
Add test case from PR44011.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70571/new/
https://reviews.llvm.org/D70571
Files:
clang/docs/SourceBasedCodeCoverage.rst
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/test/Co
hans added a comment.
Thanks!
I'm not that familiar with the coverage counters, but this seems good as far as
I can tell.
Maybe add the test case from PR44011? I didn't see any test cases with that
kind of gaps between cases.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70571/new/
ht
vsk updated this revision to Diff 230714.
vsk added a comment.
- Add some documentation about clang internals.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70571/new/
https://reviews.llvm.org/D70571
Files:
clang/docs/SourceBasedCodeCoverage.rst
clang/lib/CodeGen/CoverageMappingGen
vsk planned changes to this revision.
vsk marked an inline comment as done.
vsk added a comment.
I'll write something up in the coverage mapping docs. Briefly, though, with
this change there should be a gap region that covers the entire switch body
(starting from the '{' in 'switch {', and termi
efriedma added a comment.
Could you write a description somewhere of what the overall region tree should
look like for a switch?
Comment at: clang/test/CoverageMapping/switch.cpp:32
switch (i) { // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+6]]:2 = #4
-nop();
vsk created this revision.
vsk added reviewers: hans, rnk, efriedma.
vsk edited the summary of this revision.
Emit a gap region beginning where the switch body begins. This sets line
execution counts in the areas between non-overlapping cases to 0.
This does not resolve an outstanding issue with