diff --git a/llvm/lib/IR/DroppedVariableStats.cpp b/llvm/lib/IR/DroppedVariableStats.cpp index 9e221bf585f1a..b8c0dd6e7b1dc 100644 --- a/llvm/lib/IR/DroppedVariableStats.cpp +++ b/llvm/lib/IR/DroppedVariableStats.cpp @@ -117,8 +117,7 @@ void DroppedVariableStats::removeVarFromAllSets(VarID Var, const Function *F) { bool DroppedVariableStats::isScopeChildOfOrEqualTo(const DIScope *Scope, const DIScope *DbgValScope) { while (Scope != nullptr) { - if (VisitedScope.find(Scope) == VisitedScope.end()) { - VisitedScope.insert(Scope); + if (VisitedScope.insert(Scope).second) { if (Scope == DbgValScope) { VisitedScope.clear(); return true;