Skip to content

Commit 30089b1

Browse files
[DWARF] Avoid repeated hash lookups (NFC) (#110202)
1 parent 60a6e6f commit 30089b1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,8 @@ void DWARFVerifier::verifyDebugLineRows() {
10141014
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, FullPath);
10151015
assert(HasFullPath && "Invalid index?");
10161016
(void)HasFullPath;
1017-
auto It = FullPathMap.find(FullPath);
1018-
if (It == FullPathMap.end())
1019-
FullPathMap[FullPath] = FileIndex;
1020-
else if (It->second != FileIndex && DumpOpts.Verbose) {
1017+
auto [It, Inserted] = FullPathMap.try_emplace(FullPath, FileIndex);
1018+
if (!Inserted && It->second != FileIndex && DumpOpts.Verbose) {
10211019
warn() << ".debug_line["
10221020
<< format("0x%08" PRIx64,
10231021
*toSectionOffset(Die.find(DW_AT_stmt_list)))

0 commit comments

Comments
 (0)