diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index e23cd819f07..9f96cbaf8a5 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -365,9 +365,8 @@ MemoryDependenceResults::getInvariantGroupPointerDependency(LoadInst *LI, continue; if (auto *BCI = dyn_cast(Ptr)) { - if (!Seen.count(BCI->getOperand(0))) { + if (Seen.insert(BCI->getOperand(0)).second) { LoadOperandsQueue.push_back(BCI->getOperand(0)); - Seen.insert(BCI->getOperand(0)); } } @@ -377,9 +376,8 @@ MemoryDependenceResults::getInvariantGroupPointerDependency(LoadInst *LI, continue; if (auto *BCI = dyn_cast(U)) { - if (!Seen.count(BCI)) { + if (Seen.insert(BCI).second) { LoadOperandsQueue.push_back(BCI); - Seen.insert(BCI); } continue; } diff --git a/lib/CodeGen/LiveDebugValues.cpp b/lib/CodeGen/LiveDebugValues.cpp index 1297273ee5b..4ff88d52810 100644 --- a/lib/CodeGen/LiveDebugValues.cpp +++ b/lib/CodeGen/LiveDebugValues.cpp @@ -487,8 +487,7 @@ bool LiveDebugValues::ExtendRanges(MachineFunction &MF) { if (OLChanged) { OLChanged = false; for (auto s : MBB->successors()) - if (!OnPending.count(s)) { - OnPending.insert(s); + if (OnPending.insert(s).second) { Pending.push(BBToOrder[s]); } } diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 9be0daada50..5ada72f9f94 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -1604,7 +1604,8 @@ protected: E = SortedCategories.end(); Category != E; ++Category) { // Hide empty categories for -help, but show for -help-hidden. - bool IsEmptyCategory = CategorizedOptions[*Category].size() == 0; + const auto &CategoryOptions = CategorizedOptions[*Category]; + bool IsEmptyCategory = CategoryOptions.empty(); if (!ShowHidden && IsEmptyCategory) continue; @@ -1625,11 +1626,8 @@ protected: continue; } // Loop over the options in the category and print. - for (std::vector