This is an archive of the discontinued LLVM Phabricator instance.

Clamp negative coverage counters to zero.
Needs ReviewPublic

Authored by Hiralo on Mar 11 2022, 4:29 AM.

Details

Reviewers
vsk
Summary

commit 60009ab7a6491095b99acd1445dfe0fc5418cb3f
Author: Hiral Oza <hiral.oza@netapp.com>
Date: Fri Mar 11 10:19:51 2022 +0530

Clamp negative coverage counters to zero.

Because there is no locking on counter updates, race conditions may
cause counters to become negative. Clamp them to zero when exporting
LCOV reports.

Optionally remove blank lines from coverage

Added -omit-blank-lines option to add Skip regions to the coverage map
for lines of source code that are blank.

Author: Thom.Harp@netapp.com

Diff Detail

Event Timeline

Hiralo created this revision.Mar 11 2022, 4:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2022, 4:29 AM
Hiralo requested review of this revision.Mar 11 2022, 4:29 AM

Wouldn't it be best to instead fix the non-thread-safety of the coverage counters?

Wouldn't it be best to instead fix the non-thread-safety of the coverage counters?

Can you please elaborate or point me to code? Thanks