diff options
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index 2bd3211..272749f 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -2612,13 +2612,13 @@ removeRedundantDbgLocsUsingForwardScan(const BasicBlock *BB, NumDefsScanned++; DebugVariable Key(FnVarLocs.getVariable(Loc.VariableID).getVariable(), std::nullopt, Loc.DL.getInlinedAt()); - auto VMI = VariableMap.find(Key); + auto [VMI, Inserted] = VariableMap.try_emplace(Key); // Update the map if we found a new value/expression describing the // variable, or if the variable wasn't mapped already. - if (VMI == VariableMap.end() || VMI->second.first != Loc.Values || + if (Inserted || VMI->second.first != Loc.Values || VMI->second.second != Loc.Expr) { - VariableMap[Key] = {Loc.Values, Loc.Expr}; + VMI->second = {Loc.Values, Loc.Expr}; NewDefs.push_back(Loc); continue; } |