[PATCH] D20878: [Coverage] Do not push a new region after a CXXTryStmt

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 09:13:50 PDT 2016


vsk added a comment.

In http://reviews.llvm.org/D20878#446690, @ikudrin wrote:

> Is there a case where this patch makes things better than they were before? Is it possible to improve handling of exceptions instead?


This patch removes something which doesn't appear to serve a useful purpose. In general, I don't see a way to handle stack unwinding well. Consider:

  1| void f() {
  2|  may_throw();
  3|  may_throw();
  4|  return;
  5|}

It would be prohibitively expensive to create separate regions and counters for lines 3 and 4, and after every callsite of `f`, and all its callsites, etc. We could improve the situation slightly by (1) documenting that stack unwinding is not handled precisely, and/or (2) emitting a diagnostic if the TU contains a `throw` statement. This would make the resulting coverage reports less surprising to users.


http://reviews.llvm.org/D20878





More information about the cfe-commits mailing list