[PATCH] D49915: [IR] Add a boolean field in DILocation to know if a line must covered or not

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 09:33:41 PDT 2018


vsk added a comment.

In https://reviews.llvm.org/D49915#1184336, @aprantl wrote:

> > DILocation isn't only used for coverage, I think this should probably be a more general purpose flag, like "isImplicitCode", to indicate that the code was generated as part of a destructor cleanup, an epilogue, or something else that requires the compiler to generate IR that isn't obviously attributed to user source code. Then GCOV can decide for itself how it wants to generate coverage.
>
> We have a marker for compiler-generated code that has no relation to any source code; it's the special line number 0. This sounds like this patch is trying to work around a frontend bug, and really the frontend shouldn't stick misleading line numbers on the code? There's an RAII object in clang to generate locations for compiler/auto-generated code.


A caveat to this: plenty of users (and plenty of tests) expect to be able to set breakpoints on scope-closing curly braces. Assigning line 0 to those braces would at the minimum break a lot of tests, and would likely be viewed as a serious regression.


Repository:
  rL LLVM

https://reviews.llvm.org/D49915





More information about the llvm-commits mailing list