Skip to content

[DebugInfo] Use heterogenous lookups with std::map (NFC) #113118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct LVSymbolTableEntry final {

// Function names extracted from the object symbol table.
class LVSymbolTable final {
using LVSymbolNames = std::map<std::string, LVSymbolTableEntry>;
using LVSymbolNames = std::map<std::string, LVSymbolTableEntry, std::less<>>;
LVSymbolNames SymbolNames;

public:
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading