[llvm] 2cbe8df - [NFC][DWP] Make `getContributionIndex` static (#141708)
via llvm-commits
llvm-commits at lists.llvm.org
Sat May 31 07:32:50 PDT 2025
Author: Rahul Joshi
Date: 2025-05-31T07:32:46-07:00
New Revision: 2cbe8df1819f9c4e2e89d13b933c5a594bbe3a0f
URL: https://github.com/llvm/llvm-project/commit/2cbe8df1819f9c4e2e89d13b933c5a594bbe3a0f
DIFF: https://github.com/llvm/llvm-project/commit/2cbe8df1819f9c4e2e89d13b933c5a594bbe3a0f.diff
LOG: [NFC][DWP] Make `getContributionIndex` static (#141708)
Remove `getContributionIndex` declaration from header and make it static
as it seems to be only used within the .cpp file.
Added:
Modified:
llvm/include/llvm/DWP/DWP.h
llvm/lib/DWP/DWP.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/DWP/DWP.h b/llvm/include/llvm/DWP/DWP.h
index 37d2d27af5b6b..a759bae10d160 100644
--- a/llvm/include/llvm/DWP/DWP.h
+++ b/llvm/include/llvm/DWP/DWP.h
@@ -70,9 +70,6 @@ struct CompileUnitIdentifiers {
LLVM_ABI Error write(MCStreamer &Out, ArrayRef<std::string> Inputs,
OnCuIndexOverflow OverflowOptValue);
-LLVM_ABI unsigned getContributionIndex(DWARFSectionKind Kind,
- uint32_t IndexVersion);
-
LLVM_ABI Error handleSection(
const StringMap<std::pair<MCSection *, DWARFSectionKind>> &KnownSections,
const MCSection *StrSection, const MCSection *StrOffsetSection,
diff --git a/llvm/lib/DWP/DWP.cpp b/llvm/lib/DWP/DWP.cpp
index fecd184ca68a8..dc364017bf82e 100644
--- a/llvm/lib/DWP/DWP.cpp
+++ b/llvm/lib/DWP/DWP.cpp
@@ -156,14 +156,13 @@ static bool isSupportedSectionKind(DWARFSectionKind Kind) {
return Kind != DW_SECT_EXT_unknown;
}
-namespace llvm {
// Convert an internal section identifier into the index to use with
// UnitIndexEntry::Contributions.
-unsigned getContributionIndex(DWARFSectionKind Kind, uint32_t IndexVersion) {
+static unsigned getContributionIndex(DWARFSectionKind Kind,
+ uint32_t IndexVersion) {
assert(serializeSectionKind(Kind, IndexVersion) >= DW_SECT_INFO);
return serializeSectionKind(Kind, IndexVersion) - DW_SECT_INFO;
}
-} // namespace llvm
// Convert a UnitIndexEntry::Contributions index to the corresponding on-disk
// value of the section identifier.
More information about the llvm-commits
mailing list