[DebugInfo] Avoid repeated hash lookups (NFC) (#128632)

This commit is contained in:
Kazu Hirata 2025-02-25 09:02:52 -08:00 committed by GitHub
parent 43401dd0b5
commit 38f8ca1d18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -721,12 +721,11 @@ Error LVCodeViewReader::traverseSymbolSection(StringRef SectionName,
getFileName());
LLVM_DEBUG({ W.printString("Symbol Name", SymbolName); });
if (FunctionLineTables.count(SymbolName) != 0) {
if (!FunctionLineTables.try_emplace(SymbolName, Contents).second) {
// Saw debug info for this function already?
return createStringError(object_error::parse_failed, getFileName());
}
FunctionLineTables[SymbolName] = Contents;
SymbolNames.push_back(SymbolName);
}
break;