From 87817f1f7138c3b68ec615d186f7be315e7b5376 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 20 Oct 2024 12:13:31 -0700 Subject: [PATCH] [DebugInfo] Use heterogenous lookups with std::map (NFC) --- .../llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h | 2 +- llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h index f76f2ecd3e212..9cda64e33ddf7 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h @@ -47,7 +47,7 @@ struct LVSymbolTableEntry final { // Function names extracted from the object symbol table. class LVSymbolTable final { - using LVSymbolNames = std::map; + using LVSymbolNames = std::map>; LVSymbolNames SymbolNames; public: diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp index c45f0e91c4358..932346e1b011b 100644 --- a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp +++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp @@ -87,20 +87,20 @@ LVSectionIndex LVSymbolTable::update(LVScope *Function) { const LVSymbolTableEntry &LVSymbolTable::getEntry(StringRef Name) { static LVSymbolTableEntry Empty = LVSymbolTableEntry(); - LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name)); + LVSymbolNames::iterator Iter = SymbolNames.find(Name); return Iter != SymbolNames.end() ? Iter->second : Empty; } LVAddress LVSymbolTable::getAddress(StringRef Name) { - LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name)); + LVSymbolNames::iterator Iter = SymbolNames.find(Name); return Iter != SymbolNames.end() ? Iter->second.Address : 0; } LVSectionIndex LVSymbolTable::getIndex(StringRef Name) { - LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name)); + LVSymbolNames::iterator Iter = SymbolNames.find(Name); return Iter != SymbolNames.end() ? Iter->second.SectionIndex : getReader().getDotTextSectionIndex(); } bool LVSymbolTable::getIsComdat(StringRef Name) { - LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name)); + LVSymbolNames::iterator Iter = SymbolNames.find(Name); return Iter != SymbolNames.end() ? Iter->second.IsComdat : false; }