[llvm] [NFC][DWP] Make `getContributionIndex` static. (PR #141708)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Sat May 31 05:47:51 PDT 2025


https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/141708

>From 5ae8ed0002515785a77ef0b5d1725ce030c96cac Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Fri, 23 May 2025 13:57:51 -0700
Subject: [PATCH] [NFC][DWP] Make `getContributionIndex` static.

---
 llvm/include/llvm/DWP/DWP.h | 3 ---
 llvm/lib/DWP/DWP.cpp        | 5 ++---
 2 files changed, 2 insertions(+), 6 deletions(-)

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