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(); }); }