diff --git a/llvm/include/llvm/Passes/DroppedVariableStats.h b/llvm/include/llvm/Passes/DroppedVariableStats.h index e2e91891e24c1..30fbeae703b03 100644 --- a/llvm/include/llvm/Passes/DroppedVariableStats.h +++ b/llvm/include/llvm/Passes/DroppedVariableStats.h @@ -96,9 +96,10 @@ class DroppedVariableStats { DenseSet &DebugVariablesBeforeSet = DbgVariables.DebugVariablesBefore; DenseSet &DebugVariablesAfterSet = DbgVariables.DebugVariablesAfter; - if (InlinedAts.back().find(FuncName) == InlinedAts.back().end()) + auto It = InlinedAts.back().find(FuncName); + if (It == InlinedAts.back().end()) return; - DenseMap &InlinedAtsMap = InlinedAts.back()[FuncName]; + DenseMap &InlinedAtsMap = It->second; // Find an Instruction that shares the same scope as the dropped #dbg_value // or has a scope that is the child of the scope of the #dbg_value, and has // an inlinedAt equal to the inlinedAt of the #dbg_value or it's inlinedAt