[PATCH] D84988: [Coverage] Add empty line regions to SkippedRegions

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 17 13:12:23 PDT 2020


zequanwu added inline comments.


================
Comment at: llvm/lib/ProfileData/Coverage/CoverageMapping.cpp:580
       const auto &R = Segments[I];
-      if (!(L.Line < R.Line) && !(L.Line == R.Line && L.Col < R.Col)) {
+      if (!(L.Line <= R.Line) && !(L.Line == R.Line && L.Col <= R.Col)) {
         LLVM_DEBUG(dbgs() << " ! Segment " << L.Line << ":" << L.Col
----------------
zequanwu wrote:
> vsk wrote:
> > I don't think this relaxation is correct, since it permits duplicate segments. This is confusing for reporting tools because it's not possible to work out which segment applies at a given source location.
> I don't remember why I made this change. Reverting it seems nothing changed.
Oh, since single empty line will be a 0 length regions. `L.Col`  could equal to `R.Col`. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84988/new/

https://reviews.llvm.org/D84988



More information about the cfe-commits mailing list