This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cov] Avoid 0% when reporting something that's 0/0
ClosedPublic

Authored by arphaman on Nov 14 2016, 9:06 AM.

Details

Summary

Right now llvm-cov can show 0% (0/0) coverage for things like file function coverage, etc. in reports and HTML output. This can happen for files like headers that have macros but no functions. This patch makes llvm-cov report - (0/0) instead.

Example: “include/clang/AST/BuiltinTypes.def” has 0% (0/0) in http://lab.llvm.org:8080/coverage/coverage-reports/clang/index.html .

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 77822.Nov 14 2016, 9:06 AM
arphaman retitled this revision from to [llvm-cov] Avoid 0% when reporting something that's 0/0.
arphaman updated this object.
arphaman added a reviewer: vsk.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: llvm-commits.
vsk accepted this revision.Nov 14 2016, 1:07 PM
vsk edited edge metadata.

Thanks, LGTM.

I'd prefer it if you could check in a proftext file, and create the profdata file during the test. Also, please check that you compiled with -mllvm -enable-name-compression=false when producing the *.covmapping file -- some bots don't have zlib.

This revision is now accepted and ready to land.Nov 14 2016, 1:07 PM
In D26615#594825, @vsk wrote:

Thanks, LGTM.

I'd prefer it if you could check in a proftext file, and create the profdata file during the test.

Sure.

Also, please check that you compiled with -mllvm -enable-name-compression=false when producing the *.covmapping file -- some bots don't have zlib.

Thanks for letting me know, I'll do that.

This revision was automatically updated to reflect the committed changes.