This is an archive of the discontinued LLVM Phabricator instance.

[sancov] adding leading zeros to coverage pct.
ClosedPublic

Authored by aizatsky on Mar 23 2016, 5:15 PM.

Details

Summary

Using leading zeroes allows you to search for "000%" to find non-covered
items.

Diff Detail

Event Timeline

aizatsky updated this revision to Diff 51496.Mar 23 2016, 5:15 PM
aizatsky retitled this revision from to [sancov] adding leading zeros to coverage pct..
aizatsky updated this object.
aizatsky added a subscriber: llvm-commits.
kcc accepted this revision.Mar 23 2016, 6:44 PM
kcc edited edge metadata.

LGTM
I am sure a UI expert could suggest us a better way, but this is better than we have now.

This revision is now accepted and ready to land.Mar 23 2016, 6:44 PM
aizatsky updated this revision to Diff 51569.Mar 24 2016, 10:24 AM
aizatsky edited edge metadata.

giving zeroes a shade of gray.

vitalybuka accepted this revision.Mar 24 2016, 10:36 AM
vitalybuka edited edge metadata.
vitalybuka added inline comments.
tools/sancov/sancov.cc
497

probably std::size_t{0} ->0u is enough

vitalybuka added inline comments.Mar 24 2016, 10:44 AM
tools/sancov/sancov.cc
502

std::string Num = std::to_string(Pct);
return std::string(3-Num.size(), ''0") + Num;

aizatsky updated this revision to Diff 51590.Mar 24 2016, 1:21 PM
aizatsky marked an inline comment as done.
aizatsky edited edge metadata.

review

ptal

tools/sancov/sancov.cc
497

Not really. You need 0ul, but that makes this code not cross-platform.

This revision was automatically updated to reflect the committed changes.