Skip to content

Commit 791da3c

Browse files
[AsmPrinter] Avoid repeated hash lookups (NFC) (#128630)
1 parent 7501c9c commit 791da3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,8 +1777,9 @@ DIE *DwarfCompileUnit::getOrCreateContextDIE(const DIScope *Context) {
17771777

17781778
// Otherwise the context must be a DISubprogram.
17791779
auto *SPScope = cast<DISubprogram>(Context);
1780-
if (getAbstractScopeDIEs().count(SPScope))
1781-
return getAbstractScopeDIEs()[SPScope];
1780+
const auto &DIEs = getAbstractScopeDIEs();
1781+
if (auto It = DIEs.find(SPScope); It != DIEs.end())
1782+
return It->second;
17821783
}
17831784
return DwarfUnit::getOrCreateContextDIE(Context);
17841785
}

0 commit comments

Comments
 (0)