[PATCH] D85176: [Coverage] Emit gap region after conditions when macro is present.
Vedant Kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 18 10:50:29 PST 2021
vsk added a comment.
Could you check in the reproducer program (`void p`) as a regression test?
================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:995
+
+ AfterLoc = getPreciseTokenLocEnd(getIncludeOrExpansionLoc(AfterLoc));
+ assert(AfterLoc.isValid());
----------------
It could aid debugging to assert that the result of `getIncludeOrExpansionLoc(AfterLoc)` is valid.
================
Comment at: clang/test/CoverageMapping/if.cpp:10
+void foo() { // CHECK-NEXT: Gap,File 0, [[@LINE+1]]:21 -> [[@LINE+1]]:22 = #2
if (int j = true ? nop() // CHECK-NEXT: [[@LINE]]:22 -> [[@LINE]]:27 = #2
: nop(); // CHECK-NEXT: [[@LINE]]:22 -> [[@LINE]]:27 = (#0 - #2)
----------------
Just to double-check: this is now starting the gap after the '?', instead of including the '?' - if so, that looks right.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85176/new/
https://reviews.llvm.org/D85176
More information about the cfe-commits
mailing list