Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 23, 2025

@llvm/pr-subscribers-debuginfo

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/128395.diff

1 Files Affected:

  • (modified) llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp (+3-2)
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();
     });
   }

@kazutakahirata kazutakahirata merged commit b0d1c51 into llvm:main Feb 23, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_DebugInfo branch February 23, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants