diff --git a/llvm/lib/Support/DAGDeltaAlgorithm.cpp b/llvm/lib/Support/DAGDeltaAlgorithm.cpp index 8b23b05913291..48302b8cb0621 100644 --- a/llvm/lib/Support/DAGDeltaAlgorithm.cpp +++ b/llvm/lib/Support/DAGDeltaAlgorithm.cpp @@ -201,8 +201,9 @@ DAGDeltaAlgorithmImpl::DAGDeltaAlgorithmImpl( std::set &ChangeSuccs = SuccClosure[Change]; for (pred_iterator_ty it = pred_begin(Change), ie = pred_end(Change); it != ie; ++it) { - SuccClosure[*it].insert(Change); - SuccClosure[*it].insert(ChangeSuccs.begin(), ChangeSuccs.end()); + auto &SC = SuccClosure[*it]; + SC.insert(Change); + SC.insert(ChangeSuccs.begin(), ChangeSuccs.end()); Worklist.push_back(*it); } }