Skip to content

Commit a7c26aa

Browse files
authored
Revert "[Coverage] Ignore unused functions if the count is 0." (#107901)
Reverts #107661 Breaks llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp
1 parent 02fff93 commit a7c26aa

File tree

2 files changed

+1
-56
lines changed

2 files changed

+1
-56
lines changed

compiler-rt/test/profile/instrprof-merging-2.cpp

Lines changed: 0 additions & 55 deletions
This file was deleted.

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ Error CoverageMapping::loadFunctionRecord(
851851
// won't (in which case we don't unintuitively report functions as uncovered
852852
// when they have non-zero counts in the profile).
853853
if (Record.MappingRegions.size() == 1 &&
854-
Record.MappingRegions[0].Count.isZero())
854+
Record.MappingRegions[0].Count.isZero() && Counts[0] > 0)
855855
return Error::success();
856856

857857
MCDCDecisionRecorder MCDCDecisions;

0 commit comments

Comments
 (0)