[llvm] [Coverage] Skip empty profile name section (PR #108480)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 12 19:23:26 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-pgo
Author: None (gulfemsavrun)
<details>
<summary>Changes</summary>
llvm-cov reads __llvm_prf_names section in an object file to find the profile names, and it instead reads __llvm_covnames section in binary profile correlation mode when __llvm_prf_names section is omitted. This patch ensures that it still reads __llvm_covnames section when there is an empty __llvm_prf_names section.
---
Full diff: https://github.com/llvm/llvm-project/pull/108480.diff
1 Files Affected:
- (modified) llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp (+3)
``````````diff
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
index 445b48067a9755..70967125001761 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
@@ -1065,6 +1065,9 @@ lookupSections(ObjectFile &OF, InstrProfSectKind IPSK) {
// start/end of the section. If its size is 2 bytes, it's empty.
if (IsCOFF && IPSK == IPSK_name && Section.getSize() == 2)
continue;
+ // Skip empty profile name section.
+ if (IPSK == IPSK_name && Section.getSize() == 0)
+ continue;
Sections.push_back(Section);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/108480
More information about the llvm-commits
mailing list