[llvm] b0d1c51 - [DebugInfo] Avoid repeated hash lookups (NFC) (#128395)

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 23 01:03:26 PST 2025


Author: Kazu Hirata
Date: 2025-02-23T01:03:22-08:00
New Revision: b0d1c51a1778120fb6b5871202333fcd873a6d70

URL: https://github.com/llvm/llvm-project/commit/b0d1c51a1778120fb6b5871202333fcd873a6d70
DIFF: https://github.com/llvm/llvm-project/commit/b0d1c51a1778120fb6b5871202333fcd873a6d70.diff

LOG: [DebugInfo] Avoid repeated hash lookups (NFC) (#128395)

Added: 
    

Modified: 
    llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp
index 2433fa5016b88..6ce9bcbeb13c0 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp
@@ -162,11 +162,12 @@ void LVCodeViewReader::cacheRelocations() {
   for (const SectionRef &Section : getObj().sections()) {
     const coff_section *CoffSection = getObj().getCOFFSection(Section);
 
+    auto &RM = RelocMap[CoffSection];
     for (const RelocationRef &Relocacion : Section.relocations())
-      RelocMap[CoffSection].push_back(Relocacion);
+      RM.push_back(Relocacion);
 
     // Sort relocations by address.
-    llvm::sort(RelocMap[CoffSection], [](RelocationRef L, RelocationRef R) {
+    llvm::sort(RM, [](RelocationRef L, RelocationRef R) {
       return L.getOffset() < R.getOffset();
     });
   }


        


More information about the llvm-commits mailing list