[PATCH] D25040: [Coverage] Do not emit coverage mappings for functions marked 'unused'

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 15:32:19 PDT 2016

arphaman added a comment.

Thanks for working on this, I have a couple of comments/questions:

- The current logic doesn't work correctly for a test case that's shown below:

  class C2 {
    void __attribute__((unused)) m4() { }
    void __attribute__((unused)) m5();

The method 'm4' actually gets covered with a zero region. I suspect you might have to perform the check for the attribute in the 'EmptyCoverageMappingBuilder' class as well.

- I understand the value in ignoring coverage for unused functions which aren't actually used anywhere. But people can still use them freely, so do you think that it would be a good idea to provide coverage for those functions when they are actually used?


More information about the cfe-commits mailing list