aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
diff options
context:
space:
mode:
authorZequan Wu <zequanwu@google.com>2024-09-09 11:14:21 -0700
committerGitHub <noreply@github.com>2024-09-09 14:14:21 -0400
commit6850410562123b6e4fbb039e7ba4a2325b994b84 (patch)
tree120acf558e812e6df4170f130fc14ff1a1c939b4 /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
parent5f74671c85877e03622e8d308aee15ed73ccee7c (diff)
downloadllvm-6850410562123b6e4fbb039e7ba4a2325b994b84.zip
llvm-6850410562123b6e4fbb039e7ba4a2325b994b84.tar.gz
llvm-6850410562123b6e4fbb039e7ba4a2325b994b84.tar.bz2
[Coverage] Ignore unused functions if the count is 0. (#107661)
Relax the condition to ignore the case when count is 0. This fixes a bug on https://github.com/llvm/llvm-project/commit/381e9d2386facea7f2acc0f8c16a6d0731267f80. This was reported at https://discourse.llvm.org/t/coverage-from-multiple-test-executables/81024/.
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMapping.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index 18643c6..acb7dd9 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -851,7 +851,7 @@ Error CoverageMapping::loadFunctionRecord(
// won't (in which case we don't unintuitively report functions as uncovered
// when they have non-zero counts in the profile).
if (Record.MappingRegions.size() == 1 &&
- Record.MappingRegions[0].Count.isZero() && Counts[0] > 0)
+ Record.MappingRegions[0].Count.isZero())
return Error::success();
MCDCDecisionRecorder MCDCDecisions;