Skip to content

Commit 7c2c7a4

Browse files
[AsmPrinter] Avoid repeated hash lookups (NFC) (llvm#125814)
1 parent dd099e9 commit 7c2c7a4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,8 +1757,11 @@ void DwarfCompileUnit::createBaseTypeDIEs() {
17571757
DIE *DwarfCompileUnit::getLexicalBlockDIE(const DILexicalBlock *LB) {
17581758
// Assume if there is an abstract tree all the DIEs are already emitted.
17591759
bool isAbstract = getAbstractScopeDIEs().count(LB->getSubprogram());
1760-
if (isAbstract && getAbstractScopeDIEs().count(LB))
1761-
return getAbstractScopeDIEs()[LB];
1760+
if (isAbstract) {
1761+
auto &DIEs = getAbstractScopeDIEs();
1762+
if (auto It = DIEs.find(LB); It != DIEs.end())
1763+
return It->second;
1764+
}
17621765
assert(!isAbstract && "Missed lexical block DIE in abstract tree!");
17631766

17641767
// Return a concrete DIE if it exists or nullptr otherwise.

0 commit comments

Comments
 (0)