diff --git a/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp index 3ed0de14f93f0..5673ea7c2cd23 100644 --- a/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp +++ b/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp @@ -312,8 +312,9 @@ Error LVCompare::execute(LVReader *ReferenceReader, LVReader *TargetReader) { // We need to find an insertion point in the reference scopes tree. Parent = Element->getParentScope(); - if (ScopeLinks.find(Parent) != ScopeLinks.end()) { - LVScope *InsertionPoint = ScopeLinks[Parent]; + auto It = ScopeLinks.find(Parent); + if (It != ScopeLinks.end()) { + LVScope *InsertionPoint = It->second; LLVM_DEBUG({ dbgs() << "Inserted at: " << hexSquareString(InsertionPoint->getOffset()) << "\n";