[llvm] [DWARFLinker] Avoid repeated hash lookups (NFC) (PR #128825)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 22:19:45 PST 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/128825

None

>From 3cdd521877efba374773dc28a0fc3c67c0ef9e9b Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 25 Feb 2025 09:08:24 -0800
Subject: [PATCH] [DWARFLinker] Avoid repeated hash lookups (NFC)

---
 llvm/lib/DWARFLinker/Parallel/DWARFLinkerImpl.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/DWARFLinker/Parallel/DWARFLinkerImpl.cpp b/llvm/lib/DWARFLinker/Parallel/DWARFLinkerImpl.cpp
index 6d9e3319db7e5..23e618adeaeb4 100644
--- a/llvm/lib/DWARFLinker/Parallel/DWARFLinkerImpl.cpp
+++ b/llvm/lib/DWARFLinker/Parallel/DWARFLinkerImpl.cpp
@@ -891,10 +891,9 @@ void DWARFLinkerImpl::printStatistic() {
               CU->tryGetSectionDescriptor(DebugSectionKind::DebugInfo))
         AllDebugInfoSectionsSize += (*DebugInfo)->getContents().size();
 
-    SizeByObject[Context->InputDWARFFile.FileName].Input =
-        Context->OriginalDebugInfoSize;
-    SizeByObject[Context->InputDWARFFile.FileName].Output =
-        AllDebugInfoSectionsSize;
+    auto &Size = SizeByObject[Context->InputDWARFFile.FileName];
+    Size.Input = Context->OriginalDebugInfoSize;
+    Size.Output = AllDebugInfoSectionsSize;
   }
 
   // Create a vector sorted in descending order by output size.



More information about the llvm-commits mailing list