[PATCH] D147073: [Coverage] Handle invalid end location of an expression/statement.

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 01:41:42 PDT 2023


hans added a comment.

I'm not familiar with this code. I suppose the question is whether it's reasonable for this code to expect that the source locations are always valid or not?



================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:605
 
+    // If the either location is invalid, set it to std::nullopt to avoid
+    // letting users of RegionStack think that region has a valid start/end
----------------
nit: the "the" is not needed


================
Comment at: clang/test/CoverageMapping/invalid_location.cpp:31
+//        now because 'T<C>{}' doesn't have a valid end location for now.
+// CHECK-NETX:   File 0, 13:9 -> 13:14 = #3
+// CHECK-NETX:   File 0, 13:18 -> 13:23 = (#0 - #3)
----------------
s/NETX/NEXT/ here and below?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147073



More information about the cfe-commits mailing list